aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederic Barrat <fbarrat@linux.ibm.com>2019-10-09 21:38:02 +0200
committerVasant Hegde <hegdevasant@linux.vnet.ibm.com>2020-03-11 10:57:32 +0530
commita37b629efe56cbe9cbd19bff9a03e609a4ec4900 (patch)
tree3891bd3565fe217a43b6d0504c6d41045374cfab
parentc4cc427b7f161d1dba4a20f713a04536cb58deda (diff)
downloadskiboot-a37b629efe56cbe9cbd19bff9a03e609a4ec4900.zip
skiboot-a37b629efe56cbe9cbd19bff9a03e609a4ec4900.tar.gz
skiboot-a37b629efe56cbe9cbd19bff9a03e609a4ec4900.tar.bz2
npu2-opencapi: Make sure the PCI slot has the proper ID
[ Upstream commit 544ce7ef2b8c926cbdd7a23c0f796c1fb157c096 ] 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> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
-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 9ddb603..1b65220 100644
--- a/hw/npu2-opencapi.c
+++ b/hw/npu2-opencapi.c
@@ -1738,6 +1738,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 {
@@ -1751,7 +1753,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;
}