aboutsummaryrefslogtreecommitdiff
path: root/hw/npu2-opencapi.c
diff options
context:
space:
mode:
authorFrederic Barrat <fbarrat@linux.ibm.com>2019-10-09 21:38:02 +0200
committerOliver O'Halloran <oohall@gmail.com>2019-10-22 17:31:34 +1100
commit544ce7ef2b8c926cbdd7a23c0f796c1fb157c096 (patch)
treea373e78b7e0d7be9846fcb45972f8b47d07f73d0 /hw/npu2-opencapi.c
parent13e1a7e54cf0f46e2fe414b8499661dd4b9b903d (diff)
downloadskiboot-544ce7ef2b8c926cbdd7a23c0f796c1fb157c096.zip
skiboot-544ce7ef2b8c926cbdd7a23c0f796c1fb157c096.tar.gz
skiboot-544ce7ef2b8c926cbdd7a23c0f796c1fb157c096.tar.bz2
npu2-opencapi: Make sure the PCI slot has the proper ID
The PCI slot created for the opencapi PHB didn't have its ID properly defined because it was created before we assign an ID to the PHB. Simply switch the PCI slot creation and PHB registration calls to fix it. Reviewed-by: Christophe Lombard <clombard@linux.vnet.ibm.com> Reviewed-by: Andrew Donnellan <ajd@linux.ibm.com> Signed-off-by: Frederic Barrat <fbarrat@linux.ibm.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Diffstat (limited to 'hw/npu2-opencapi.c')
-rw-r--r--hw/npu2-opencapi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/npu2-opencapi.c b/hw/npu2-opencapi.c
index 9a391bb..504c920 100644
--- a/hw/npu2-opencapi.c
+++ b/hw/npu2-opencapi.c
@@ -1704,6 +1704,8 @@ static void setup_device(struct npu2_dev *dev)
set_fence_control(dev->npu->chip_id, dev->npu->xscom_base, dev->brick_index, 0b00);
+ pci_register_phb(&dev->phb_ocapi, OPAL_DYNAMIC_PHB_ID);
+
if (npu2_ocapi_training_state != NPU2_TRAIN_DEFAULT) {
setup_debug_training_state(dev);
} else {
@@ -1717,7 +1719,6 @@ static void setup_device(struct npu2_dev *dev)
prlog(PR_ERR, "OCAPI: Cannot create PHB slot\n");
}
}
- pci_register_phb(&dev->phb_ocapi, OPAL_DYNAMIC_PHB_ID);
return;
}