aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGavin Shan <gwshan@linux.vnet.ibm.com>2017-03-30 10:05:29 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-03-31 16:57:07 +1100
commit2e831a162653d53cb3e69cd98d75f0129752a643 (patch)
tree2a6e5d4c0f36a78f3fea410ea07a3bea98b19254
parentbb74665672d990b6676138efc1b07067df3806de (diff)
downloadskiboot-2e831a162653d53cb3e69cd98d75f0129752a643.zip
skiboot-2e831a162653d53cb3e69cd98d75f0129752a643.tar.gz
skiboot-2e831a162653d53cb3e69cd98d75f0129752a643.tar.bz2
core/pci: Add phb->ops->device_remove
This adds another PHB callback (device_remove()), corresponding to device_init(). With it, the PHB3 layer can receive notification upon PCI topology changes. This functionality will be used by the subsequent patches. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r--core/pci.c3
-rw-r--r--hw/p7ioc-phb.c1
-rw-r--r--hw/phb3.c1
-rw-r--r--hw/phb4.c1
-rw-r--r--include/pci.h1
5 files changed, 7 insertions, 0 deletions
diff --git a/core/pci.c b/core/pci.c
index 6864e6f..a8b4b69 100644
--- a/core/pci.c
+++ b/core/pci.c
@@ -526,6 +526,9 @@ void pci_remove_bus(struct phb *phb, struct list_head *list)
list_for_each_safe(list, pd, tmp, link) {
pci_remove_bus(phb, &pd->children);
+ if (phb->ops->device_remove)
+ phb->ops->device_remove(phb, pd);
+
/* Release device node and PCI slot */
if (pd->dn)
dt_free(pd->dn);
diff --git a/hw/p7ioc-phb.c b/hw/p7ioc-phb.c
index 82d4f15..21f6c3e 100644
--- a/hw/p7ioc-phb.c
+++ b/hw/p7ioc-phb.c
@@ -2318,6 +2318,7 @@ static const struct phb_ops p7ioc_phb_ops = {
.choose_bus = p7ioc_choose_bus,
.get_reserved_pe_number = p7ioc_get_reserved_pe_number,
.device_init = p7ioc_device_init,
+ .device_remove = NULL,
.pci_reinit = p7ioc_pci_reinit,
.eeh_freeze_status = p7ioc_eeh_freeze_status,
.eeh_freeze_clear = p7ioc_eeh_freeze_clear,
diff --git a/hw/phb3.c b/hw/phb3.c
index 0e64bdd..78f3fe8 100644
--- a/hw/phb3.c
+++ b/hw/phb3.c
@@ -3810,6 +3810,7 @@ static const struct phb_ops phb3_ops = {
.choose_bus = phb3_choose_bus,
.get_reserved_pe_number = phb3_get_reserved_pe_number,
.device_init = phb3_device_init,
+ .device_remove = NULL,
.ioda_reset = phb3_ioda_reset,
.papr_errinjct_reset = phb3_papr_errinjct_reset,
.pci_reinit = phb3_pci_reinit,
diff --git a/hw/phb4.c b/hw/phb4.c
index 55de229..571f703 100644
--- a/hw/phb4.c
+++ b/hw/phb4.c
@@ -2371,6 +2371,7 @@ static const struct phb_ops phb4_ops = {
.choose_bus = phb4_choose_bus,
.get_reserved_pe_number = phb4_get_reserved_pe_number,
.device_init = phb4_device_init,
+ .device_remove = NULL,
.ioda_reset = phb4_ioda_reset,
.papr_errinjct_reset = phb4_papr_errinjct_reset,
.pci_reinit = phb4_pci_reinit,
diff --git a/include/pci.h b/include/pci.h
index 732c1a3..dc418a9 100644
--- a/include/pci.h
+++ b/include/pci.h
@@ -207,6 +207,7 @@ struct phb_ops {
*/
int (*device_init)(struct phb *phb, struct pci_device *device,
void *data);
+ void (*device_remove)(struct phb *phb, struct pci_device *pd);
/* PHB final fixup is called after PCI probing is completed */
void (*phb_final_fixup)(struct phb *phb);