UPSTREAM: 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)
committerHuang, Tao <huangtao@rock-chips.com>
Mon, 4 Jul 2016 10:01:40 +0000 (18:01 +0800)
commit6d7cc1fdfafd9aff00f5a71dfab650a3a9dd7306
tree4cd76cf9c92e946954566ef4a0afa6db07604cc8
parent54543b877da4e41843fce80fe11fc366699d86eb
UPSTREAM: 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.

Change-Id: I0e8a0f7e798f89678d59eefdfd251f217c00787e
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit f55d84b07c4e7340473a25dc82b462607578402c)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c