Skip to content

Commit

Permalink
sfc: Reschedule any resets scheduled inside efx_pm_freeze()
Browse files Browse the repository at this point in the history
efx_pm_freeze() sets efx->state = STATE_FINI, which means
efx_reset_work() will abort any scheduled resets.

efx_pm_thaw() should reschedule efx_reset_work() again,
since a freeze/thaw will not have reset the hardware.

This bug was spotted by inspection - there is no real world example of
this happening.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Steve Hodgson authored and David S. Miller committed Jun 2, 2010
1 parent 3bd9303 commit 319ba64
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/net/sfc/efx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1886,6 +1886,9 @@ static void efx_reset_work(struct work_struct *data)
{
struct efx_nic *efx = container_of(data, struct efx_nic, reset_work);

if (efx->reset_pending == RESET_TYPE_NONE)
return;

/* If we're not RUNNING then don't reset. Leave the reset_pending
* flag set so that efx_pci_probe_main will be retried */
if (efx->state != STATE_RUNNING) {
Expand Down Expand Up @@ -2332,6 +2335,9 @@ static int efx_pm_thaw(struct device *dev)

efx->type->resume_wol(efx);

/* Reschedule any quenched resets scheduled during efx_pm_freeze() */
queue_work(reset_workqueue, &efx->reset_work);

return 0;
}

Expand Down

0 comments on commit 319ba64

Please sign in to comment.