]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
powerpc/eeh: Skip finding bus until after failure reporting
authorRussell Currey <ruscur@russell.cc>
Mon, 12 Sep 2016 04:17:24 +0000 (14:17 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 22 Sep 2016 21:54:21 +0000 (07:54 +1000)
In eeh_handle_special_event(), eeh_pe_bus_get() is called before calling
eeh_report_failure() on every device under a PE.  If a PE was missing a
bus for some reason, the error would occur before reporting failure, even
though eeh_report_failure() doesn't require a bus.

Fix this by moving the bus retrieval and error check after the
eeh_report_failure() calls.

Signed-off-by: Russell Currey <ruscur@russell.cc>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/eeh_driver.c

index 29aa8d1ce273cbeb63dc12a7ebed634b6f39f878..a62be72da274de3993a4b28cfbad7938d5502559 100644 (file)
@@ -993,6 +993,8 @@ static void eeh_handle_special_event(void)
 
                                /* Notify all devices to be down */
                                eeh_pe_state_clear(pe, EEH_PE_PRI_BUS);
+                               eeh_pe_dev_traverse(pe,
+                                       eeh_report_failure, NULL);
                                bus = eeh_pe_bus_get(phb_pe);
                                if (!bus) {
                                        pr_err("%s: Cannot find PCI bus for "
@@ -1002,8 +1004,6 @@ static void eeh_handle_special_event(void)
                                               pe->addr);
                                        break;
                                }
-                               eeh_pe_dev_traverse(pe,
-                                       eeh_report_failure, NULL);
                                pci_hp_remove_devices(bus);
                        }
                        pci_unlock_rescan_remove();