[RFC PATCH 2/3] powernv/mce: Print correct severity for mce error.

Michael Ellerman mpe at ellerman.id.au
Fri Mar 29 11:23:23 AEDT 2019


Mahesh J Salgaonkar <mahesh at linux.vnet.ibm.com> writes:
> diff --git a/arch/powerpc/include/asm/mce.h b/arch/powerpc/include/asm/mce.h
> index 8d0b1c24c636..314ed3f13d59 100644
> --- a/arch/powerpc/include/asm/mce.h
> +++ b/arch/powerpc/include/asm/mce.h
> @@ -110,17 +110,18 @@ enum MCE_LinkErrorType {
>  };
>  
>  struct machine_check_event {
> -	enum MCE_Version	version:8;	/* 0x00 */
> -	uint8_t			in_use;		/* 0x01 */
> -	enum MCE_Severity	severity:8;	/* 0x02 */
> -	enum MCE_Initiator	initiator:8;	/* 0x03 */
> -	enum MCE_ErrorType	error_type:8;	/* 0x04 */
> -	enum MCE_Disposition	disposition:8;	/* 0x05 */
> -	uint16_t		cpu;		/* 0x06 */
> -	uint64_t		gpr3;		/* 0x08 */
> -	uint64_t		srr0;		/* 0x10 */
> -	uint64_t		srr1;		/* 0x18 */
> -	union {					/* 0x20 */
> +	enum MCE_Version	version:8;
> +	uint8_t			in_use;
> +	enum MCE_Severity	severity:8;
> +	enum MCE_Initiator	initiator:8;
> +	enum MCE_ErrorType	error_type:8;
> +	enum MCE_Disposition	disposition:8;
> +	uint8_t			sync_error;
> +	uint16_t		cpu;
> +	uint64_t		gpr3;
> +	uint64_t		srr0;
> +	uint64_t		srr1;

Can you switch these to use kernel types while you're at it, ie. u8, u64 etc.

> @@ -194,6 +195,7 @@ struct mce_error_info {
>  	} u;
>  	enum MCE_Severity	severity:8;
>  	enum MCE_Initiator	initiator:8;
> +	uint8_t			sync_error;

u8 here but bool later?

> diff --git a/arch/powerpc/kernel/mce_power.c b/arch/powerpc/kernel/mce_power.c
> index 6b800eec31f2..06161de19060 100644
> --- a/arch/powerpc/kernel/mce_power.c
> +++ b/arch/powerpc/kernel/mce_power.c
> @@ -133,106 +133,107 @@ struct mce_ierror_table {
>  	unsigned int error_subtype;
>  	unsigned int initiator;
>  	unsigned int severity;
> +	bool sync_error;
>  };

ie. here it's a bool?

> @@ -539,8 +543,9 @@ static int mce_handle_derror(struct pt_regs *regs,
>  		return handled;
>  
>  	mce_err->error_type = MCE_ERROR_TYPE_UNKNOWN;
> -	mce_err->severity = MCE_SEV_ERROR_SYNC;
> +	mce_err->severity = MCE_SEV_SEVERE;
>  	mce_err->initiator = MCE_INITIATOR_CPU;
> +	mce_err->sync_error = 1;

u8 or bool?

cheers


More information about the Linuxppc-dev mailing list