[Skiboot] [PATCH 5/5] nvlink: Add primitive EEH support for NPU devices

Alistair Popple alistair at popple.id.au
Thu Jan 14 14:17:05 AEDT 2016


On Thu, 7 Jan 2016 14:36:32 Russell Currey wrote:

<snip>

> +
> +static int64_t npu_eeh_next_error(struct phb *phb,
> +				  uint64_t *first_frozen_pe,
> +				  uint16_t *pci_error_type,
> +				  uint16_t *severity)
> +{
> +	struct npu *p = phb_to_npu(phb);
> +	int i;
> +	uint64_t result = 0;
> +	*first_frozen_pe = -1;
> +	*pci_error_type = OPAL_EEH_NO_ERROR;
> +	*severity = OPAL_EEH_SEV_NO_ERROR;
> +
> +	if (p->fenced) {
> +		*pci_error_type = OPAL_EEH_PHB_ERROR;
> +		*severity = OPAL_EEH_SEV_PHB_FENCED;
> +		return OPAL_SUCCESS;
> +	}
> +
> +	npu_ioda_sel(p, NPU_IODA_TBL_PESTB, 0, true);
> +	for (i = 0; i < p->total_devices; i++) {

As before we need to loop up to NPU_NUM_OF_PES rather than
p->total_devices.

- Alistair

> +		result = in_be64(p->at_regs + NPU_IODA_DATA0);
> +		if (result > 0) {
> +			*first_frozen_pe = i;
> +			*pci_error_type = OPAL_EEH_PE_ERROR;
> +			*severity = OPAL_EEH_SEV_PE_ER;
> +			break;
> +		}
> +	}
> +
>  	return OPAL_SUCCESS;
>  }
>  
> @@ -1076,14 +1118,14 @@ static const struct phb_ops npu_ops = {
>  	.power_state		= npu_power_state,
>  	.slot_power_off		= NULL,
>  	.slot_power_on		= NULL,
> -	.hot_reset		= NULL,
> +	.hot_reset		= npu_hreset,
>  	.fundamental_reset	= npu_freset,
>  	.complete_reset		= NULL,
>  	.poll			= NULL,
>  	.eeh_freeze_status	= npu_freeze_status,
>  	.eeh_freeze_clear	= NULL,
>  	.eeh_freeze_set		= NULL,
> -	.next_error		= NULL,
> +	.next_error		= npu_eeh_next_error,
>  	.err_inject		= npu_err_inject,
>  	.get_diag_data		= NULL,
>  	.get_diag_data2		= NULL,
> 



More information about the Skiboot mailing list