Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cxgb3: Fix EEH final recovery attempt

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>

authored by

Divy Le Ray and committed by
David S. Miller
e8d19370 2c2f409f

+7
+7
drivers/net/cxgb3/cxgb3_main.c
··· 1235 1235 struct port_info *pi = netdev_priv(dev); 1236 1236 struct adapter *adapter = pi->adapter; 1237 1237 1238 + 1239 + if (!adapter->open_device_map) 1240 + return 0; 1241 + 1238 1242 /* Stop link fault interrupts */ 1239 1243 t3_xgm_intr_disable(adapter, pi->port_id); 1240 1244 t3_read_reg(adapter, A_XGM_INT_STATUS + pi->mac.offset); ··· 2826 2822 { 2827 2823 struct adapter *adapter = pci_get_drvdata(pdev); 2828 2824 int ret; 2825 + 2826 + if (state == pci_channel_io_perm_failure) 2827 + return PCI_ERS_RESULT_DISCONNECT; 2829 2828 2830 2829 ret = t3_adapter_error(adapter, 0); 2831 2830