linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jian-Hong Pan <jian-hong@endlessm.com>
To: Heiner Kallweit <hkallweit1@gmail.com>,
	David Miller <davem@davemloft.net>,
	nic_swsd@realtek.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux@endlessm.com
Cc: Jian-Hong Pan <jian-hong@endlessm.com>
Subject: [PATCH v2 net] r8169: don't use MSI-X on RTL8106e
Date: Fri, 17 Aug 2018 13:07:35 +0800	[thread overview]
Message-ID: <20180817050735.3367-1-jian-hong@endlessm.com> (raw)
In-Reply-To: <20180815062110.16155-1-jian-hong@endlessm.com>

Found the ethernet network on ASUS X441UAR doesn't come back on resume
from suspend when using MSI-X.  The chip is RTL8106e - version 39.

[   21.848357] libphy: r8169: probed
[   21.848473] r8169 0000:02:00.0 eth0: RTL8106e, 0c:9d:92:32:67:b4, XID
44900000, IRQ 127
[   22.518860] r8169 0000:02:00.0 enp2s0: renamed from eth0
[   29.458041] Generic PHY r8169-200:00: attached PHY driver [Generic
PHY] (mii_bus:phy_addr=r8169-200:00, irq=IGNORE)
[   63.227398] r8169 0000:02:00.0 enp2s0: Link is Up - 100Mbps/Full -
flow control off
[  124.514648] Generic PHY r8169-200:00: attached PHY driver [Generic
PHY] (mii_bus:phy_addr=r8169-200:00, irq=IGNORE)

Here is the ethernet controller in detail:

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: <access denied>
	Kernel driver in use: r8169
	Kernel modules: r8169

Falling back to MSI fixes the issue.

Fixes: 6c6aa15fdea5 ("r8169: improve interrupt handling")
Signed-off-by: Jian-Hong Pan <jian-hong@endlessm.com>
---
Changes in v2:
  - Make the commit message shorter
  - Add "Fixes" tag in the commit message

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

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 0d9c3831838f..0efa977c422d 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -7071,17 +7071,20 @@ 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_01 ... 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;
-	} else if (tp->mac_version == RTL_GIGA_MAC_VER_40) {
+		break;
+	case RTL_GIGA_MAC_VER_39 ... 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 {
+		break;
+	default:
 		flags = PCI_IRQ_ALL_TYPES;
 	}
 
-- 
2.11.0


  parent reply	other threads:[~2018-08-17  5:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-15  6:21 [PATCH] r8169: don't use MSI-X on RTL8106e jian-hong
2018-08-16 19:21 ` David Miller
2018-08-16 19:37   ` Heiner Kallweit
2018-08-16 19:39     ` David Miller
2018-08-16 19:50       ` Heiner Kallweit
2018-08-20 18:44         ` Bjorn Helgaas
2018-08-20 20:46           ` Heiner Kallweit
2018-08-21 19:31             ` David Miller
2018-08-21 20:48               ` Heiner Kallweit
2018-08-22 11:44                 ` Thomas Gleixner
2018-08-22 19:49                   ` Heiner Kallweit
2018-08-23 10:46                     ` Jian-Hong Pan
2018-08-23 13:38                       ` Bjorn Helgaas
2018-08-27 10:46                         ` Jian-Hong Pan
2018-08-21  8:28           ` Marc Zyngier
2018-08-21 20:54             ` Heiner Kallweit
2018-08-20 20:40         ` Florian Fainelli
2018-08-20 20:56           ` Heiner Kallweit
2018-08-17  5:07 ` Jian-Hong Pan [this message]
2018-08-19 18:01   ` [PATCH v2 net] " David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180817050735.3367-1-jian-hong@endlessm.com \
    --to=jian-hong@endlessm.com \
    --cc=davem@davemloft.net \
    --cc=hkallweit1@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@endlessm.com \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).