]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
r8169: fix RTL8168EP take too long to complete driver initialization.
authorChunhao Lin <hau@realtek.com>
Tue, 30 Jan 2018 17:32:36 +0000 (01:32 +0800)
committerSasha Levin <alexander.levin@microsoft.com>
Thu, 1 Mar 2018 03:09:50 +0000 (22:09 -0500)
[ 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 <hau@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
drivers/net/ethernet/realtek/r8169.c

index af4b1f4c24d211ffb0d1dda1dee2e3dda5f0aba5..8004de97689013ea693061c91a1005e2e5196149 100644 (file)
@@ -1375,7 +1375,7 @@ DECLARE_RTL_COND(rtl_ocp_tx_cond)
 {
        void __iomem *ioaddr = tp->mmio_addr;
 
-       return RTL_R8(IBISR0) & 0x02;
+       return RTL_R8(IBISR0) & 0x20;
 }
 
 static void rtl8168ep_stop_cmac(struct rtl8169_private *tp)
@@ -1383,7 +1383,7 @@ static void rtl8168ep_stop_cmac(struct rtl8169_private *tp)
        void __iomem *ioaddr = tp->mmio_addr;
 
        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);
 }