diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2014-07-08 15:40:02 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-07-09 07:02:58 +0400 |
commit | 8bbbd3c19c469a1c6b8e97e9f5a083d029657be5 (patch) | |
tree | 613062ed98f39e8a2d4be8e94f0cc71206f37c04 /drivers | |
parent | da1774e5f1974294dcfc2c08363bb103e769d302 (diff) | |
download | linux-8bbbd3c19c469a1c6b8e97e9f5a083d029657be5.tar.xz |
net: fec: ensure fec_enet_close() copes with resume failure
When the FEC is suspended, the device is detached. Upon resume failure,
the device is left in detached mode, possibly with some of the required
clocks not running. We don't want to be poking the device in that state
because as it may cause bus errors.
If the device is marked detached, avoid calling fec_stop().
This depends upon: "net:fec: improve safety of suspend/resume paths"
Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/freescale/fec_main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 1cd71a8d9996..03785cd14b7c 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -2197,10 +2197,10 @@ fec_enet_close(struct net_device *ndev) phy_stop(fep->phy_dev); - /* Don't know what to do yet. */ napi_disable(&fep->napi); netif_tx_disable(ndev); - fec_stop(ndev); + if (netif_device_present(ndev)) + fec_stop(ndev); phy_disconnect(fep->phy_dev); fep->phy_dev = NULL; |