96e7072a33964d5386086cae90296aebca84b4cd
[openwrt/openwrt.git] / target / linux / mediatek / patches-4.14 / 0062-mdio-atomic.patch
1 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
2 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
3 @@ -97,7 +97,10 @@ static int mtk_mdio_busy_wait(struct mtk
4 return 0;
5 if (time_after(jiffies, t_start + PHY_IAC_TIMEOUT))
6 break;
7 - usleep_range(10, 20);
8 + if (in_atomic())
9 + udelay(10);
10 + else
11 + usleep_range(10, 20);
12 }
13
14 dev_err(eth->dev, "mdio: MDIO timeout\n");