Skip to content

Commit

Permalink
cxgb3: Fix EEH final recovery attempt
Browse files Browse the repository at this point in the history
EEH attempts to recover up 6 times.
The last attempt leaves all the ports and adapter down.hen
The driver is then unloaded, bringing the adapter down again
unconditionally. The unload will hang.
Check if the adapter is already down before trying to bring it down again.

Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Divy Le Ray authored and David S. Miller committed Apr 20, 2009
1 parent 2c2f409 commit e8d1937
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/net/cxgb3/cxgb3_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1235,6 +1235,10 @@ static int cxgb_close(struct net_device *dev)
struct port_info *pi = netdev_priv(dev);
struct adapter *adapter = pi->adapter;


if (!adapter->open_device_map)
return 0;

/* Stop link fault interrupts */
t3_xgm_intr_disable(adapter, pi->port_id);
t3_read_reg(adapter, A_XGM_INT_STATUS + pi->mac.offset);
Expand Down Expand Up @@ -2823,6 +2827,9 @@ static pci_ers_result_t t3_io_error_detected(struct pci_dev *pdev,
struct adapter *adapter = pci_get_drvdata(pdev);
int ret;

if (state == pci_channel_io_perm_failure)
return PCI_ERS_RESULT_DISCONNECT;

ret = t3_adapter_error(adapter, 0);

/* Request a slot reset. */
Expand Down

0 comments on commit e8d1937

Please sign in to comment.