Skip to contentSkip to conversation

e1000: return PCI_ERS_RESULT_DISCONNECT on permanent error

PATCH In review Andre Detsch 2 participants 2 messages Jun 5, 2009 – Jun 10, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 e1000: return PCI_ERS_RESULT_DISCONNECT on permanent error

PCI drivers that implement the io_error_detected callback should return PCI_ERS_RESULT_DISCONNECT if the state passed in is pci_channel_io_perm_failure. This state is not checked in many of the network drivers.

This patch fixes the omission in the e1000 driver.

Based on Mike Mason's similar patch for e1000e.

---
 drivers/net/e1000/e1000_main.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/net/e1000/e1000_main.c +3 -0
index 05e87a5..df1d5ca 100644
@@ -4816,6 +4816,9 @@ static pci_ers_result_t e1000_io_error_detected(struct pci_dev *pdev,
 	struct e1000_adapter *adapter = netdev_priv(netdev);
 
 	netif_device_detach(netdev);
+	
+	if (state == pci_channel_io_perm_failure)
+		return PCI_ERS_RESULT_DISCONNECT;
 
 	if (netif_running(netdev))
 		e1000_down(adapter);
Signature · 1 line
1.6.0.2
#1 lore raw
Quoted 20 lines · Andre Detsch

PCI drivers that implement the io_error_detected callback should return PCI_ERS_RESULT_DISCONNECT if the state passed in is pci_channel_io_perm_failure.  This state is not checked in many of the network drivers.

This patch fixes the omission in the e1000 driver.

Based on Mike Mason's similar patch for e1000e.

---
 drivers/net/e1000/e1000_main.c |    3 +++

 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/net/e1000/e1000_main.c +0 -0
index 05e87a5..df1d5ca 100644

drivers/net/e1000/e1000_main.c static pci_ers_result_t e1000_io_error_detected(struct pci_dev *pdev,

Quoted 10 lines
drivers/net/e1000/e1000_main.c +3 -1
@@ -4816,6 +4816,9 @@ static pci_ers_result_t e1000_io_error_detected(struct pci_dev *pdev,
        struct e1000_adapter *adapter = netdev_priv(netdev);
 
        netif_device_detach(netdev);
+
+       if (state == pci_channel_io_perm_failure)
+               return PCI_ERS_RESULT_DISCONNECT;
 
        if (netif_running(netdev))
                e1000_down(adapter);
--

Thanks, I have added this to my queue and will push it with the e1000e fix.

Signature · 2 lines
Cheers,
Jeff