Skip to contentSkip to conversation

nds32: ftmac100: Fix write mac addr fail problem.

PATCH New Andes 1 participant 1 message Sep 13, 2017 Network drivers

lore
Share & tools
lore

Andes

author
#0 lore raw

PATCH 3/3 nds32: ftmac100: Fix write mac addr fail problem.

From: rick <[email protected]>

After soft reset complete, write mac address immediately will fail. Add delay to work around this problem.

---
 drivers/net/ftmac100.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/ftmac100.c +6 -1
index 4e45f00..e64bf3d 100644
@@ -40,7 +40,12 @@ static void ftmac100_reset(struct ftmac100_data *priv)
 	writel (FTMAC100_MACCR_SW_RST, &ftmac100->maccr);
 
 	while (readl (&ftmac100->maccr) & FTMAC100_MACCR_SW_RST)
-		;
+		mdelay(1);
+	/*
+	 * When soft reset complete, write mac address immediately maybe fail somehow
+	 *  Wait for a while can avoid this problem
+	 */
+	mdelay(1);
 }
 
 /*
Signature · 1 line
1.7.9.5