2022-08-17 14:44:07

by Justin He

[permalink] [raw]
Subject: [PATCH v2 4/7] EDAC: Get chipset-specific edac drivers selected only when ghes_edac is not enabled

When ghes_edac is loaded, a regular edac driver for the CPU type / platform
still attempts to register itself and fails in its module_init call.

Suggested-by: Toshi Kani <[email protected]>
Suggested-by: Borislav Petkov <[email protected]>
Signed-off-by: Jia He <[email protected]>
---
drivers/edac/amd64_edac.c | 3 +++
drivers/edac/pnd2_edac.c | 3 +++
drivers/edac/sb_edac.c | 3 +++
drivers/edac/skx_base.c | 3 +++
4 files changed, 12 insertions(+)

diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index 2f854feeeb23..e4eaf6668feb 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -4329,6 +4329,9 @@ static int __init amd64_edac_init(void)
int err = -ENODEV;
int i;

+ if (ghes_get_devices(0))
+ return -EBUSY;
+
owner = edac_get_owner();
if (owner && strncmp(owner, EDAC_MOD_STR, sizeof(EDAC_MOD_STR)))
return -EBUSY;
diff --git a/drivers/edac/pnd2_edac.c b/drivers/edac/pnd2_edac.c
index a20b299f1202..73f2ba0e64e3 100644
--- a/drivers/edac/pnd2_edac.c
+++ b/drivers/edac/pnd2_edac.c
@@ -1528,6 +1528,9 @@ static int __init pnd2_init(void)

edac_dbg(2, "\n");

+ if (ghes_get_devices(0))
+ return -EBUSY;
+
owner = edac_get_owner();
if (owner && strncmp(owner, EDAC_MOD_STR, sizeof(EDAC_MOD_STR)))
return -EBUSY;
diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c
index 9678ab97c7ac..1d0520a16840 100644
--- a/drivers/edac/sb_edac.c
+++ b/drivers/edac/sb_edac.c
@@ -3506,6 +3506,9 @@ static int __init sbridge_init(void)

edac_dbg(2, "\n");

+ if (ghes_get_devices(0))
+ return -EBUSY;
+
owner = edac_get_owner();
if (owner && strncmp(owner, EDAC_MOD_STR, sizeof(EDAC_MOD_STR)))
return -EBUSY;
diff --git a/drivers/edac/skx_base.c b/drivers/edac/skx_base.c
index 1abc020d49ab..fe267f8543f5 100644
--- a/drivers/edac/skx_base.c
+++ b/drivers/edac/skx_base.c
@@ -653,6 +653,9 @@ static int __init skx_init(void)

edac_dbg(2, "\n");

+ if (ghes_get_devices(0))
+ return -EBUSY;
+
owner = edac_get_owner();
if (owner && strncmp(owner, EDAC_MOD_STR, sizeof(EDAC_MOD_STR)))
return -EBUSY;
--
2.25.1


2022-08-19 00:05:02

by Kani, Toshimitsu

[permalink] [raw]
Subject: RE: [PATCH v2 4/7] EDAC: Get chipset-specific edac drivers selected only when ghes_edac is not enabled

On Wednesday, August 17, 2022 8:35 AM, Jia He wrote:
> When ghes_edac is loaded, a regular edac driver for the CPU type / platform
> still attempts to register itself and fails in its module_init call.
>
> Suggested-by: Toshi Kani <[email protected]>
> Suggested-by: Borislav Petkov <[email protected]>
> Signed-off-by: Jia He <[email protected]>
> ---
> drivers/edac/amd64_edac.c | 3 +++
> drivers/edac/pnd2_edac.c | 3 +++
> drivers/edac/sb_edac.c | 3 +++
> drivers/edac/skx_base.c | 3 +++
> 4 files changed, 12 insertions(+)

Can you change i10nm_base.c and igen6_edac.c as well?

They are listed in your list below.

On Monday, August 15, 2022 8:20 PM, Justin He wrote:
> I assume that all those edac drivers which used owner checking are
> impacted, right? So the impacted list should be:
> drivers/edac/pnd2_edac.c:1532: if (owner && strncmp(owner,
> EDAC_MOD_STR, sizeof(EDAC_MOD_STR)))
> drivers/edac/sb_edac.c:3513: if (owner && strncmp(owner,
> EDAC_MOD_STR, sizeof(EDAC_MOD_STR)))
> drivers/edac/amd64_edac.c:4333: if (owner && strncmp(owner,
> EDAC_MOD_STR, sizeof(EDAC_MOD_STR)))
> drivers/edac/i10nm_base.c:552: if (owner && strncmp(owner,
> EDAC_MOD_STR, sizeof(EDAC_MOD_STR)))
> drivers/edac/skx_base.c:657: if (owner && strncmp(owner,
> EDAC_MOD_STR, sizeof(EDAC_MOD_STR)))
> drivers/edac/igen6_edac.c:1275: if (owner && strncmp(owner,
> EDAC_MOD_STR, sizeof(EDAC_MOD_STR)))

Thanks,
Toshi

2022-08-19 02:08:36

by Justin He

[permalink] [raw]
Subject: RE: [PATCH v2 4/7] EDAC: Get chipset-specific edac drivers selected only when ghes_edac is not enabled



> -----Original Message-----
> From: Kani, Toshi <[email protected]>
> Sent: Friday, August 19, 2022 7:57 AM
> To: Justin He <[email protected]>; Ard Biesheuvel <[email protected]>; Len
> Brown <[email protected]>; James Morse <[email protected]>; Tony Luck
> <[email protected]>; Borislav Petkov <[email protected]>; Mauro Carvalho
> Chehab <[email protected]>; Robert Richter <[email protected]>; Robert
> Moore <[email protected]>; Qiuxu Zhuo <[email protected]>;
> Yazen Ghannam <[email protected]>
> Cc: [email protected]; [email protected];
> [email protected]; [email protected]; Rafael J . Wysocki
> <[email protected]>; Shuai Xue <[email protected]>; Jarkko
> Sakkinen <[email protected]>; [email protected]; nd <[email protected]>
> Subject: RE: [PATCH v2 4/7] EDAC: Get chipset-specific edac drivers selected
> only when ghes_edac is not enabled
>
> On Wednesday, August 17, 2022 8:35 AM, Jia He wrote:
> > When ghes_edac is loaded, a regular edac driver for the CPU type /
> > platform still attempts to register itself and fails in its module_init call.
> >
> > Suggested-by: Toshi Kani <[email protected]>
> > Suggested-by: Borislav Petkov <[email protected]>
> > Signed-off-by: Jia He <[email protected]>
> > ---
> > drivers/edac/amd64_edac.c | 3 +++
> > drivers/edac/pnd2_edac.c | 3 +++
> > drivers/edac/sb_edac.c | 3 +++
> > drivers/edac/skx_base.c | 3 +++
> > 4 files changed, 12 insertions(+)
>
> Can you change i10nm_base.c and igen6_edac.c as well?
>
> They are listed in your list below.
>
Okay, will do. And will also include the ARM specific edac drivers just as
Borislav mentioned.


--
Cheers,
Justin (Jia He)