Skip to content

Commit

Permalink
sfc: Keep disabled NICs quiescent during suspend/resume
Browse files Browse the repository at this point in the history
Currently we ignore and clear the disabled state.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
  • Loading branch information
Ben Hutchings committed Aug 24, 2012
1 parent 61da026 commit 6032fb5
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions drivers/net/ethernet/sfc/efx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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();

Expand Down

0 comments on commit 6032fb5

Please sign in to comment.