summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2012-07-27 22:35:47 +0400
committerBen Hutchings <bhutchings@solarflare.com>2012-08-24 23:10:19 +0400
commit6032fb56c546c0a14856dc57a92d84560816b217 (patch)
treeea0c5b0ead5581665cc540e4d620e9487a32ea7e
parent61da026d86517def727eb67d7cb8ee5657a12dd9 (diff)
downloadlinux-6032fb56c546c0a14856dc57a92d84560816b217.tar.xz
sfc: Keep disabled NICs quiescent during suspend/resume
Currently we ignore and clear the disabled state. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
-rw-r--r--drivers/net/ethernet/sfc/efx.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index e5f3a17349af..f02591bb62f4 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -2729,12 +2729,14 @@ static int efx_pm_freeze(struct device *dev)
rtnl_lock();
- efx->state = STATE_UNINIT;
+ if (efx->state != STATE_DISABLED) {
+ efx->state = STATE_UNINIT;
- netif_device_detach(efx->net_dev);
+ netif_device_detach(efx->net_dev);
- efx_stop_all(efx);
- efx_stop_interrupts(efx, false);
+ efx_stop_all(efx);
+ efx_stop_interrupts(efx, false);
+ }
rtnl_unlock();
@@ -2747,19 +2749,21 @@ static int efx_pm_thaw(struct device *dev)
rtnl_lock();
- efx_start_interrupts(efx, false);
+ if (efx->state != STATE_DISABLED) {
+ efx_start_interrupts(efx, false);
- mutex_lock(&efx->mac_lock);
- efx->phy_op->reconfigure(efx);
- mutex_unlock(&efx->mac_lock);
+ mutex_lock(&efx->mac_lock);
+ efx->phy_op->reconfigure(efx);
+ mutex_unlock(&efx->mac_lock);
- efx_start_all(efx);
+ efx_start_all(efx);
- netif_device_attach(efx->net_dev);
+ netif_device_attach(efx->net_dev);
- efx->state = STATE_READY;
+ efx->state = STATE_READY;
- efx->type->resume_wol(efx);
+ efx->type->resume_wol(efx);
+ }
rtnl_unlock();