回复: [PATCH] ACPI: APEI: move edac_init ahead of ghes platform drv register

From: Justin He
Date: Tue Aug 09 2022 - 05:25:01 EST




> -----邮件原件-----
> 发件人: Borislav Petkov <bp@xxxxxxxxx>
> 发送时间: Tuesday, August 9, 2022 3:41 PM
> 收件人: Kani, Toshi <toshi.kani@xxxxxxx>
> 抄送: Rafael J. Wysocki <rafael@xxxxxxxxxx>; Justin He
> <Justin.He@xxxxxxx>; Len Brown <lenb@xxxxxxxxxx>; James Morse
> <James.Morse@xxxxxxx>; Tony Luck <tony.luck@xxxxxxxxx>; Mauro
> Carvalho Chehab <mchehab@xxxxxxxxxx>; Robert Richter <rric@xxxxxxxxxx>;
> Shuai Xue <xueshuai@xxxxxxxxxxxxxxxxx>; Jarkko Sakkinen
> <jarkko@xxxxxxxxxx>; ACPI Devel Maling List <linux-acpi@xxxxxxxxxxxxxxx>;
> Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>; open
> list:EDAC-CORE <linux-edac@xxxxxxxxxxxxxxx>
> 主题: Re: [PATCH] ACPI: APEI: move edac_init ahead of ghes platform drv
> register
>
> On Mon, Aug 08, 2022 at 09:36:13PM +0000, Kani, Toshi wrote:
> > Platforms with ACPI GHES support should use ghes_edac. This is the
> > case on Arm. The x86 side has additional platform ID check to protect
> > from legacy buggy GHES FW existed before ghes_edac enablement.
>
> Sounds to me like we should put all that logic in ghes.c and out of ghes_edac
> and the EDAC drivers will query it by doing upon load:
>
> <edac_driver>_init:
>
> if (ghes_edac_driver_is_preferred())
> return -ENODEV;
>
Do you mean the similar logic as what Kani Toshi suggested?
e.g.
bool ghes_edac_driver_is_preferred()
{
If (mod_name is "ghes_edac")
return true;

return false;
}
If no, what is the detail logic of ghes_edac_driver_is_preferred()?
Thanks for the clarification 😊
Because I notice that lots of other edac drivers are probing like:
...
owner = edac_get_owner();
if (owner && strncmp(owner, EDAC_MOD_STR, sizeof(EDAC_MOD_STR)))
return -EBUSY;
...

> And then ghes_edac can become a normal driver module again.
>

--
Cheers,
Justin (Jia He)
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.