Skip to contentSkip to conversation

return PCI_ERS_RESULT_DISCONNECT on permanent failure

PATCH In review Dean Nelson 4 participants 13 messages Jul 31, 2009 – Aug 5, 2009

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

cover return PCI_ERS_RESULT_DISCONNECT on permanent failure

PCI drivers that implement the struct pci_error_handlers' error_detected callback should return PCI_ERS_RESULT_DISCONNECT if the state passed in is pci_channel_io_perm_failure.

There have been a few of this type of net driver that have recently been modified to address this issue. See the following commits:

http://git.kernel.org/linus/c93b5a76d58656158d195a7df507ebc660010969
http://git.kernel.org/linus/eab633021c26025b34f36f79f0311d3d99f40ceb
http://git.kernel.org/linus/ef681ce1e8b3e63317cd724c200b2fd39286c005
http://git.kernel.org/linus/59ed6eecff4aa00c5c5d18ffd180acac108d596e
http://git.kernel.org/linus/3044b8d1ff8c05237652a692fb572a34e4d70146

This patchset is an attempt to address the remaining net drivers of this type. None of the patches in this patchset have been tested, since I don't have the hardware to test any of them. I'm simply making these patches available for whomever is interested and able to test them, to do so. Perhaps the individual patches can be committed as they get tested, reviewed and ACK'd.

Apologies in advance if I'm not Cc'ng the correct maintainers of these drivers.

Thanks,
Dean

#1 lore raw

PATCH 1/9 atl1c: return PCI_ERS_RESULT_DISCONNECT on permanent failure

PCI drivers that implement the struct pci_error_handlers' error_detected callback should return PCI_ERS_RESULT_DISCONNECT if the state passed in is pci_channel_io_perm_failure. This patch fixes the issue for atl1c.

---

This patch has not been tested, since I don't have the hardware to test it. It is based on a few recent patches. See the following commits:

http://git.kernel.org/linus/c93b5a76d58656158d195a7df507ebc660010969
http://git.kernel.org/linus/eab633021c26025b34f36f79f0311d3d99f40ceb
http://git.kernel.org/linus/ef681ce1e8b3e63317cd724c200b2fd39286c005
http://git.kernel.org/linus/59ed6eecff4aa00c5c5d18ffd180acac108d596e
http://git.kernel.org/linus/3044b8d1ff8c05237652a692fb572a34e4d70146

 drivers/net/atl1c/atl1c_main.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/net/atl1c/atl1c_main.c +3 -0
index cd547a2..7426053 100644
@@ -2678,6 +2678,9 @@ static pci_ers_result_t atl1c_io_error_detected(struct pci_dev *pdev,
 
 	netif_device_detach(netdev);
 
+	if (state == pci_channel_io_perm_failure)
+		return PCI_ERS_RESULT_DISCONNECT;
+
 	if (netif_running(netdev))
 		atl1c_down(adapter);
 
#2 lore raw

PATCH 2/9 atl1e: return PCI_ERS_RESULT_DISCONNECT on permanent failure

In reply to Dean Nelson

PCI drivers that implement the struct pci_error_handlers' error_detected callback should return PCI_ERS_RESULT_DISCONNECT if the state passed in is pci_channel_io_perm_failure. This patch fixes the issue for atl1e.

---

This patch has not been tested, since I don't have the hardware to test it. It is based on a few recent patches. See the following commits:

http://git.kernel.org/linus/c93b5a76d58656158d195a7df507ebc660010969
http://git.kernel.org/linus/eab633021c26025b34f36f79f0311d3d99f40ceb
http://git.kernel.org/linus/ef681ce1e8b3e63317cd724c200b2fd39286c005
http://git.kernel.org/linus/59ed6eecff4aa00c5c5d18ffd180acac108d596e
http://git.kernel.org/linus/3044b8d1ff8c05237652a692fb572a34e4d70146

 drivers/net/atl1e/atl1e_main.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/net/atl1e/atl1e_main.c +3 -0
index 9fc6d6d..4570749 100644
@@ -2497,6 +2497,9 @@ atl1e_io_error_detected(struct pci_dev *pdev, pci_channel_state_t state)
 
 	netif_device_detach(netdev);
 
+	if (state == pci_channel_io_perm_failure)
+		return PCI_ERS_RESULT_DISCONNECT;
+
 	if (netif_running(netdev))
 		atl1e_down(adapter);
 
#3 lore raw

PATCH 3/9 bnx2: return PCI_ERS_RESULT_DISCONNECT on permanent failure

In reply to Dean Nelson

PCI drivers that implement the struct pci_error_handlers' error_detected callback should return PCI_ERS_RESULT_DISCONNECT if the state passed in is pci_channel_io_perm_failure. This patch fixes the issue for bnx2.

---

This patch has not been tested, since I don't have the hardware to test it. It is based on a few recent patches. See the following commits:

http://git.kernel.org/linus/c93b5a76d58656158d195a7df507ebc660010969
http://git.kernel.org/linus/eab633021c26025b34f36f79f0311d3d99f40ceb
http://git.kernel.org/linus/ef681ce1e8b3e63317cd724c200b2fd39286c005
http://git.kernel.org/linus/59ed6eecff4aa00c5c5d18ffd180acac108d596e
http://git.kernel.org/linus/3044b8d1ff8c05237652a692fb572a34e4d70146

 drivers/net/bnx2.c             |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/net/bnx2.c +5 -0
index b70cc99..7bdefe2 100644
@@ -8188,6 +8188,11 @@ static pci_ers_result_t bnx2_io_error_detected(struct pci_dev *pdev,
 	rtnl_lock();
 	netif_device_detach(dev);
 
+	if (state == pci_channel_io_perm_failure) {
+		rtnl_unlock();
+		return PCI_ERS_RESULT_DISCONNECT;
+	}
+
 	if (netif_running(dev)) {
 		bnx2_netif_stop(bp);
 		del_timer_sync(&bp->timer);
#4 lore raw

PATCH 4/9 bnx2x: return PCI_ERS_RESULT_DISCONNECT on permanent failure

In reply to Dean Nelson

PCI drivers that implement the struct pci_error_handlers' error_detected callback should return PCI_ERS_RESULT_DISCONNECT if the state passed in is pci_channel_io_perm_failure. This patch fixes the issue for bnx2x.

---

This patch has not been tested, since I don't have the hardware to test it. It is based on a few recent patches. See the following commits:

http://git.kernel.org/linus/c93b5a76d58656158d195a7df507ebc660010969
http://git.kernel.org/linus/eab633021c26025b34f36f79f0311d3d99f40ceb
http://git.kernel.org/linus/ef681ce1e8b3e63317cd724c200b2fd39286c005
http://git.kernel.org/linus/59ed6eecff4aa00c5c5d18ffd180acac108d596e
http://git.kernel.org/linus/3044b8d1ff8c05237652a692fb572a34e4d70146

 drivers/net/bnx2x_main.c       |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/net/bnx2x_main.c +5 -0
index 6c67be6..086eaaa 100644
@@ -11553,6 +11553,11 @@ static pci_ers_result_t bnx2x_io_error_detected(struct pci_dev *pdev,
 
 	netif_device_detach(dev);
 
+	if (state == pci_channel_io_perm_failure) {
+		rtnl_unlock();
+		return PCI_ERS_RESULT_DISCONNECT;
+	}
+
 	if (netif_running(dev))
 		bnx2x_eeh_nic_unload(bp);
 
#5 lore raw

PATCH 5/9 igbvf: return PCI_ERS_RESULT_DISCONNECT on permanent failure

In reply to Dean Nelson

PCI drivers that implement the struct pci_error_handlers' error_detected callback should return PCI_ERS_RESULT_DISCONNECT if the state passed in is pci_channel_io_perm_failure. This patch fixes the issue for igbvf.

---

This patch has not been tested, since I don't have the hardware to test it. It is based on a few recent patches. See the following commits:

http://git.kernel.org/linus/c93b5a76d58656158d195a7df507ebc660010969
http://git.kernel.org/linus/eab633021c26025b34f36f79f0311d3d99f40ceb
http://git.kernel.org/linus/ef681ce1e8b3e63317cd724c200b2fd39286c005
http://git.kernel.org/linus/59ed6eecff4aa00c5c5d18ffd180acac108d596e
http://git.kernel.org/linus/3044b8d1ff8c05237652a692fb572a34e4d70146

 drivers/net/igbvf/netdev.c     |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/net/igbvf/netdev.c +3 -0
index 2bc9d63..dba360d 100644
@@ -2512,6 +2512,9 @@ static pci_ers_result_t igbvf_io_error_detected(struct pci_dev *pdev,
 
 	netif_device_detach(netdev);
 
+	if (state == pci_channel_io_perm_failure)
+		return PCI_ERS_RESULT_DISCONNECT;
+
 	if (netif_running(netdev))
 		igbvf_down(adapter);
 	pci_disable_device(pdev);
#6 lore raw

PATCH 6/9 ixgb: return PCI_ERS_RESULT_DISCONNECT on permanent failure

In reply to Dean Nelson

PCI drivers that implement the struct pci_error_handlers' error_detected callback should return PCI_ERS_RESULT_DISCONNECT if the state passed in is pci_channel_io_perm_failure. This patch fixes the issue for ixgb.

---

This patch has not been tested, since I don't have the hardware to test it. It is based on a few recent patches. See the following commits:

http://git.kernel.org/linus/c93b5a76d58656158d195a7df507ebc660010969
http://git.kernel.org/linus/eab633021c26025b34f36f79f0311d3d99f40ceb
http://git.kernel.org/linus/ef681ce1e8b3e63317cd724c200b2fd39286c005
http://git.kernel.org/linus/59ed6eecff4aa00c5c5d18ffd180acac108d596e
http://git.kernel.org/linus/3044b8d1ff8c05237652a692fb572a34e4d70146

 drivers/net/ixgb/ixgb_main.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/net/ixgb/ixgb_main.c +5 -0
index eb917f1..fad08ce 100644
@@ -2227,6 +2227,11 @@ static pci_ers_result_t ixgb_io_error_detected(struct pci_dev *pdev,
 	struct net_device *netdev = pci_get_drvdata(pdev);
 	struct ixgb_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))
 		ixgb_down(adapter, true);
 
#7 lore raw

Re: [net-next-2.6 PATCH 6/9] ixgb: return PCI_ERS_RESULT_DISCONNECT on permanent failure

Quoted 25 lines · Dean Nelson

PCI drivers that implement the struct pci_error_handlers' error_detected callback should return PCI_ERS_RESULT_DISCONNECT if the state passed in is pci_channel_io_perm_failure. This patch fixes the issue for ixgb.

---

This patch has not been tested, since I don't have the hardware to test it. It is based on a few recent patches. See the following commits:

http://git.kernel.org/linus/c93b5a76d58656158d195a7df507ebc660010969
http://git.kernel.org/linus/eab633021c26025b34f36f79f0311d3d99f40ceb
http://git.kernel.org/linus/ef681ce1e8b3e63317cd724c200b2fd39286c005
http://git.kernel.org/linus/59ed6eecff4aa00c5c5d18ffd180acac108d596e
http://git.kernel.org/linus/3044b8d1ff8c05237652a692fb572a34e4d70146

 drivers/net/ixgb/ixgb_main.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/net/ixgb/ixgb_main.c +0 -0
index eb917f1..fad08ce 100644

drivers/net/ixgb/ixgb_main.c static pci_ers_result_t ixgb_io_error_detected(struct pci_dev *pdev, · line 2236

Quoted 10 lines
drivers/net/ixgb/ixgb_main.c +5 -0
@@ -2227,6 +2227,11 @@ static pci_ers_result_t ixgb_io_error_detected(struct pci_dev *pdev,
 	struct net_device *netdev = pci_get_drvdata(pdev);
 	struct ixgb_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))
 		ixgb_down(adapter, true);

Seems reasonable, especially since the same logic works fine on our other drivers. The hardware for this driver is somewhat difficult to get our hands on, but we'll definately give this a spot test once we can locate one of these NICs.

Cheers,
-PJ Waskiewicz

#8 lore raw

PATCH 7/9 qlge: return PCI_ERS_RESULT_DISCONNECT on permanent failure

In reply to Dean Nelson

PCI drivers that implement the struct pci_error_handlers' error_detected callback should return PCI_ERS_RESULT_DISCONNECT if the state passed in is pci_channel_io_perm_failure. This patch fixes the issue for qlge.

---

This patch has not been tested, since I don't have the hardware to test it. It is based on a few recent patches. See the following commits:

http://git.kernel.org/linus/c93b5a76d58656158d195a7df507ebc660010969
http://git.kernel.org/linus/eab633021c26025b34f36f79f0311d3d99f40ceb
http://git.kernel.org/linus/ef681ce1e8b3e63317cd724c200b2fd39286c005
http://git.kernel.org/linus/59ed6eecff4aa00c5c5d18ffd180acac108d596e
http://git.kernel.org/linus/3044b8d1ff8c05237652a692fb572a34e4d70146

 drivers/net/qlge/qlge_main.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/net/qlge/qlge_main.c +5 -0
index 5768af1..3a271af 100644
@@ -4076,6 +4076,11 @@ static pci_ers_result_t qlge_io_error_detected(struct pci_dev *pdev,
 	struct net_device *ndev = pci_get_drvdata(pdev);
 	struct ql_adapter *qdev = netdev_priv(ndev);
 
+	netif_device_detach(ndev);
+
+	if (state == pci_channel_io_perm_failure)
+		return PCI_ERS_RESULT_DISCONNECT;
+
 	if (netif_running(ndev))
 		ql_adapter_down(qdev);
 
#9 lore raw

PATCH 8/9 s2io: return PCI_ERS_RESULT_DISCONNECT on permanent failure

In reply to Dean Nelson

PCI drivers that implement the struct pci_error_handlers' error_detected callback should return PCI_ERS_RESULT_DISCONNECT if the state passed in is pci_channel_io_perm_failure. This patch fixes the issue for s2io.

---

This patch has not been tested, since I don't have the hardware to test it. It is based on a few recent patches. See the following commits:

http://git.kernel.org/linus/c93b5a76d58656158d195a7df507ebc660010969
http://git.kernel.org/linus/eab633021c26025b34f36f79f0311d3d99f40ceb
http://git.kernel.org/linus/ef681ce1e8b3e63317cd724c200b2fd39286c005
http://git.kernel.org/linus/59ed6eecff4aa00c5c5d18ffd180acac108d596e
http://git.kernel.org/linus/3044b8d1ff8c05237652a692fb572a34e4d70146

 drivers/net/s2io.c             |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/net/s2io.c +3 -0
index d4df933..bd6d713 100644
@@ -8636,6 +8636,9 @@ static pci_ers_result_t s2io_io_error_detected(struct pci_dev *pdev,
 
 	netif_device_detach(netdev);
 
+	if (state == pci_channel_io_perm_failure)
+		return PCI_ERS_RESULT_DISCONNECT;
+
 	if (netif_running(netdev)) {
 		/* Bring down the card, while avoiding PCI I/O */
 		do_s2io_card_down(sp, 0);
#10 lore raw

PATCH 9/9 vxge: return PCI_ERS_RESULT_DISCONNECT on permanent failure

In reply to Dean Nelson

PCI drivers that implement the struct pci_error_handlers' error_detected callback should return PCI_ERS_RESULT_DISCONNECT if the state passed in is pci_channel_io_perm_failure. This patch fixes the issue for vxge.

---

This patch has not been tested, since I don't have the hardware to test it. It is based on a few recent patches. See the following commits:

http://git.kernel.org/linus/c93b5a76d58656158d195a7df507ebc660010969
http://git.kernel.org/linus/eab633021c26025b34f36f79f0311d3d99f40ceb
http://git.kernel.org/linus/ef681ce1e8b3e63317cd724c200b2fd39286c005
http://git.kernel.org/linus/59ed6eecff4aa00c5c5d18ffd180acac108d596e
http://git.kernel.org/linus/3044b8d1ff8c05237652a692fb572a34e4d70146

 drivers/net/vxge/vxge-main.c   |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/net/vxge/vxge-main.c +3 -0
index 7b5402b..335140d 100644
@@ -3956,6 +3956,9 @@ static pci_ers_result_t vxge_io_error_detected(struct pci_dev *pdev,
 
 	netif_device_detach(netdev);
 
+	if (state == pci_channel_io_perm_failure)
+		return PCI_ERS_RESULT_DISCONNECT;
+
 	if (netif_running(netdev)) {
 		/* Bring down the card, while avoiding PCI I/O */
 		do_vxge_close(netdev, 0);
#11 lore raw

RE: [net-next-2.6 PATCH 9/9] vxge: return PCI_ERS_RESULT_DISCONNECT on permanent failure

Hi,

Reviewed the patch for vxge driver. Please accept it.

Thanks,
~Siva
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Dean Nelson
Sent: Saturday, August 01, 2009 12:44 AM
To: [email protected]
Cc: Ramkrishna Vepa
Subject: [net-next-2.6 PATCH 9/9] vxge: return PCI_ERS_RESULT_DISCONNECT on permanent failure

PCI drivers that implement the struct pci_error_handlers' error_detected callback should return PCI_ERS_RESULT_DISCONNECT if the state passed in is
pci_channel_io_perm_failure. This patch fixes the issue for vxge.

---

This patch has not been tested, since I don't have the hardware to test it.
It is based on a few recent patches. See the following commits:

http://git.kernel.org/linus/c93b5a76d58656158d195a7df507ebc660010969
http://git.kernel.org/linus/eab633021c26025b34f36f79f0311d3d99f40ceb
http://git.kernel.org/linus/ef681ce1e8b3e63317cd724c200b2fd39286c005
http://git.kernel.org/linus/59ed6eecff4aa00c5c5d18ffd180acac108d596e
http://git.kernel.org/linus/3044b8d1ff8c05237652a692fb572a34e4d70146

 drivers/net/vxge/vxge-main.c   |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/net/vxge/vxge-main.c +0 -0
index 7b5402b..335140d 100644
@@ -3956,6 +3956,9 @@ static pci_ers_result_t

vxge_io_error_detected(struct pci_dev *pdev,

netif_device_detach(netdev);

+ if (state == pci_channel_io_perm_failure)
+ return PCI_ERS_RESULT_DISCONNECT;
+
if (netif_running(netdev)) {
/* Bring down the card, while avoiding PCI I/O */ do_vxge_close(netdev, 0);
--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#12 lore raw
In reply to Dean Nelson

From: Dean Nelson <[email protected]>
Date: Fri, 31 Jul 2009 15:12:55 -0400

Quoted 3 lines

PCI drivers that implement the struct pci_error_handlers' error_detected callback should return PCI_ERS_RESULT_DISCONNECT if the state passed in is pci_channel_io_perm_failure.

...

Quoted 5 lines

This patchset is an attempt to address the remaining net drivers of this type. None of the patches in this patchset have been tested, since I don't have the hardware to test any of them. I'm simply making these patches available for whomever is interested and able to test them, to do so. Perhaps the individual patches can be committed as they get tested, reviewed and ACK'd.

I think these are safe to apply, they look so straightforward to me. I've thus added them all to net-next-2.6, thanks!