Patchwork e1000: return PCI_ERS_RESULT_DISCONNECT on permanent error

login
register
mail settings
Submitter Andre Detsch
Date June 5, 2009, 6:40 p.m.
Message ID <200906051540.56392.adetsch@br.ibm.com>
Download mbox | patch
Permalink /patch/28161/
State Awaiting Upstream
Delegated to: David Miller
Headers show

Comments

Andre Detsch - June 5, 2009, 6:40 p.m.
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.

Signed-off-by: Andre Detsch <adetsch@br.ibm.com>
Cc: Mike Mason <mmlnx@us.ibm.com>
---
 drivers/net/e1000/e1000_main.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
Jeff Kirsher - June 10, 2009, 10:53 p.m.
On Fri, Jun 5, 2009 at 11:40 AM, Andre Detsch<adetsch@br.ibm.com> wrote:
> 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.
>
> Signed-off-by: Andre Detsch <adetsch@br.ibm.com>
> Cc: Mike Mason <mmlnx@us.ibm.com>
> ---
>  drivers/net/e1000/e1000_main.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
> index 05e87a5..df1d5ca 100644
> --- a/drivers/net/e1000/e1000_main.c
> +++ b/drivers/net/e1000/e1000_main.c
> @@ -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.

Patch

diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 05e87a5..df1d5ca 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -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);