aboutsummaryrefslogtreecommitdiff
path: root/core/pci-opal.c
diff options
context:
space:
mode:
authorFrederic Barrat <fbarrat@linux.ibm.com>2019-10-09 21:38:00 +0200
committerOliver O'Halloran <oohall@gmail.com>2019-10-22 17:31:29 +1100
commit94bc2d7a85110d752a8424d5f85382c4f02ec155 (patch)
tree35646014dbedf1d02a194445dbb76ba6381a6939 /core/pci-opal.c
parent30642155862c6fab9c8eca98b0a3f84636a98c01 (diff)
downloadskiboot-94bc2d7a85110d752a8424d5f85382c4f02ec155.zip
skiboot-94bc2d7a85110d752a8424d5f85382c4f02ec155.tar.gz
skiboot-94bc2d7a85110d752a8424d5f85382c4f02ec155.tar.bz2
core/pci: Fix scan of devices for opencapi slots
Opencapi devices are found directly under the PHB and the PHB slot doesn't have an associated PCI device (root complex). So when scanning a PHB, devices are added directly under the PHB, like it's done at boot time. Reviewed-by: Christophe Lombard <clombard@linux.vnet.ibm.com> Signed-off-by: Frederic Barrat <fbarrat@linux.ibm.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Diffstat (limited to 'core/pci-opal.c')
-rw-r--r--core/pci-opal.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/core/pci-opal.c b/core/pci-opal.c
index 7f47769..828ce8a 100644
--- a/core/pci-opal.c
+++ b/core/pci-opal.c
@@ -667,10 +667,17 @@ static void rescan_slot_devices(struct pci_slot *slot)
* prepare_link_change() is called (if needed) by the state
* machine during the slot reset or link polling
*/
- pci_scan_bus(phb, pd->secondary_bus,
- pd->subordinate_bus, &pd->children, pd, true);
- pci_add_device_nodes(phb, &pd->children, pd->dn,
- &phb->lstate, 0);
+ if (phb->phb_type != phb_type_npu_v2_opencapi) {
+ pci_scan_bus(phb, pd->secondary_bus,
+ pd->subordinate_bus, &pd->children, pd, true);
+ pci_add_device_nodes(phb, &pd->children, pd->dn,
+ &phb->lstate, 0);
+ } else {
+ pci_scan_bus(phb, 0, 0xff, &phb->devices, NULL, true);
+ pci_add_device_nodes(phb, &phb->devices,
+ phb->dt_node, &phb->lstate, 0);
+ phb->ops->phb_final_fixup(phb);
+ }
}
static void remove_slot_devices(struct pci_slot *slot)
@@ -678,7 +685,10 @@ static void remove_slot_devices(struct pci_slot *slot)
struct phb *phb = slot->phb;
struct pci_device *pd = slot->pd;
- pci_remove_bus(phb, &pd->children);
+ if (phb->phb_type != phb_type_npu_v2_opencapi)
+ pci_remove_bus(phb, &pd->children);
+ else
+ pci_remove_bus(phb, &phb->devices);
}
static void link_up_timer(struct timer *t, void *data,