diff mbox series

[07/16] npu2-opencapi: Make sure the PCI slot has the proper ID

Message ID 20190909123151.21944-8-fbarrat@linux.ibm.com
State Superseded
Headers show
Series opencapi: enable card reset and link retraining | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch master (470ffb5f29d741c3bed600f7bb7bf0cbb270e05a)
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot success Test snowpatch/job/snowpatch-skiboot on branch master
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot-dco success Signed-off-by present

Commit Message

Frederic Barrat Sept. 9, 2019, 12:31 p.m. UTC
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@linux.ibm.com>
---
 hw/npu2-opencapi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Christophe Lombard Sept. 17, 2019, 9:15 a.m. UTC | #1
On 09/09/2019 14:31, 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@linux.ibm.com>
> ---

Reviewed-by: Christophe Lombard <clombard@linux.vnet.ibm.com>
Andrew Donnellan Sept. 24, 2019, 4:39 p.m. UTC | #2
On 9/9/19 2:31 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@linux.ibm.com>

Reviewed-by: Andrew Donnellan <ajd@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 9a391bb0..504c9208 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;
>   }
>   
>
diff mbox series

Patch

diff --git a/hw/npu2-opencapi.c b/hw/npu2-opencapi.c
index 9a391bb0..504c9208 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;
 }