Return-Path: Received: from mail-co1nam03on0127.outbound.protection.outlook.com ([104.47.40.127]:41117 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1032394AbeCAPeB (ORCPT ); Thu, 1 Mar 2018 10:34:01 -0500 From: Sasha Levin To: "stable@vger.kernel.org" , "stable-commits@vger.kernel.org" CC: "hau@realtek.com" , "David S . Miller" , Sasha Levin Subject: [added to the 4.1 stable tree] r8169: fix RTL8168EP take too long to complete driver initialization. Date: Thu, 1 Mar 2018 15:25:53 +0000 Message-ID: <20180301152116.1486-311-alexander.levin@microsoft.com> References: <20180301152116.1486-1-alexander.levin@microsoft.com> In-Reply-To: <20180301152116.1486-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Chunhao Lin This patch has been added to the 4.1 stable tree. If you have any objections, please let us know. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [ Upstream commit 086ca23d03c0d2f4088f472386778d293e15c5f6 ] Driver check the wrong register bit in rtl_ocp_tx_cond() that keep driver waiting until timeout. Fix this by waiting for the right register bit. Signed-off-by: Chunhao Lin Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/realtek/r8169.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/re= altek/r8169.c index af4b1f4c24d2..8004de976890 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c @@ -1375,7 +1375,7 @@ DECLARE_RTL_COND(rtl_ocp_tx_cond) { void __iomem *ioaddr =3D tp->mmio_addr; =20 - return RTL_R8(IBISR0) & 0x02; + return RTL_R8(IBISR0) & 0x20; } =20 static void rtl8168ep_stop_cmac(struct rtl8169_private *tp) @@ -1383,7 +1383,7 @@ static void rtl8168ep_stop_cmac(struct rtl8169_privat= e *tp) void __iomem *ioaddr =3D tp->mmio_addr; =20 RTL_W8(IBCR2, RTL_R8(IBCR2) & ~0x01); - rtl_msleep_loop_wait_low(tp, &rtl_ocp_tx_cond, 50, 2000); + rtl_msleep_loop_wait_high(tp, &rtl_ocp_tx_cond, 50, 2000); RTL_W8(IBISR0, RTL_R8(IBISR0) | 0x20); RTL_W8(IBCR0, RTL_R8(IBCR0) & ~0x01); } --=20 2.14.1