From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Clayton Subject: Fwd: R8169: Network lockups in 4.18.{8,9,10} (and 4.19 dev) Date: Fri, 28 Sep 2018 13:54:03 +0100 Message-ID: <2aabf425-1ae8-71ca-57b3-c58415471ebf@googlemail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit To: netdev@vger.kernel.org Return-path: Received: from mail-wm1-f67.google.com ([209.85.128.67]:35747 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726867AbeI1TRw (ORCPT ); Fri, 28 Sep 2018 15:17:52 -0400 Received: by mail-wm1-f67.google.com with SMTP id o18-v6so2118293wmc.0 for ; Fri, 28 Sep 2018 05:54:13 -0700 (PDT) Received: from [192.168.0.20] ([94.1.124.175]) by smtp.googlemail.com with ESMTPSA id v16-v6sm7671108wrw.12.2018.09.28.05.54.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Sep 2018 05:54:10 -0700 (PDT) In-Reply-To: Content-Language: en-GB Sender: netdev-owner@vger.kernel.org List-ID: Forwarding to corrected netdev address. -------- Forwarded Message -------- Subject: R8169: Network lockups in 4.18.{8,9,10} (and 4.19 dev) Date: Fri, 28 Sep 2018 13:14:35 +0100 From: Chris Clayton To: linux-netdev@vger.kernel.org CC: David Miller , a3at.mail@gmail.com, Greg Kroah-Hartman , hkallweit1@gmail.com, nic_swsd@realtek.com Hi, I upgraded my kernel to 4.18.10 recently and have since been experiencing network problems after resuming from a suspend to RAM or disk. I previously had 4.18.6 and that was OK. The pattern of the problem is that when I first boot, the network is fine. But, after resume from suspend I find that the time taken for a ping of one of my ISP's nameservers increases from 14-15ms to more than 1000ms. Moreover, when I open a browser (chromium or firefox), it fails to retrieve my home page (https://www.google.co.uk) and pings of the nameserver fail with the message "Destination Host Unreachable". Often, I can revive the network by stopping it with /sbin/if(down,up} but sometimes it is necessary to also remove the r8169 module and load it again. My investigation show that 4.18.7 is also OK, but 4.18.8 has the problem. So I cloned the stable tree and bisected between 4.18.7 and 4.18.8. The outcome was: $ git bisect bad e366979eb8f0c3ad6446abbd81bcb3d4ac569cb3 is the first bad commit commit e366979eb8f0c3ad6446abbd81bcb3d4ac569cb3 Author: Azat Khuzhin Date: Sun Aug 26 17:03:09 2018 +0300 r8169: set RxConfig after tx/rx is enabled for RTL8169sb/8110sb devices [ Upstream commit 05212ba8132b42047ab5d63d759c6f9c28e7eab5 ] I have two Ethernet adapters: r8169 0000:03:01.0 eth0: RTL8169sb/8110sb, 00:14:d1:14:2d:49, XID 10000000, IRQ 18 r8169 0000:01:00.0 eth0: RTL8168e/8111e, 64:66:b3:11:14:5d, XID 2c200000, IRQ 30 And after upgrading from linux 4.15 [1] to linux 4.18+ [2] RTL8169sb failed to receive any packets. tcpdump shows a lot of checksum mismatch. [1]: a0f79386a4968b4925da6db2d1daffd0605a4402 [2]: 0519359784328bfa92bf0931bf0cff3b58c16932 (4.19 merge window opened) I started bisecting and the found that [3] breaks it. According to [4]: "For 8110S, 8110SB, and 8110SC series, the initial value of RxConfig needs to be set after the tx/rx is enabled." So I moved rtl_init_rxcfg() after enabling tx/rs and now my adapter works (RTL8168e works too). [3]: 3559d81e76bfe3803e89f2e04cf6ef7ab4f3aace [4]: e542a2269f232d61270ceddd42b73a4348dee2bb ("r8169: adjust the RxConfig settings.") Also drop "rx" from rtl_set_rx_tx_config_registers(), since it does nothing with it already. Fixes: 3559d81e76bfe3803e89f2e04cf6ef7ab4f3aace ("r8169: simplify rtl_hw_start_8169") Cc: Heiner Kallweit Cc: David S. Miller Cc: netdev@vger.kernel.org Cc: Realtek linux nic maintainers Signed-off-by: Azat Khuzhin Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman :040000 040000 d95481376500f1bc5569fc486bc7573ea201b617 7985ef7b56e340312fe647c7c6e2a24998981304 M drivers Ignoring the renaming of a function, the patch added a call to rtl_init_rxcfg() to rtl_hw_start(). If I remove that call from 4.18.10, my network no longer fails after a resume from suspend. I should add that I get the same problem with the current 4.19 development kernel, but I haven't tried removing the call to rtl_init_rxcfg() from the driver. I'll do that later today and report back. Details of my ethernet device from lspci are: 05:00.2 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0a) Subsystem: CLEVO/KAPOK Computer RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- SERR-