Re: [PATCH] stmmac: extend DMA initialization delay to 2.5 seconds

From: David Miller
Date: Thu Jun 05 2014 - 18:25:08 EST


From: Alexey Brodkin <Alexey.Brodkin@xxxxxxxxxxxx>
Date: Thu, 5 Jun 2014 16:58:00 +0400

> On some platforms existing 100 msecond delay is not enough for DMA block to
> recover after reset. This is because MAC DMA waits for all PHY input clocks
> to present and depending on the board reset bit deassertion may take much
> longer than previously used 100 milliseconds
>
> I have a board that requires more than 2 seconds for DMA to zero "reset" bit.
> If for other boards it's still not long enough this value should be extended
> once again.
>
> In the same change I convert "mdelay" to "msleep" to make CPU available for
> other processes during DMA init delay which is especially useful in case of
> delay for a few seconds.
>
> Signed-off-by: Alexey Brodkin <abrodkin@xxxxxxxxxxxx>

This will not work, you cannot sleep with spinlocks held, and this code is
absolutely called in such a context.

For example stmmac_resume() --> stmmac_hw_setup() -> stmmac_init_dma_engine().

stmmac_resume() holds priv->lock over all of these operations, and even has
interrupts disabled.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/