diff options
author | Chunhao Lin <hau@realtek.com> | 2018-01-30 12:32:36 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-01-31 10:26:30 -0500 |
commit | 086ca23d03c0d2f4088f472386778d293e15c5f6 (patch) | |
tree | b23a1c50c3e9a176dab970162ed9ae13db69c3c1 | |
parent | c0b91a56a2e57a5a370655b25d677ae0ebf8a2d0 (diff) |
r8169: fix RTL8168EP take too long to complete driver initialization.
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>
-rw-r--r-- | drivers/net/ethernet/realtek/r8169.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index 8e91274174f1..0bf7d1759250 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c | |||
@@ -1395,7 +1395,7 @@ DECLARE_RTL_COND(rtl_ocp_tx_cond) | |||
1395 | { | 1395 | { |
1396 | void __iomem *ioaddr = tp->mmio_addr; | 1396 | void __iomem *ioaddr = tp->mmio_addr; |
1397 | 1397 | ||
1398 | return RTL_R8(IBISR0) & 0x02; | 1398 | return RTL_R8(IBISR0) & 0x20; |
1399 | } | 1399 | } |
1400 | 1400 | ||
1401 | static void rtl8168ep_stop_cmac(struct rtl8169_private *tp) | 1401 | static void rtl8168ep_stop_cmac(struct rtl8169_private *tp) |
@@ -1403,7 +1403,7 @@ static void rtl8168ep_stop_cmac(struct rtl8169_private *tp) | |||
1403 | void __iomem *ioaddr = tp->mmio_addr; | 1403 | void __iomem *ioaddr = tp->mmio_addr; |
1404 | 1404 | ||
1405 | RTL_W8(IBCR2, RTL_R8(IBCR2) & ~0x01); | 1405 | RTL_W8(IBCR2, RTL_R8(IBCR2) & ~0x01); |
1406 | rtl_msleep_loop_wait_low(tp, &rtl_ocp_tx_cond, 50, 2000); | 1406 | rtl_msleep_loop_wait_high(tp, &rtl_ocp_tx_cond, 50, 2000); |
1407 | RTL_W8(IBISR0, RTL_R8(IBISR0) | 0x20); | 1407 | RTL_W8(IBISR0, RTL_R8(IBISR0) | 0x20); |
1408 | RTL_W8(IBCR0, RTL_R8(IBCR0) & ~0x01); | 1408 | RTL_W8(IBCR0, RTL_R8(IBCR0) & ~0x01); |
1409 | } | 1409 | } |