aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/include/asm/eeh.h1
-rw-r--r--arch/powerpc/kernel/eeh_driver.c3
-rw-r--r--arch/powerpc/kernel/eeh_pe.c2
-rw-r--r--arch/powerpc/platforms/powernv/eeh-powernv.c5
4 files changed, 9 insertions, 2 deletions
diff --git a/arch/powerpc/include/asm/eeh.h b/arch/powerpc/include/asm/eeh.h
index c5eb86f3d452..867c39b45df6 100644
--- a/arch/powerpc/include/asm/eeh.h
+++ b/arch/powerpc/include/asm/eeh.h
@@ -81,6 +81,7 @@ struct pci_dn;
81#define EEH_PE_KEEP (1 << 8) /* Keep PE on hotplug */ 81#define EEH_PE_KEEP (1 << 8) /* Keep PE on hotplug */
82#define EEH_PE_CFG_RESTRICTED (1 << 9) /* Block config on error */ 82#define EEH_PE_CFG_RESTRICTED (1 << 9) /* Block config on error */
83#define EEH_PE_REMOVED (1 << 10) /* Removed permanently */ 83#define EEH_PE_REMOVED (1 << 10) /* Removed permanently */
84#define EEH_PE_PRI_BUS (1 << 11) /* Cached primary bus */
84 85
85struct eeh_pe { 86struct eeh_pe {
86 int type; /* PE type: PHB/Bus/Device */ 87 int type; /* PE type: PHB/Bus/Device */
diff --git a/arch/powerpc/kernel/eeh_driver.c b/arch/powerpc/kernel/eeh_driver.c
index 8d14feb40f12..f69ecaa7ce33 100644
--- a/arch/powerpc/kernel/eeh_driver.c
+++ b/arch/powerpc/kernel/eeh_driver.c
@@ -564,6 +564,7 @@ static int eeh_reset_device(struct eeh_pe *pe, struct pci_bus *bus)
564 */ 564 */
565 eeh_pe_state_mark(pe, EEH_PE_KEEP); 565 eeh_pe_state_mark(pe, EEH_PE_KEEP);
566 if (bus) { 566 if (bus) {
567 eeh_pe_state_clear(pe, EEH_PE_PRI_BUS);
567 pci_lock_rescan_remove(); 568 pci_lock_rescan_remove();
568 pcibios_remove_pci_devices(bus); 569 pcibios_remove_pci_devices(bus);
569 pci_unlock_rescan_remove(); 570 pci_unlock_rescan_remove();
@@ -803,6 +804,7 @@ perm_error:
803 * the their PCI config any more. 804 * the their PCI config any more.
804 */ 805 */
805 if (frozen_bus) { 806 if (frozen_bus) {
807 eeh_pe_state_clear(pe, EEH_PE_PRI_BUS);
806 eeh_pe_dev_mode_mark(pe, EEH_DEV_REMOVED); 808 eeh_pe_dev_mode_mark(pe, EEH_DEV_REMOVED);
807 809
808 pci_lock_rescan_remove(); 810 pci_lock_rescan_remove();
@@ -886,6 +888,7 @@ static void eeh_handle_special_event(void)
886 continue; 888 continue;
887 889
888 /* Notify all devices to be down */ 890 /* Notify all devices to be down */
891 eeh_pe_state_clear(pe, EEH_PE_PRI_BUS);
889 bus = eeh_pe_bus_get(phb_pe); 892 bus = eeh_pe_bus_get(phb_pe);
890 eeh_pe_dev_traverse(pe, 893 eeh_pe_dev_traverse(pe,
891 eeh_report_failure, NULL); 894 eeh_report_failure, NULL);
diff --git a/arch/powerpc/kernel/eeh_pe.c b/arch/powerpc/kernel/eeh_pe.c
index ca9e5371930e..98f81800e00c 100644
--- a/arch/powerpc/kernel/eeh_pe.c
+++ b/arch/powerpc/kernel/eeh_pe.c
@@ -928,7 +928,7 @@ struct pci_bus *eeh_pe_bus_get(struct eeh_pe *pe)
928 bus = pe->phb->bus; 928 bus = pe->phb->bus;
929 } else if (pe->type & EEH_PE_BUS || 929 } else if (pe->type & EEH_PE_BUS ||
930 pe->type & EEH_PE_DEVICE) { 930 pe->type & EEH_PE_DEVICE) {
931 if (pe->bus) { 931 if (pe->state & EEH_PE_PRI_BUS) {
932 bus = pe->bus; 932 bus = pe->bus;
933 goto out; 933 goto out;
934 } 934 }
diff --git a/arch/powerpc/platforms/powernv/eeh-powernv.c b/arch/powerpc/platforms/powernv/eeh-powernv.c
index 5f152b95ca0c..87f47e55aab6 100644
--- a/arch/powerpc/platforms/powernv/eeh-powernv.c
+++ b/arch/powerpc/platforms/powernv/eeh-powernv.c
@@ -444,9 +444,12 @@ static void *pnv_eeh_probe(struct pci_dn *pdn, void *data)
444 * PCI devices of the PE are expected to be removed prior 444 * PCI devices of the PE are expected to be removed prior
445 * to PE reset. 445 * to PE reset.
446 */ 446 */
447 if (!edev->pe->bus) 447 if (!(edev->pe->state & EEH_PE_PRI_BUS)) {
448 edev->pe->bus = pci_find_bus(hose->global_number, 448 edev->pe->bus = pci_find_bus(hose->global_number,
449 pdn->busno); 449 pdn->busno);
450 if (edev->pe->bus)
451 edev->pe->state |= EEH_PE_PRI_BUS;
452 }
450 453
451 /* 454 /*
452 * Enable EEH explicitly so that we will do EEH check 455 * Enable EEH explicitly so that we will do EEH check