[POWERPC] EEH: Drivers that need reset trump others
authorLinas Vepstas <linas@austin.ibm.com>
Fri, 2 Nov 2007 20:27:50 +0000 (07:27 +1100)
committerPaul Mackerras <paulus@samba.org>
Thu, 8 Nov 2007 03:15:32 +0000 (14:15 +1100)
Bugfix: if a driver controlling one part of a multi-function PCI card
has asked for a reset, honor that request above all others.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/platforms/pseries/eeh_driver.c

index 6e631b5..57e025e 100644 (file)
@@ -105,9 +105,10 @@ static void eeh_report_error(struct pci_dev *dev, void *userdata)
                return;
 
        rc = driver->err_handler->error_detected (dev, pci_channel_io_frozen);
+
+       /* A driver that needs a reset trumps all others */
+       if (rc == PCI_ERS_RESULT_NEED_RESET) *res = rc;
        if (*res == PCI_ERS_RESULT_NONE) *res = rc;
-       if (*res == PCI_ERS_RESULT_DISCONNECT &&
-            rc == PCI_ERS_RESULT_NEED_RESET) *res = rc;
 }
 
 /**
@@ -129,9 +130,10 @@ static void eeh_report_mmio_enabled(struct pci_dev *dev, void *userdata)
                return;
 
        rc = driver->err_handler->mmio_enabled (dev);
+
+       /* A driver that needs a reset trumps all others */
+       if (rc == PCI_ERS_RESULT_NEED_RESET) *res = rc;
        if (*res == PCI_ERS_RESULT_NONE) *res = rc;
-       if (*res == PCI_ERS_RESULT_DISCONNECT &&
-            rc == PCI_ERS_RESULT_NEED_RESET) *res = rc;
 }
 
 /**