netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] stmmac: use mdelay on timeout of sw reset
@ 2011-11-17  7:57 Giuseppe CAVALLARO
  2011-11-17  7:57 ` [PATCH 2/5] stmmac: fix advertising 1000Base capabilties for non GMII iface Giuseppe CAVALLARO
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Giuseppe CAVALLARO @ 2011-11-17  7:57 UTC (permalink / raw)
  To: netdev; +Cc: francesco.virlinzi, srinivas.kandagatla

From: Francesco Virlinzi <francesco.virlinzi@st.com>

This patch uses an mdelay to manage the timeout on
sw reset to be independant of cpu_clk.

Signed-off-by: Francesco Virlinzi <francesco.virlinzi@st.com>
Reviewed-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
 .../net/ethernet/stmicro/stmmac/dwmac1000_dma.c    |    3 ++-
 drivers/net/ethernet/stmicro/stmmac/dwmac100_dma.c |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c
index da66ac5..4d5402a 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c
@@ -39,10 +39,11 @@ static int dwmac1000_dma_init(void __iomem *ioaddr, int pbl, u32 dma_tx,
 	/* DMA SW reset */
 	value |= DMA_BUS_MODE_SFT_RESET;
 	writel(value, ioaddr + DMA_BUS_MODE);
-	limit = 15000;
+	limit = 10;
 	while (limit--) {
 		if (!(readl(ioaddr + DMA_BUS_MODE) & DMA_BUS_MODE_SFT_RESET))
 			break;
+		mdelay(10);
 	}
 	if (limit < 0)
 		return -EBUSY;
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac100_dma.c b/drivers/net/ethernet/stmicro/stmmac/dwmac100_dma.c
index 627f656..bc17fd0 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac100_dma.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac100_dma.c
@@ -41,10 +41,11 @@ static int dwmac100_dma_init(void __iomem *ioaddr, int pbl, u32 dma_tx,
 	/* DMA SW reset */
 	value |= DMA_BUS_MODE_SFT_RESET;
 	writel(value, ioaddr + DMA_BUS_MODE);
-	limit = 15000;
+	limit = 10;
 	while (limit--) {
 		if (!(readl(ioaddr + DMA_BUS_MODE) & DMA_BUS_MODE_SFT_RESET))
 			break;
+		mdelay(10);
 	}
 	if (limit < 0)
 		return -EBUSY;
-- 
1.7.4.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-11-17  8:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-17  7:57 [PATCH 1/5] stmmac: use mdelay on timeout of sw reset Giuseppe CAVALLARO
2011-11-17  7:57 ` [PATCH 2/5] stmmac: fix advertising 1000Base capabilties for non GMII iface Giuseppe CAVALLARO
2011-11-17  8:14   ` David Miller
2011-11-17  7:58 ` [PATCH 3/5] stmmac: parameters auto-tuning through HW cap reg Giuseppe CAVALLARO
2011-11-17  8:14   ` David Miller
2011-11-17  7:58 ` [PATCH 4/5] stmmac: remove spin_lock in stmmac_ioctl Giuseppe CAVALLARO
2011-11-17  8:14   ` David Miller
2011-11-17  7:58 ` [PATCH 5/5] stmmac: fix pm functions avoiding sleep on spinlock Giuseppe CAVALLARO
2011-11-17  8:14   ` David Miller
2011-11-17  8:13 ` [PATCH 1/5] stmmac: use mdelay on timeout of sw reset David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).