[SRU] [B/D] [PATCH 0/1] Fix r8169 network device unable to detect link

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[SRU] [B/D] [PATCH 0/1] Fix r8169 network device unable to detect link

Kai-Heng Feng
BugLink: https://bugs.launchpad.net/bugs/1838477

[Impact]
r8169 network device unable to detect link after boot.

[Fix]
Don't use MSI for older r8169 chips.

[Test]
User confirmed the issue is fixed with the patch applied.

[Regression Potential]
Low. This reverts affected r8169 device to use INTx, which is more
reliable on older hardware.

Heiner Kallweit (1):
  r8169: don't use MSI before RTL8168d

 drivers/net/ethernet/realtek/r8169.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

--
2.17.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[B] [PATCH 1/1] r8169: don't use MSI before RTL8168d

Kai-Heng Feng
From: Heiner Kallweit <[hidden email]>

BugLink: https://bugs.launchpad.net/bugs/1838477

It was reported that after resuming from suspend network fails with
error "do_IRQ: 3.38 No irq handler for vector", see [0]. Enabling WoL
can work around the issue, but the only actual fix is to disable MSI.
So let's mimic the behavior of the vendor driver and disable MSI on
all chip versions before RTL8168d.

[0] https://bugzilla.kernel.org/show_bug.cgi?id=204079

Fixes: 6c6aa15fdea5 ("r8169: improve interrupt handling")
Reported-by: Dušan Dragić <[hidden email]>
Tested-by: Dušan Dragić <[hidden email]>
Signed-off-by: Heiner Kallweit <[hidden email]>
Signed-off-by: David S. Miller <[hidden email]>
(backported from commit 003bd5b4a7b4a94b501e3a1e2e7c9df6b2a94ed4)
Signed-off-by: Kai-Heng Feng <[hidden email]>
---
 drivers/net/ethernet/realtek/r8169.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index f0f768a0fd8d..f3a143a0eec1 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -8304,13 +8304,18 @@ static int rtl_alloc_irq(struct rtl8169_private *tp)
  void __iomem *ioaddr = tp->mmio_addr;
  unsigned int flags;
 
- if (tp->mac_version <= RTL_GIGA_MAC_VER_06) {
+ switch (tp->mac_version) {
+ case RTL_GIGA_MAC_VER_02 ... RTL_GIGA_MAC_VER_06:
  RTL_W8(Cfg9346, Cfg9346_Unlock);
  RTL_W8(Config2, RTL_R8(Config2) & ~MSIEnable);
  RTL_W8(Cfg9346, Cfg9346_Lock);
+ /* fall through */
+ case RTL_GIGA_MAC_VER_07 ... RTL_GIGA_MAC_VER_24:
  flags = PCI_IRQ_LEGACY;
- } else {
+ break;
+ default:
  flags = PCI_IRQ_ALL_TYPES;
+ break;
  }
 
  return pci_alloc_irq_vectors(tp->pci_dev, 1, 1, flags);
--
2.17.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[D] [PATCH] r8169: don't use MSI before RTL8168d

Kai-Heng Feng
In reply to this post by Kai-Heng Feng
From: Heiner Kallweit <[hidden email]>

BugLink: https://bugs.launchpad.net/bugs/1838477

It was reported that after resuming from suspend network fails with
error "do_IRQ: 3.38 No irq handler for vector", see [0]. Enabling WoL
can work around the issue, but the only actual fix is to disable MSI.
So let's mimic the behavior of the vendor driver and disable MSI on
all chip versions before RTL8168d.

[0] https://bugzilla.kernel.org/show_bug.cgi?id=204079

Fixes: 6c6aa15fdea5 ("r8169: improve interrupt handling")
Reported-by: Dušan Dragić <[hidden email]>
Tested-by: Dušan Dragić <[hidden email]>
Signed-off-by: Heiner Kallweit <[hidden email]>
Signed-off-by: David S. Miller <[hidden email]>
(backported from commit 003bd5b4a7b4a94b501e3a1e2e7c9df6b2a94ed4)
Signed-off-by: Kai-Heng Feng <[hidden email]>
---
 drivers/net/ethernet/realtek/r8169.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index cb65f6a48eba..02fd83ea8e54 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -7005,13 +7005,18 @@ static int rtl_alloc_irq(struct rtl8169_private *tp)
 {
  unsigned int flags;
 
- if (tp->mac_version <= RTL_GIGA_MAC_VER_06) {
+ switch (tp->mac_version) {
+ case RTL_GIGA_MAC_VER_02 ... RTL_GIGA_MAC_VER_06:
  RTL_W8(tp, Cfg9346, Cfg9346_Unlock);
  RTL_W8(tp, Config2, RTL_R8(tp, Config2) & ~MSIEnable);
  RTL_W8(tp, Cfg9346, Cfg9346_Lock);
+ /* fall through */
+ case RTL_GIGA_MAC_VER_07 ... RTL_GIGA_MAC_VER_24:
  flags = PCI_IRQ_LEGACY;
- } else {
+ break;
+ default:
  flags = PCI_IRQ_ALL_TYPES;
+ break;
  }
 
  return pci_alloc_irq_vectors(tp->pci_dev, 1, 1, flags);
--
2.17.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK: [SRU] [B/D] [PATCH 0/1] Fix r8169 network device unable to detect link

Kleber Souza
In reply to this post by Kai-Heng Feng
On 8/27/19 6:29 PM, Kai-Heng Feng wrote:

> BugLink: https://bugs.launchpad.net/bugs/1838477
>
> [Impact]
> r8169 network device unable to detect link after boot.
>
> [Fix]
> Don't use MSI for older r8169 chips.
>
> [Test]
> User confirmed the issue is fixed with the patch applied.
>
> [Regression Potential]
> Low. This reverts affected r8169 device to use INTx, which is more
> reliable on older hardware.
>
> Heiner Kallweit (1):
>   r8169: don't use MSI before RTL8168d
>
>  drivers/net/ethernet/realtek/r8169.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
>

Acked-by: Kleber Sacilotto de Souza <[hidden email]>

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK: [SRU] [B/D] [PATCH 0/1] Fix r8169 network device unable to detect link

Khaled Elmously
In reply to this post by Kai-Heng Feng
On 2019-08-28 00:29:36 , Kai-Heng Feng wrote:

> BugLink: https://bugs.launchpad.net/bugs/1838477
>
> [Impact]
> r8169 network device unable to detect link after boot.
>
> [Fix]
> Don't use MSI for older r8169 chips.
>
> [Test]
> User confirmed the issue is fixed with the patch applied.
>
> [Regression Potential]
> Low. This reverts affected r8169 device to use INTx, which is more
> reliable on older hardware.
>
> Heiner Kallweit (1):
>   r8169: don't use MSI before RTL8168d
>
>  drivers/net/ethernet/realtek/r8169.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
>
> --
> 2.17.1
>
>
> --
> kernel-team mailing list
> [hidden email]
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

APPLIED/cmt: [SRU] [B/D] [PATCH 0/1] Fix r8169 network device unable to detect link

Khaled Elmously
In reply to this post by Kai-Heng Feng
Both B and D already had this commit via stable updates!


On 2019-08-28 00:29:36 , Kai-Heng Feng wrote:

> BugLink: https://bugs.launchpad.net/bugs/1838477
>
> [Impact]
> r8169 network device unable to detect link after boot.
>
> [Fix]
> Don't use MSI for older r8169 chips.
>
> [Test]
> User confirmed the issue is fixed with the patch applied.
>
> [Regression Potential]
> Low. This reverts affected r8169 device to use INTx, which is more
> reliable on older hardware.
>
> Heiner Kallweit (1):
>   r8169: don't use MSI before RTL8168d
>
>  drivers/net/ethernet/realtek/r8169.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
>
> --
> 2.17.1
>
>
> --
> kernel-team mailing list
> [hidden email]
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team