Skip to content

Commit

Permalink
npu2-opencapi: Make sure the PCI slot has the proper ID
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
fbarrat authored and oohal committed Oct 22, 2019
1 parent 13e1a7e commit 544ce7e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hw/npu2-opencapi.c
Expand Up @@ -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 {
Expand All @@ -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;
}

Expand Down

0 comments on commit 544ce7e

Please sign in to comment.