linux-edac.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Toshi Kani <toshi.kani@hpe.com>
To: "tony.luck@intel.com" <tony.luck@intel.com>,
	"bp@alien8.de" <bp@alien8.de>
Cc: "alex_gagniuc@dellteam.com" <alex_gagniuc@dellteam.com>,
	"austin_bolen@dell.com" <austin_bolen@dell.com>,
	"james.morse@arm.com" <james.morse@arm.com>,
	"linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>
Subject: EDAC, ghes: Do not register instance if platform is not whitelisted
Date: Mon, 23 Apr 2018 20:13:23 +0000	[thread overview]
Message-ID: <1524514357.2693.440.camel@hpe.com> (raw)

On Mon, 2018-04-23 at 14:27 +0200, Borislav Petkov wrote:
> Lemme write an official patch:
> 
> ---
> Tony reported seeing
> 
>   "Internal error: Can't find EDAC structure"
> 
> when injecting correctable errors.
> 
> The problem is that we should exit registration when platform doesn't
> match the whitelisted ones.
> 
> Do that.
> 
> Reviewed-by: Tony Luck <tony.luck@intel.com>
> Signed-off-by: Borislav Petkov <bp@suse.de>
> Cc: Toshi Kani <toshi.kani@hpe.com>
> Fixes: 5deed6b6a479 ("EDAC, ghes: Add platform check")
> Link: https://lkml.kernel.org/r/20180420182015.zao3olss4tvvlxki@agluck-desk
> ---
>  drivers/edac/ghes_edac.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/edac/ghes_edac.c b/drivers/edac/ghes_edac.c
> index 68b6ee18bea6..4a9231993699 100644
> --- a/drivers/edac/ghes_edac.c
> +++ b/drivers/edac/ghes_edac.c
> @@ -439,7 +439,7 @@ int ghes_edac_register(struct ghes *ghes, struct device *dev)
>  	/* Check if safe to enable on this system */
>  	idx = acpi_match_platform_list(plat_list);
>  	if (!force_load && idx < 0)
> -		return 0;
> +		return -ENODEV;
>  

Umm..., I do not think this change is correct.  This causes an error to
ghes_probe(), which disables GHES itself.  ghes and ghes_edac are
separate modules.  That is, ghes_edac works on top of ghes as an
optional module.

I think the right fix is to simply remove the error message.  This will
make it consistent with the case of CONFIG_EDAC_GHES disabled.  Please
see include/acpi/ghes.h.

Thanks,
-Toshi

             reply	other threads:[~2018-04-23 20:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-23 20:13 Toshi Kani [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-04-27 20:54 EDAC, ghes: Do not register instance if platform is not whitelisted Toshi Kani
2018-04-27 11:43 Borislav Petkov
2018-04-23 20:35 Toshi Kani
2018-04-23 20:28 Borislav Petkov
2018-04-23 12:27 Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1524514357.2693.440.camel@hpe.com \
    --to=toshi.kani@hpe.com \
    --cc=alex_gagniuc@dellteam.com \
    --cc=austin_bolen@dell.com \
    --cc=bp@alien8.de \
    --cc=james.morse@arm.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=tony.luck@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).