Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1722438 > unrolled thread

Re: [PATCH v2] ACPI / APEI: Suppress message if HEST not present

Started byBorislav Petkov <bp@suse.de>
First post2017-08-29 14:40 +0200
Last post2017-08-29 15:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v2] ACPI / APEI: Suppress message if HEST not present Borislav Petkov <bp@suse.de> - 2017-08-29 14:40 +0200
    Re: [PATCH v2] ACPI / APEI: Suppress message if HEST not present Punit Agrawal <punit.agrawal@arm.com> - 2017-08-29 15:20 +0200

#1722438 — Re: [PATCH v2] ACPI / APEI: Suppress message if HEST not present

FromBorislav Petkov <bp@suse.de>
Date2017-08-29 14:40 +0200
SubjectRe: [PATCH v2] ACPI / APEI: Suppress message if HEST not present
Message-ID<ujNYd-2CF-11@gated-at.bofh.it>
On Wed, Aug 16, 2017 at 12:27:53PM +0100, Punit Agrawal wrote:
> According to the ACPI specification, firmware is not required to provide
> the Hardware Error Source Table (HEST). When HEST is not present, the
> following superfluous message is printed to the kernel boot log -
> 
> [    3.460067] GHES: HEST is not enabled!
> 
> Extend hest_disable variable to track whether the firmware provides this
> table and if it is not present skip any log output. The existing
> behaviour is preserved in all other cases.
> 
> Suggested-by: Borislav Petkov <bp@suse.de>
> Signed-off-by: Punit Agrawal <punit.agrawal@arm.com>
> Cc: Borislav Petkov <bp@suse.de>
> Cc: James Morse <james.morse@arm.com>
> ---
>  drivers/acpi/apei/ghes.c |  4 ++--
>  drivers/acpi/apei/hest.c | 13 +++++++------
>  include/acpi/apei.h      |  8 +++++++-
>  3 files changed, 16 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
> index d661d452b238..f8685bcbeff2 100644
> --- a/drivers/acpi/apei/ghes.c
> +++ b/drivers/acpi/apei/ghes.c
> @@ -1262,10 +1262,10 @@ static int __init ghes_init(void)
>  {
>  	int rc;
>  
> -	if (acpi_disabled)
> +	if (acpi_disabled || hest_disable == HEST_NOT_FOUND)
>  		return -ENODEV;
>  
> -	if (hest_disable) {
> +	if (hest_disable == HEST_DISABLED) {
>  		pr_info(GHES_PFX "HEST is not enabled!\n");
>  		return -EINVAL;
>  	}

Yap, looks good.

Just a minor nitpick: I'd additionally group the hest_disable checking
in one switch-case, so that the code flow is obvious at a quick glance:

        if (acpi_disabled)
                return -ENODEV;

        switch (hest_disable) {
        case HEST_NOT_FOUND:
                return -ENODEV;
        case HEST_DISABLED:
                pr_info(GHES_PFX "HEST is not enabled!\n");
                return -EINVAL;
        default:
                break;
        }

Thx.

-- 
Regards/Gruss,
    Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
-- 

[toc] | [next] | [standalone]


#1722463

FromPunit Agrawal <punit.agrawal@arm.com>
Date2017-08-29 15:20 +0200
Message-ID<ujOAW-37c-9@gated-at.bofh.it>
In reply to#1722438
Borislav Petkov <bp@suse.de> writes:

> On Wed, Aug 16, 2017 at 12:27:53PM +0100, Punit Agrawal wrote:
>> According to the ACPI specification, firmware is not required to provide
>> the Hardware Error Source Table (HEST). When HEST is not present, the
>> following superfluous message is printed to the kernel boot log -
>> 
>> [    3.460067] GHES: HEST is not enabled!
>> 
>> Extend hest_disable variable to track whether the firmware provides this
>> table and if it is not present skip any log output. The existing
>> behaviour is preserved in all other cases.
>> 
>> Suggested-by: Borislav Petkov <bp@suse.de>
>> Signed-off-by: Punit Agrawal <punit.agrawal@arm.com>
>> Cc: Borislav Petkov <bp@suse.de>
>> Cc: James Morse <james.morse@arm.com>
>> ---
>>  drivers/acpi/apei/ghes.c |  4 ++--
>>  drivers/acpi/apei/hest.c | 13 +++++++------
>>  include/acpi/apei.h      |  8 +++++++-
>>  3 files changed, 16 insertions(+), 9 deletions(-)
>> 
>> diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
>> index d661d452b238..f8685bcbeff2 100644
>> --- a/drivers/acpi/apei/ghes.c
>> +++ b/drivers/acpi/apei/ghes.c
>> @@ -1262,10 +1262,10 @@ static int __init ghes_init(void)
>>  {
>>  	int rc;
>>  
>> -	if (acpi_disabled)
>> +	if (acpi_disabled || hest_disable == HEST_NOT_FOUND)
>>  		return -ENODEV;
>>  
>> -	if (hest_disable) {
>> +	if (hest_disable == HEST_DISABLED) {
>>  		pr_info(GHES_PFX "HEST is not enabled!\n");
>>  		return -EINVAL;
>>  	}
>
> Yap, looks good.
>
> Just a minor nitpick: I'd additionally group the hest_disable checking
> in one switch-case, so that the code flow is obvious at a quick glance:
>
>         if (acpi_disabled)
>                 return -ENODEV;
>
>         switch (hest_disable) {
>         case HEST_NOT_FOUND:
>                 return -ENODEV;
>         case HEST_DISABLED:
>                 pr_info(GHES_PFX "HEST is not enabled!\n");
>                 return -EINVAL;
>         default:
>                 break;
>         }

I've picked this change and will send out an update shortly.

Thanks,
Punit

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web