linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] r8169: Enable MSI-X on RTL8106e
@ 2018-09-27  4:09 Jian-Hong Pan
  2018-10-02  5:51 ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Jian-Hong Pan @ 2018-09-27  4:09 UTC (permalink / raw)
  To: David S . Miller, Heiner Kallweit
  Cc: Realtek linux nic maintainers, netdev, linux-kernel,
	kai.heng.feng, linux, Jian-Hong Pan

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 <jian-hong@endlessm.com>
---
 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 bb529ff2ca81..445508c7e067 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -7084,20 +7084,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.11.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net] r8169: Enable MSI-X on RTL8106e
  2018-09-27  4:09 [PATCH net] r8169: Enable MSI-X on RTL8106e Jian-Hong Pan
@ 2018-10-02  5:51 ` David Miller
  2018-10-02  5:57   ` Jian-Hong Pan
  0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2018-10-02  5:51 UTC (permalink / raw)
  To: jian-hong
  Cc: hkallweit1, nic_swsd, netdev, linux-kernel, kai.heng.feng, linux

From: Jian-Hong Pan <jian-hong@endlessm.com>
Date: Thu, 27 Sep 2018 12:09:48 +0800

> 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.

I don't see this upstream yet.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net] r8169: Enable MSI-X on RTL8106e
  2018-10-02  5:51 ` David Miller
@ 2018-10-02  5:57   ` Jian-Hong Pan
  2018-10-15  8:51     ` Jian-Hong Pan
  0 siblings, 1 reply; 5+ messages in thread
From: Jian-Hong Pan @ 2018-10-02  5:57 UTC (permalink / raw)
  To: David S. Miller
  Cc: Heiner Kallweit, Realtek linux nic maintainers,
	Linux Netdev List, Linux Kernel, Kai-Heng Feng,
	Linux Upstreaming Team

David Miller <davem@davemloft.net> 於 2018年10月2日 週二 下午1:51寫道:
>
> From: Jian-Hong Pan <jian-hong@endlessm.com>
> Date: Thu, 27 Sep 2018 12:09:48 +0800
>
> > 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.
>
> I don't see this upstream yet.

It is in linux-next repository:
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=04cb3ae895d7efdc60f0fe17182b200a3da20f09

Regrads,
Jian-Hong Pan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net] r8169: Enable MSI-X on RTL8106e
  2018-10-02  5:57   ` Jian-Hong Pan
@ 2018-10-15  8:51     ` Jian-Hong Pan
  2018-10-16  4:32       ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Jian-Hong Pan @ 2018-10-15  8:51 UTC (permalink / raw)
  To: David S. Miller
  Cc: Heiner Kallweit, Realtek linux nic maintainers,
	Linux Netdev List, Linux Kernel, Kai-Heng Feng,
	Linux Upstreaming Team

2018-10-02 13:57 GMT+08:00 Jian-Hong Pan <jian-hong@endlessm.com>:
> David Miller <davem@davemloft.net> 於 2018年10月2日 週二 下午1:51寫道:
>>
>> From: Jian-Hong Pan <jian-hong@endlessm.com>
>> Date: Thu, 27 Sep 2018 12:09:48 +0800
>>
>> > 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.
>>
>> I don't see this upstream yet.
>
> It is in linux-next repository:
> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=04cb3ae895d7efdc60f0fe17182b200a3da20f09

The commit is also back ported into Linux kernel 4.19-rc7 now.
https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git/commit/?id=083874549fdfefa629dfa752785e20427dde1511

Regrads,
Jian-Hong Pan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net] r8169: Enable MSI-X on RTL8106e
  2018-10-15  8:51     ` Jian-Hong Pan
@ 2018-10-16  4:32       ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2018-10-16  4:32 UTC (permalink / raw)
  To: jian-hong
  Cc: hkallweit1, nic_swsd, netdev, linux-kernel, kai.heng.feng, linux

From: Jian-Hong Pan <jian-hong@endlessm.com>
Date: Mon, 15 Oct 2018 16:51:12 +0800

> 2018-10-02 13:57 GMT+08:00 Jian-Hong Pan <jian-hong@endlessm.com>:
>> David Miller <davem@davemloft.net> 於 2018年10月2日 週二 下午1:51寫道:
>>>
>>> From: Jian-Hong Pan <jian-hong@endlessm.com>
>>> Date: Thu, 27 Sep 2018 12:09:48 +0800
>>>
>>> > 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.
>>>
>>> I don't see this upstream yet.
>>
>> It is in linux-next repository:
>> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=04cb3ae895d7efdc60f0fe17182b200a3da20f09
> 
> The commit is also back ported into Linux kernel 4.19-rc7 now.
> https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git/commit/?id=083874549fdfefa629dfa752785e20427dde1511

Patch applied, thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-10-16  4:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-27  4:09 [PATCH net] r8169: Enable MSI-X on RTL8106e Jian-Hong Pan
2018-10-02  5:51 ` David Miller
2018-10-02  5:57   ` Jian-Hong Pan
2018-10-15  8:51     ` Jian-Hong Pan
2018-10-16  4:32       ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).