diff mbox

[v12,11/23] core/pci: Extend pci_restore_bridge_buses() for PCI slot

Message ID 1465535032-26749-12-git-send-email-gwshan@linux.vnet.ibm.com
State Accepted
Headers show

Commit Message

Gavin Shan June 10, 2016, 5:03 a.m. UTC
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@linux.vnet.ibm.com>
Reviewed-by: Russell Currey <ruscur@russell.cc>
---
 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 mbox

Patch

diff --git a/core/pci.c b/core/pci.c
index 64b9189..8040932 100644
--- a/core/pci.c
+++ b/core/pci.c
@@ -1628,9 +1628,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 591c9ec..a50bae0 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 ab6922c..9a67560 100644
--- a/hw/phb3.c
+++ b/hw/phb3.c
@@ -2093,7 +2093,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 1039f10..788f1ef 100644
--- a/include/pci.h
+++ b/include/pci.h
@@ -530,7 +530,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,