aboutsummaryrefslogtreecommitdiff
path: root/hw/p7ioc-phb.c
diff options
context:
space:
mode:
authorGavin Shan <gwshan@linux.vnet.ibm.com>2014-08-05 11:56:26 +1000
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-08-08 16:07:26 +1000
commit82b53f9d1d22a184f5929e95032bab5ea4c0e6a8 (patch)
treeefac45c2cc7743d29b66d35e8ccfc4dd811f8433 /hw/p7ioc-phb.c
parent227f0393d91b2156e62cfbeba7e6dc032494886c (diff)
downloadskiboot-82b53f9d1d22a184f5929e95032bab5ea4c0e6a8.zip
skiboot-82b53f9d1d22a184f5929e95032bab5ea4c0e6a8.tar.gz
skiboot-82b53f9d1d22a184f5929e95032bab5ea4c0e6a8.tar.bz2
PCI: Restore bus numbers after complete reset
The complete reset could be issued by kdump kernel to remove pending PCI traffic in order to avoid EEH errors in kdump scenario. However, the bus numbers configured into PCI bridges would be lost after the reset and it would cause that some of PCI devices (e.g. IPR) can't be probed by kdump kernel successfully. The patch fixes above issue by restoring bus numbers after complete reset. It's responsing to bug#113210 Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'hw/p7ioc-phb.c')
-rw-r--r--hw/p7ioc-phb.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/hw/p7ioc-phb.c b/hw/p7ioc-phb.c
index fd2ebd6..0a866fa 100644
--- a/hw/p7ioc-phb.c
+++ b/hw/p7ioc-phb.c
@@ -336,6 +336,16 @@ static int64_t p7ioc_sm_freset(struct p7ioc_phb *p)
p->state = P7IOC_PHB_STATE_FUNCTIONAL;
p->flags &= ~P7IOC_PHB_CFG_BLOCKED;
+
+ /*
+ * We might be required to restore bus numbers for PCI bridges
+ * for complete reset
+ */
+ if (p->flags & P7IOC_RESTORE_BUS_NUM) {
+ p->flags &= ~P7IOC_RESTORE_BUS_NUM;
+ pci_restore_bridge_buses(&p->phb);
+ }
+
return OPAL_SUCCESS;
}
@@ -654,6 +664,9 @@ static int64_t p7ioc_complete_reset(struct phb *phb, uint8_t assert)
if (p->state != P7IOC_PHB_STATE_FUNCTIONAL)
return OPAL_HARDWARE;
+ /* Restore bus numbers for bridges */
+ p->flags |= P7IOC_RESTORE_BUS_NUM;
+
return p7ioc_sm_slot_power_on(p);
}