Skip to content

Commit

Permalink
e100: Fix napi_enable BUG_ON when recovering from EEH error
Browse files Browse the repository at this point in the history
BUG_ON(!test_bit(NAPI_STATE_SCHED, &n->state)) was being hit
during e100 EEH recovery. The problem source was a napi_enable
call being made during e100_io_error_detected. Napi should remain
disabled after e100_down, and only be reenabled when the interface
is recovered.

This patch also updates e100_io_error_detected in order to make
it similar to the current versions of the error_detected callback
in drivers such as e1000e and ixgbe.

Signed-off-by: Andre Detsch <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Andre Detsch authored and davem330 committed Jun 8, 2009
1 parent 1d0ebfe commit ef681ce
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions drivers/net/e100.c
Original file line number Diff line number Diff line change
Expand Up @@ -2822,12 +2822,13 @@ static pci_ers_result_t e100_io_error_detected(struct pci_dev *pdev, pci_channel
struct net_device *netdev = pci_get_drvdata(pdev);
struct nic *nic = netdev_priv(netdev);

/* Similar to calling e100_down(), but avoids adapter I/O. */
e100_close(netdev);

/* Detach; put netif into a state similar to hotplug unplug. */
napi_enable(&nic->napi);
netif_device_detach(netdev);

if (state == pci_channel_io_perm_failure)
return PCI_ERS_RESULT_DISCONNECT;

if (netif_running(netdev))
e100_down(nic);
pci_disable_device(pdev);

/* Request a slot reset. */
Expand Down

0 comments on commit ef681ce

Please sign in to comment.