stmmac: do not sleep in atomic context for mdio_reset
authorVincent Palatin <vpalatin@chromium.org>
Wed, 1 Jun 2016 15:53:48 +0000 (08:53 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 2 Jun 2016 19:12:16 +0000 (12:12 -0700)
commitf55d84b07c4e7340473a25dc82b462607578402c
tree76d0c5938a675f534fc04e88b8beb308563927a5
parent14b84e8654c89ed59f433654e6bb64c886d095cd
stmmac: do not sleep in atomic context for mdio_reset

stmmac_mdio_reset() has been updated to use msleep rather udelay
(as some PHY requires a one second delay there).
It called from stmmac_resume() within the spin_lock_irqsave block
atomic context triggering 'scheduling while atomic'.

The stmmac_priv lock usage is not fully documented, but it seems
to protect the access to the MAC registers / DMA structures rather
than the MDIO bus or the PHY (which have separate locking),
so we can push the spin_lock after the stmmac_mdio_reset call.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c