]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.9.101/r8169-fix-powering-up-rtl8168h.patch
Linux 4.14.117
[thirdparty/kernel/stable-queue.git] / releases / 4.9.101 / r8169-fix-powering-up-rtl8168h.patch
CommitLineData
c0d358e7
GKH
1From foo@baz Wed May 16 12:08:47 CEST 2018
2From: Heiner Kallweit <hkallweit1@gmail.com>
3Date: Mon, 7 May 2018 21:11:21 +0200
4Subject: r8169: fix powering up RTL8168h
5
6From: Heiner Kallweit <hkallweit1@gmail.com>
7
8[ Upstream commit 3148dedfe79e422f448a10250d3e2cdf8b7ee617 ]
9
10Since commit a92a08499b1f "r8169: improve runtime pm in general and
11suspend unused ports" interfaces w/o link are runtime-suspended after
1210s. On systems where drivers take longer to load this can lead to the
13situation that the interface is runtime-suspended already when it's
14initially brought up.
15This shouldn't be a problem because rtl_open() resumes MAC/PHY.
16However with at least one chip version the interface doesn't properly
17come up, as reported here:
18https://bugzilla.kernel.org/show_bug.cgi?id=199549
19
20The vendor driver uses a delay to give certain chip versions some
21time to resume before starting the PHY configuration. So let's do
22the same. I don't know which chip versions may be affected,
23therefore apply this delay always.
24
25This patch was reported to fix the issue for RTL8168h.
26I was able to reproduce the issue on an Asus H310I-Plus which also
27uses a RTL8168h. Also in my case the patch fixed the issue.
28
29Reported-by: Slava Kardakov <ojab@ojab.ru>
30Tested-by: Slava Kardakov <ojab@ojab.ru>
31Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
32Signed-off-by: David S. Miller <davem@davemloft.net>
33Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
34---
35 drivers/net/ethernet/realtek/r8169.c | 3 +++
36 1 file changed, 3 insertions(+)
37
38--- a/drivers/net/ethernet/realtek/r8169.c
39+++ b/drivers/net/ethernet/realtek/r8169.c
40@@ -4861,6 +4861,9 @@ static void rtl_pll_power_down(struct rt
41 static void rtl_pll_power_up(struct rtl8169_private *tp)
42 {
43 rtl_generic_op(tp, tp->pll_power_ops.up);
44+
45+ /* give MAC/PHY some time to resume */
46+ msleep(20);
47 }
48
49 static void rtl_init_pll_power_ops(struct rtl8169_private *tp)