]> Pileus Git - ~andy/linux/commitdiff
sfc: Keep disabled NICs quiescent during suspend/resume
authorBen Hutchings <bhutchings@solarflare.com>
Fri, 27 Jul 2012 18:35:47 +0000 (19:35 +0100)
committerBen Hutchings <bhutchings@solarflare.com>
Fri, 24 Aug 2012 19:10:19 +0000 (20:10 +0100)
Currently we ignore and clear the disabled state.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
drivers/net/ethernet/sfc/efx.c

index e5f3a17349af5c8b93ed886b7aea90d659fe50bd..f02591bb62f479c4fecdb9cc074bf3f646df0da2 100644 (file)
@@ -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();