linux-edac.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [1/2] rasdaemon: fix PCIe AER error type
@ 2018-08-14 16:15 Mauro Carvalho Chehab
  0 siblings, 0 replies; 3+ messages in thread
From: Mauro Carvalho Chehab @ 2018-08-14 16:15 UTC (permalink / raw)
  To: Thomas Tai; +Cc: mchehab, linux-edac

Em Mon, 14 May 2018 10:33:47 -0400
Thomas Tai <thomas.tai@oracle.com> escreveu:

> The error types between PCIe AER and CPU Machine Check are
> different. when handling aer_event, the PCIe AER error
> type should be used. Add an enum to match the kernel
> PCIe AER and use it to decode the error type.

Both patches applied, thanks!

> 
> Signed-off-by: Thomas Tai <thomas.tai@oracle.com>
> ---
>  ras-aer-handler.c | 15 +++++++--------
>  ras-events.h      |  7 +++++++
>  2 files changed, 14 insertions(+), 8 deletions(-)
> 
> diff --git a/ras-aer-handler.c b/ras-aer-handler.c
> index 2093875..65e321d 100644
> --- a/ras-aer-handler.c
> +++ b/ras-aer-handler.c
> @@ -96,18 +96,17 @@ int ras_aer_event_handler(struct trace_seq *s,
>  	if (pevent_get_field_val(s, event, "severity", record, &val, 1) < 0)
>  		return -1;
>  	switch (val) {
> -	case HW_EVENT_ERR_CORRECTED:
> -		ev.error_type = "Corrected";
> +	case HW_EVENT_AER_UNCORRECTED_NON_FATAL:
> +		ev.error_type = "Uncorrected (Non-Fatal)";
>  		break;
> -	case HW_EVENT_ERR_UNCORRECTED:
> -		ev.error_type = "Uncorrected";
> +        case HW_EVENT_AER_UNCORRECTED_FATAL:
> +		ev.error_type = "Uncorrected (Fatal)";
>  		break;
> -	case HW_EVENT_ERR_FATAL:
> -		ev.error_type = "Fatal";
> +        case HW_EVENT_AER_CORRECTED:
> +		ev.error_type = "Corrected";
>  		break;
>  	default:
> -	case HW_EVENT_ERR_INFO:
> -		ev.error_type = "Info";
> +		ev.error_type = "Unknown severity";
>  	}
>  	trace_seq_puts(s, ev.error_type);
>  
> diff --git a/ras-events.h b/ras-events.h
> index e7734b2..1a78390 100644
> --- a/ras-events.h
> +++ b/ras-events.h
> @@ -68,6 +68,13 @@ enum hw_event_mc_err_type {
>  	HW_EVENT_ERR_INFO,
>  };
>  
> +/* Should match the code at Kernel's /drivers/pci/pcie/aer/aerdrv_errprint.c */
> +enum hw_event_aer_err_type {
> +	HW_EVENT_AER_UNCORRECTED_NON_FATAL,
> +	HW_EVENT_AER_UNCORRECTED_FATAL,
> +	HW_EVENT_AER_CORRECTED,
> +};
> +
>  /* Should match the code at Kernel's include/acpi/ghes.h */
>  enum ghes_severity {
>  	GHES_SEV_NO,



Thanks,
Mauro

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [1/2] rasdaemon: fix PCIe AER error type
@ 2018-08-14 16:50 Thomas Tai
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Tai @ 2018-08-14 16:50 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: mchehab, linux-edac

On 08/14/2018 12:15 PM, Mauro Carvalho Chehab wrote:
> Em Mon, 14 May 2018 10:33:47 -0400
> Thomas Tai <thomas.tai@oracle.com> escreveu:
> 
>> The error types between PCIe AER and CPU Machine Check are
>> different. when handling aer_event, the PCIe AER error
>> type should be used. Add an enum to match the kernel
>> PCIe AER and use it to decode the error type.
> 
> Both patches applied, thanks!

Thank you Mauro.

Thomas

> 
>>
>> Signed-off-by: Thomas Tai <thomas.tai@oracle.com>
>> ---
>>   ras-aer-handler.c | 15 +++++++--------
>>   ras-events.h      |  7 +++++++
>>   2 files changed, 14 insertions(+), 8 deletions(-)
>>
>> diff --git a/ras-aer-handler.c b/ras-aer-handler.c
>> index 2093875..65e321d 100644
>> --- a/ras-aer-handler.c
>> +++ b/ras-aer-handler.c
>> @@ -96,18 +96,17 @@ int ras_aer_event_handler(struct trace_seq *s,
>>   	if (pevent_get_field_val(s, event, "severity", record, &val, 1) < 0)
>>   		return -1;
>>   	switch (val) {
>> -	case HW_EVENT_ERR_CORRECTED:
>> -		ev.error_type = "Corrected";
>> +	case HW_EVENT_AER_UNCORRECTED_NON_FATAL:
>> +		ev.error_type = "Uncorrected (Non-Fatal)";
>>   		break;
>> -	case HW_EVENT_ERR_UNCORRECTED:
>> -		ev.error_type = "Uncorrected";
>> +        case HW_EVENT_AER_UNCORRECTED_FATAL:
>> +		ev.error_type = "Uncorrected (Fatal)";
>>   		break;
>> -	case HW_EVENT_ERR_FATAL:
>> -		ev.error_type = "Fatal";
>> +        case HW_EVENT_AER_CORRECTED:
>> +		ev.error_type = "Corrected";
>>   		break;
>>   	default:
>> -	case HW_EVENT_ERR_INFO:
>> -		ev.error_type = "Info";
>> +		ev.error_type = "Unknown severity";
>>   	}
>>   	trace_seq_puts(s, ev.error_type);
>>   
>> diff --git a/ras-events.h b/ras-events.h
>> index e7734b2..1a78390 100644
>> --- a/ras-events.h
>> +++ b/ras-events.h
>> @@ -68,6 +68,13 @@ enum hw_event_mc_err_type {
>>   	HW_EVENT_ERR_INFO,
>>   };
>>   
>> +/* Should match the code at Kernel's /drivers/pci/pcie/aer/aerdrv_errprint.c */
>> +enum hw_event_aer_err_type {
>> +	HW_EVENT_AER_UNCORRECTED_NON_FATAL,
>> +	HW_EVENT_AER_UNCORRECTED_FATAL,
>> +	HW_EVENT_AER_CORRECTED,
>> +};
>> +
>>   /* Should match the code at Kernel's include/acpi/ghes.h */
>>   enum ghes_severity {
>>   	GHES_SEV_NO,
> 
> 
> 
> Thanks,
> Mauro
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [1/2] rasdaemon: fix PCIe AER error type
@ 2018-05-14 14:33 Thomas Tai
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Tai @ 2018-05-14 14:33 UTC (permalink / raw)
  To: mchehab, mchehab, thomas.tai; +Cc: linux-edac

The error types between PCIe AER and CPU Machine Check are
different. when handling aer_event, the PCIe AER error
type should be used. Add an enum to match the kernel
PCIe AER and use it to decode the error type.

Signed-off-by: Thomas Tai <thomas.tai@oracle.com>
---
 ras-aer-handler.c | 15 +++++++--------
 ras-events.h      |  7 +++++++
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/ras-aer-handler.c b/ras-aer-handler.c
index 2093875..65e321d 100644
--- a/ras-aer-handler.c
+++ b/ras-aer-handler.c
@@ -96,18 +96,17 @@ int ras_aer_event_handler(struct trace_seq *s,
 	if (pevent_get_field_val(s, event, "severity", record, &val, 1) < 0)
 		return -1;
 	switch (val) {
-	case HW_EVENT_ERR_CORRECTED:
-		ev.error_type = "Corrected";
+	case HW_EVENT_AER_UNCORRECTED_NON_FATAL:
+		ev.error_type = "Uncorrected (Non-Fatal)";
 		break;
-	case HW_EVENT_ERR_UNCORRECTED:
-		ev.error_type = "Uncorrected";
+        case HW_EVENT_AER_UNCORRECTED_FATAL:
+		ev.error_type = "Uncorrected (Fatal)";
 		break;
-	case HW_EVENT_ERR_FATAL:
-		ev.error_type = "Fatal";
+        case HW_EVENT_AER_CORRECTED:
+		ev.error_type = "Corrected";
 		break;
 	default:
-	case HW_EVENT_ERR_INFO:
-		ev.error_type = "Info";
+		ev.error_type = "Unknown severity";
 	}
 	trace_seq_puts(s, ev.error_type);
 
diff --git a/ras-events.h b/ras-events.h
index e7734b2..1a78390 100644
--- a/ras-events.h
+++ b/ras-events.h
@@ -68,6 +68,13 @@ enum hw_event_mc_err_type {
 	HW_EVENT_ERR_INFO,
 };
 
+/* Should match the code at Kernel's /drivers/pci/pcie/aer/aerdrv_errprint.c */
+enum hw_event_aer_err_type {
+	HW_EVENT_AER_UNCORRECTED_NON_FATAL,
+	HW_EVENT_AER_UNCORRECTED_FATAL,
+	HW_EVENT_AER_CORRECTED,
+};
+
 /* Should match the code at Kernel's include/acpi/ghes.h */
 enum ghes_severity {
 	GHES_SEV_NO,

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-08-14 16:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-14 16:15 [1/2] rasdaemon: fix PCIe AER error type Mauro Carvalho Chehab
  -- strict thread matches above, loose matches on Subject: below --
2018-08-14 16:50 Thomas Tai
2018-05-14 14:33 Thomas Tai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).