[Skiboot] [PATCH RESEND v2] npu2-opencapi: Don't send commands to NPU when link is down

Andrew Donnellan andrew.donnellan at au1.ibm.com
Thu Jul 26 17:45:24 AEST 2018


On 26/07/18 02:24, Frederic Barrat wrote:
> Even if an opencapi link is down, we currently always try to issue a
> config read operation when probing for PCI devices, because of the
> default scan map used for an opencapi PHB. The config operation fails,
> as expected, but it can also raise a FIR bit and trigger an HMI.
> 
> For opencapi, there's no root device like for a "normal" PCI PHB, so
> there's no reason to do the config operation. To fix it, we keep the
> scan map blank by default, and only add a device once the link is
> trained.
> 
> CC: stable # v6.1+
> Signed-off-by: Frederic Barrat <fbarrat at linux.ibm.com>

Reviewed-by: Andrew Donnellan <andrew.donnellan at au1.ibm.com>

> ---
> 
> RESEND as I had forgotten the changelog:
> 
> Changelog:
> v2: use scan map (Oliver)
> 
>   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 f82e6562..57c2f2fc 100644
> --- a/hw/npu2-opencapi.c
> +++ b/hw/npu2-opencapi.c
> @@ -1109,6 +1109,7 @@ static int64_t npu2_opencapi_poll_link(struct pci_slot *slot)
>   	case OCAPI_SLOT_LINK_TRAINED:
>   		otl_enabletx(chip_id, dev->npu->xscom_base, dev);
>   		pci_slot_set_state(slot, OCAPI_SLOT_NORMAL);
> +		dev->phb_ocapi.scan_map = 1;
>   		return OPAL_SUCCESS;
>   
>   	default:
> @@ -1629,7 +1630,7 @@ static void npu2_opencapi_setup_device(struct dt_node *dn_link, struct npu2 *n,
>   	dev->phb_ocapi.dt_node = dn_phb;
>   	dev->phb_ocapi.ops = &npu2_opencapi_ops;
>   	dev->phb_ocapi.phb_type = phb_type_npu_v2_opencapi;
> -	dev->phb_ocapi.scan_map = 1;
> +	dev->phb_ocapi.scan_map = 0;
>   	dev->index = dt_prop_get_u32(dn_link, "ibm,npu-link-index");
>   	dev->pl_xscom_base = dt_prop_get_u64(dn_link, "ibm,npu-phy");
>   	dev->lane_mask = dt_prop_get_u32(dn_link, "ibm,npu-lane-mask");
> 

-- 
Andrew Donnellan              OzLabs, ADL Canberra
andrew.donnellan at au1.ibm.com  IBM Australia Limited



More information about the Skiboot mailing list