[Skiboot] [RFC 02/12] npu2-opencapi: Make sure the PCI slot has the proper ID

Andrew Donnellan ajd at linux.ibm.com
Thu Jun 20 15:46:00 AEST 2019


On 19/6/19 10:45 pm, Frederic Barrat wrote:
> 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.
> 
> Signed-off-by: Frederic Barrat <fbarrat at linux.ibm.com>

Reviewed-by: Andrew Donnellan <ajd at linux.ibm.com>

> ---
>   hw/npu2-opencapi.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/npu2-opencapi.c b/hw/npu2-opencapi.c
> index 4c47150f..ada41ddb 100644
> --- a/hw/npu2-opencapi.c
> +++ b/hw/npu2-opencapi.c
> @@ -1717,6 +1717,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 {
> @@ -1730,7 +1732,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;
>   }
>   
> 

-- 
Andrew Donnellan              OzLabs, ADL Canberra
ajd at linux.ibm.com             IBM Australia Limited



More information about the Skiboot mailing list