[PATCH 0/2][SRU][B][C] Ethernet[10ec:8136] doesn't work after S3 with kernel 4.15.0.43.64

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

[PATCH 0/2][SRU][B][C] Ethernet[10ec:8136] doesn't work after S3 with kernel 4.15.0.43.64

AceLan Kao
BugLink: https://bugs.launchpad.net/bugs/1809847

[Impact]
The Realtek Ethernet[10ec:8136] works after S3 with kernel 4.15.0-33.36,
and fails with kernel 4.15.0.43.64. There is no interrupt while
plug/unplug Ethernet cable after S3, so it looks like an regression after
4.15.0-33.36.

[Fix]
Check changelog and found there are 2 commits introduced from
4.15.0-35.38 might be suspicious
  * r8169 no internet after suspending (LP: #1779817)
    - r8169: don't use MSI-X on RTL8168g
    - r8169: don't use MSI-X on RTL8106e
And check the upstream log and found the 2 MSI-X commits had been all
reverted, since below commit claims it fixes the MSI-X interrupt issue
which is already in Bionic kernel.
   083874549fdf PCI: Reprogram bridge prefetch registers on resume
So, I reverted the 2 MSI-X commits and found the Ethernet works again
after S3.

[Regression Potential]
Low, the 2 disable MSI-X commits are workarounds, and now we have a proper
way to fix the issue, so it should be fine to revert them.

AceLan Kao (1):
  UBUNTU: SAUCE: Revert "r8169: don't use MSI-X on RTL8106e"

Heiner Kallweit (1):
  r8169: re-enable MSI-X on RTL8168g

 drivers/net/ethernet/realtek/r8169.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 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
|

[PATCH 1/2][SRU][B] UBUNTU: SAUCE: Revert "r8169: don't use MSI-X on RTL8106e"

AceLan Kao
BugLink: https://bugs.launchpad.net/bugs/1809847

This reverts commit 9d4efdc5adc3e20762af5de5a5b1c11a762e84d7.

We backported this commit, and can't clean cherry-pick the reverted
commit from upstream, so revert it directly. This equivalent to upstream
commit.
   d49c88d7677b r8169: Enable MSI-X on RTL8106e

Signed-off-by: AceLan Kao <[hidden email]>
---
 drivers/net/ethernet/realtek/r8169.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 64826f4f23bc..9c6e65896108 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -8300,20 +8300,17 @@ static int rtl_alloc_irq(struct rtl8169_private *tp)
  void __iomem *ioaddr = tp->mmio_addr;
  unsigned int flags;
 
- switch (tp->mac_version) {
- case RTL_GIGA_MAC_VER_01 ... RTL_GIGA_MAC_VER_06:
+ if (tp->mac_version <= RTL_GIGA_MAC_VER_06) {
  RTL_W8(Cfg9346, Cfg9346_Unlock);
  RTL_W8(Config2, RTL_R8(Config2) & ~MSIEnable);
  RTL_W8(Cfg9346, Cfg9346_Lock);
  flags = PCI_IRQ_LEGACY;
- break;
- case RTL_GIGA_MAC_VER_39 ... RTL_GIGA_MAC_VER_40:
+ } else if (tp->mac_version == RTL_GIGA_MAC_VER_40) {
  /* This version was reported to have issues with resume
  * from suspend when using MSI-X
  */
  flags = PCI_IRQ_LEGACY | PCI_IRQ_MSI;
- break;
- default:
+ } else {
  flags = PCI_IRQ_ALL_TYPES;
  }
 
--
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
|

[PATCH 2/2][SRU][B] r8169: re-enable MSI-X on RTL8168g

AceLan Kao
In reply to this post by AceLan Kao
From: Heiner Kallweit <[hidden email]>

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

Similar to d49c88d7677b ("r8169: Enable MSI-X on RTL8106e") after
e9d0ba506ea8 ("PCI: Reprogram bridge prefetch registers on resume")
we can safely assume that this also fixes the root cause of
the issue worked around by 7c53a722459c ("r8169: don't use MSI-X on
RTL8168g"). So let's revert it.

Fixes: 7c53a722459c ("r8169: don't use MSI-X on RTL8168g")
Signed-off-by: Heiner Kallweit <[hidden email]>
Signed-off-by: David S. Miller <[hidden email]>
(cherry picked from commit 9675931e6b65d160d16bcc9472c1acef15524def)
Signed-off-by: AceLan Kao <[hidden email]>
---
 drivers/net/ethernet/realtek/r8169.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 9c6e65896108..0c86641dd912 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -8305,11 +8305,6 @@ static int rtl_alloc_irq(struct rtl8169_private *tp)
  RTL_W8(Config2, RTL_R8(Config2) & ~MSIEnable);
  RTL_W8(Cfg9346, Cfg9346_Lock);
  flags = PCI_IRQ_LEGACY;
- } else if (tp->mac_version == RTL_GIGA_MAC_VER_40) {
- /* This version was reported to have issues with resume
- * from suspend when using MSI-X
- */
- flags = PCI_IRQ_LEGACY | PCI_IRQ_MSI;
  } else {
  flags = PCI_IRQ_ALL_TYPES;
  }
--
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
|

[PATCH 1/2][SRU][C] r8169: Enable MSI-X on RTL8106e

AceLan Kao
In reply to this post by AceLan Kao
From: Jian-Hong Pan <[hidden email]>

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

Originally, we have an issue where r8169 MSI-X interrupt is broken after
S3 suspend/resume on RTL8106e of ASUS X441UAR.

02:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd.
RTL8101/2/6E PCI Express Fast/Gigabit Ethernet controller [10ec:8136]
(rev 07)
        Subsystem: ASUSTeK Computer Inc. RTL810xE PCI Express Fast
Ethernet controller [1043:200f]
        Flags: bus master, fast devsel, latency 0, IRQ 16
        I/O ports at e000 [size=256]
        Memory at ef100000 (64-bit, non-prefetchable) [size=4K]
        Memory at e0000000 (64-bit, prefetchable) [size=16K]
        Capabilities: [40] Power Management version 3
        Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
        Capabilities: [70] Express Endpoint, MSI 01
        Capabilities: [b0] MSI-X: Enable+ Count=4 Masked-
        Capabilities: [d0] Vital Product Data
        Capabilities: [100] Advanced Error Reporting
        Capabilities: [140] Virtual Channel
        Capabilities: [160] Device Serial Number 01-00-00-00-36-4c-e0-00
        Capabilities: [170] Latency Tolerance Reporting
        Kernel driver in use: r8169
        Kernel modules: r8169

We found the all of the values in PCI BAR=4 of the ethernet adapter
become 0xFF after system resumes.  That breaks the MSI-X interrupt.
Therefore, we can only fall back to MSI interrupt to fix the issue at
that time.

However, there is a commit which resolves the drivers getting nothing in
PCI BAR=4 after system resumes.  It is 04cb3ae895d7 "PCI: Reprogram
bridge prefetch registers on resume" by Daniel Drake.

After apply the patch, the ethernet adapter works fine before suspend
and after resume.  So, we can revert the workaround after the commit
"PCI: Reprogram bridge prefetch registers on resume" is merged into main
tree.

This patch reverts commit 7bb05b85bc2d1a1b647b91424b2ed4a18e6ecd81
"r8169: don't use MSI-X on RTL8106e".

Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=201181
Fixes: 7bb05b85bc2d ("r8169: don't use MSI-X on RTL8106e")
Signed-off-by: Jian-Hong Pan <[hidden email]>
Signed-off-by: David S. Miller <[hidden email]>
(cherry picked from commit d49c88d7677ba737e9d2759a87db0402d5ab2607)
Signed-off-by: AceLan Kao <[hidden email]>
---
 drivers/net/ethernet/realtek/r8169.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index f18087102d40..7e816fe9bc41 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -7539,20 +7539,17 @@ static int rtl_alloc_irq(struct rtl8169_private *tp)
 {
  unsigned int flags;
 
- switch (tp->mac_version) {
- case RTL_GIGA_MAC_VER_01 ... RTL_GIGA_MAC_VER_06:
+ if (tp->mac_version <= 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);
  flags = PCI_IRQ_LEGACY;
- break;
- case RTL_GIGA_MAC_VER_39 ... RTL_GIGA_MAC_VER_40:
+ } else if (tp->mac_version == RTL_GIGA_MAC_VER_40) {
  /* This version was reported to have issues with resume
  * from suspend when using MSI-X
  */
  flags = PCI_IRQ_LEGACY | PCI_IRQ_MSI;
- break;
- default:
+ } else {
  flags = PCI_IRQ_ALL_TYPES;
  }
 
--
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
|

[PATCH 2/2][SRU][C] r8169: re-enable MSI-X on RTL8168g

AceLan Kao
In reply to this post by AceLan Kao
From: Heiner Kallweit <[hidden email]>

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

Similar to d49c88d7677b ("r8169: Enable MSI-X on RTL8106e") after
e9d0ba506ea8 ("PCI: Reprogram bridge prefetch registers on resume")
we can safely assume that this also fixes the root cause of
the issue worked around by 7c53a722459c ("r8169: don't use MSI-X on
RTL8168g"). So let's revert it.

Fixes: 7c53a722459c ("r8169: don't use MSI-X on RTL8168g")
Signed-off-by: Heiner Kallweit <[hidden email]>
Signed-off-by: David S. Miller <[hidden email]>
(cherry picked from commit 9675931e6b65d160d16bcc9472c1acef15524def)
Signed-off-by: AceLan Kao <[hidden email]>
---
 drivers/net/ethernet/realtek/r8169.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 7e816fe9bc41..41bcbdd355f0 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -7544,11 +7544,6 @@ static int rtl_alloc_irq(struct rtl8169_private *tp)
  RTL_W8(tp, Config2, RTL_R8(tp, Config2) & ~MSIEnable);
  RTL_W8(tp, Cfg9346, Cfg9346_Lock);
  flags = PCI_IRQ_LEGACY;
- } else if (tp->mac_version == RTL_GIGA_MAC_VER_40) {
- /* This version was reported to have issues with resume
- * from suspend when using MSI-X
- */
- flags = PCI_IRQ_LEGACY | PCI_IRQ_MSI;
  } else {
  flags = PCI_IRQ_ALL_TYPES;
  }
--
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: [PATCH 0/2][SRU][B][C] Ethernet[10ec:8136] doesn't work after S3 with kernel 4.15.0.43.64

Kleber Souza
In reply to this post by AceLan Kao
On 12/27/18 4:17 AM, AceLan Kao wrote:

> BugLink: https://bugs.launchpad.net/bugs/1809847
>
> [Impact]
> The Realtek Ethernet[10ec:8136] works after S3 with kernel 4.15.0-33.36,
> and fails with kernel 4.15.0.43.64. There is no interrupt while
> plug/unplug Ethernet cable after S3, so it looks like an regression after
> 4.15.0-33.36.
>
> [Fix]
> Check changelog and found there are 2 commits introduced from
> 4.15.0-35.38 might be suspicious
>   * r8169 no internet after suspending (LP: #1779817)
>     - r8169: don't use MSI-X on RTL8168g
>     - r8169: don't use MSI-X on RTL8106e
> And check the upstream log and found the 2 MSI-X commits had been all
> reverted, since below commit claims it fixes the MSI-X interrupt issue
> which is already in Bionic kernel.
>    083874549fdf PCI: Reprogram bridge prefetch registers on resume
> So, I reverted the 2 MSI-X commits and found the Ethernet works again
> after S3.
>
> [Regression Potential]
> Low, the 2 disable MSI-X commits are workarounds, and now we have a proper
> way to fix the issue, so it should be fine to revert them.
>
> AceLan Kao (1):
>   UBUNTU: SAUCE: Revert "r8169: don't use MSI-X on RTL8106e"
>
> Heiner Kallweit (1):
>   r8169: re-enable MSI-X on RTL8168g
>
>  drivers/net/ethernet/realtek/r8169.c | 12 ++----------
>  1 file changed, 2 insertions(+), 10 deletions(-)
>
The reverts look reasonable.

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: [PATCH 0/2][SRU][B][C] Ethernet[10ec:8136] doesn't work after S3 with kernel 4.15.0.43.64

Stefan Bader-2
In reply to this post by AceLan Kao
On 27.12.18 04:17, AceLan Kao wrote:

> BugLink: https://bugs.launchpad.net/bugs/1809847
>
> [Impact]
> The Realtek Ethernet[10ec:8136] works after S3 with kernel 4.15.0-33.36,
> and fails with kernel 4.15.0.43.64. There is no interrupt while
> plug/unplug Ethernet cable after S3, so it looks like an regression after
> 4.15.0-33.36.
>
> [Fix]
> Check changelog and found there are 2 commits introduced from
> 4.15.0-35.38 might be suspicious
>   * r8169 no internet after suspending (LP: #1779817)
>     - r8169: don't use MSI-X on RTL8168g
>     - r8169: don't use MSI-X on RTL8106e
> And check the upstream log and found the 2 MSI-X commits had been all
> reverted, since below commit claims it fixes the MSI-X interrupt issue
> which is already in Bionic kernel.
>    083874549fdf PCI: Reprogram bridge prefetch registers on resume
> So, I reverted the 2 MSI-X commits and found the Ethernet works again
> after S3.
>
> [Regression Potential]
> Low, the 2 disable MSI-X commits are workarounds, and now we have a proper
> way to fix the issue, so it should be fine to revert them.
>
> AceLan Kao (1):
>   UBUNTU: SAUCE: Revert "r8169: don't use MSI-X on RTL8106e"
>
> Heiner Kallweit (1):
>   r8169: re-enable MSI-X on RTL8168g
>
>  drivers/net/ethernet/realtek/r8169.c | 12 ++----------
>  1 file changed, 2 insertions(+), 10 deletions(-)
>
Acked-by: Stefan Bader <[hidden email]>


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

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

APPLIED: [PATCH 0/2][SRU][B][C] Ethernet[10ec:8136] doesn't work after S3 with kernel 4.15.0.43.64

Khaled Elmously
In reply to this post by AceLan Kao
On 2018-12-27 11:17:00 , AceLan Kao wrote:

> BugLink: https://bugs.launchpad.net/bugs/1809847
>
> [Impact]
> The Realtek Ethernet[10ec:8136] works after S3 with kernel 4.15.0-33.36,
> and fails with kernel 4.15.0.43.64. There is no interrupt while
> plug/unplug Ethernet cable after S3, so it looks like an regression after
> 4.15.0-33.36.
>
> [Fix]
> Check changelog and found there are 2 commits introduced from
> 4.15.0-35.38 might be suspicious
>   * r8169 no internet after suspending (LP: #1779817)
>     - r8169: don't use MSI-X on RTL8168g
>     - r8169: don't use MSI-X on RTL8106e
> And check the upstream log and found the 2 MSI-X commits had been all
> reverted, since below commit claims it fixes the MSI-X interrupt issue
> which is already in Bionic kernel.
>    083874549fdf PCI: Reprogram bridge prefetch registers on resume
> So, I reverted the 2 MSI-X commits and found the Ethernet works again
> after S3.
>
> [Regression Potential]
> Low, the 2 disable MSI-X commits are workarounds, and now we have a proper
> way to fix the issue, so it should be fine to revert them.
>
> AceLan Kao (1):
>   UBUNTU: SAUCE: Revert "r8169: don't use MSI-X on RTL8106e"
>
> Heiner Kallweit (1):
>   r8169: re-enable MSI-X on RTL8168g
>
>  drivers/net/ethernet/realtek/r8169.c | 12 ++----------
>  1 file changed, 2 insertions(+), 10 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