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