[Skiboot] [PATCH v9 10/22] core/pci: Extend pci_restore_bridge_buses() for PCI slot

Gavin Shan gwshan at linux.vnet.ibm.com
Thu Nov 12 13:33:17 AEDT 2015


Currently, pci_restore_bridge_buses() restores the assigned bus
ranges for all PCI bridges behind the specified PHB. This extends
the function and allows it to do that for the PCI bridges behind
the specified slot.

Signed-off-by: Gavin Shan <gwshan at linux.vnet.ibm.com>
---
 core/pci.c     | 4 ++--
 hw/p7ioc-phb.c | 2 +-
 hw/phb3.c      | 2 +-
 include/pci.h  | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/core/pci.c b/core/pci.c
index ad3b17a..1fac425 100644
--- a/core/pci.c
+++ b/core/pci.c
@@ -1604,9 +1604,9 @@ static int __pci_restore_bridge_buses(struct phb *phb,
 	return 0;
 }
 
-void pci_restore_bridge_buses(struct phb *phb)
+void pci_restore_bridge_buses(struct phb *phb, struct pci_device *pd)
 {
-	pci_walk_dev(phb, NULL, __pci_restore_bridge_buses, NULL);
+	pci_walk_dev(phb, pd, __pci_restore_bridge_buses, NULL);
 }
 
 struct pci_cfg_reg_filter *pci_find_cfg_reg_filter(struct pci_device *pd,
diff --git a/hw/p7ioc-phb.c b/hw/p7ioc-phb.c
index 66c166f..b743bba 100644
--- a/hw/p7ioc-phb.c
+++ b/hw/p7ioc-phb.c
@@ -345,7 +345,7 @@ static int64_t p7ioc_sm_freset(struct p7ioc_phb *p)
 			 */
 			if (p->flags & P7IOC_RESTORE_BUS_NUM) {
 				p->flags &= ~P7IOC_RESTORE_BUS_NUM;
-				pci_restore_bridge_buses(&p->phb);
+				pci_restore_bridge_buses(&p->phb, NULL);
 			}
 
 			return OPAL_SUCCESS;
diff --git a/hw/phb3.c b/hw/phb3.c
index 87bf470..2053277 100644
--- a/hw/phb3.c
+++ b/hw/phb3.c
@@ -2045,7 +2045,7 @@ static void phb3_setup_for_link_up(struct phb3 *p)
 	 */
 	if (p->flags & PHB3_RESTORE_BUS_NUM) {
 		p->flags &= ~PHB3_RESTORE_BUS_NUM;
-		pci_restore_bridge_buses(&p->phb);
+		pci_restore_bridge_buses(&p->phb, NULL);
 	}
 }
 
diff --git a/include/pci.h b/include/pci.h
index fbc62c0..1f648bd 100644
--- a/include/pci.h
+++ b/include/pci.h
@@ -524,7 +524,7 @@ extern struct pci_device *pci_walk_dev(struct phb *phb,
 						 void *),
 				       void *userdata);
 extern struct pci_device *pci_find_dev(struct phb *phb, uint16_t bdfn);
-extern void pci_restore_bridge_buses(struct phb *phb);
+extern void pci_restore_bridge_buses(struct phb *phb, struct pci_device *pd);
 extern struct pci_cfg_reg_filter *pci_find_cfg_reg_filter(struct pci_device *pd,
 					uint32_t start, uint32_t len);
 extern struct pci_cfg_reg_filter *pci_add_cfg_reg_filter(struct pci_device *pd,
-- 
2.1.0



More information about the Skiboot mailing list