Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bbc17546 authored by Francesco Virlinzi's avatar Francesco Virlinzi Committed by David S. Miller
Browse files

stmmac: use mdelay on timeout of sw reset



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

Signed-off-by: default avatarFrancesco Virlinzi <francesco.virlinzi@st.com>
Reviewed-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d9fa7c86
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;
+2 −1
Original line number Diff line number Diff line
@@ -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;