Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/eeh: Skip finding bus until after failure reporting

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>

authored by

Russell Currey and committed by
Michael Ellerman
af2e3a00 e98ddb77

+2 -2
+2 -2
arch/powerpc/kernel/eeh_driver.c
··· 993 993 994 994 /* Notify all devices to be down */ 995 995 eeh_pe_state_clear(pe, EEH_PE_PRI_BUS); 996 + eeh_pe_dev_traverse(pe, 997 + eeh_report_failure, NULL); 996 998 bus = eeh_pe_bus_get(phb_pe); 997 999 if (!bus) { 998 1000 pr_err("%s: Cannot find PCI bus for " ··· 1004 1002 pe->addr); 1005 1003 break; 1006 1004 } 1007 - eeh_pe_dev_traverse(pe, 1008 - eeh_report_failure, NULL); 1009 1005 pci_hp_remove_devices(bus); 1010 1006 } 1011 1007 pci_unlock_rescan_remove();