[Skiboot] [PATCH v10 06/17] core/pci: Extend pci_restore_bridge_buses() for PCI slot

Gavin Shan gwshan at linux.vnet.ibm.com
Tue May 3 15:04:31 AEST 2016


Currently, pci_restore_bridge_buses() restores the assigned bus
ranges for all PCI bridges behind the specified PHB. This extends
the function and allows doing same thing for the PCI bridges behind
the specified slot. The extended functionality is going to be used
by PCI hotplug logic in the subsequent patches.

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 94e6995..aa9afbc 100644
--- a/core/pci.c
+++ b/core/pci.c
@@ -1619,9 +1619,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 bad7d0a..56e00a9 100644
--- a/hw/p7ioc-phb.c
+++ b/hw/p7ioc-phb.c
@@ -327,7 +327,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 91fc6bf..532aff5 100644
--- a/hw/phb3.c
+++ b/hw/phb3.c
@@ -2043,7 +2043,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 1f3237e..2d9a102 100644
--- a/include/pci.h
+++ b/include/pci.h
@@ -529,7 +529,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