Commit 315bada6 authored by Jia He's avatar Jia He Committed by Borislav Petkov
Browse files

EDAC: Check for GHES preference in the chipset-specific EDAC drivers



Call ghes_get_devices() to check whether ghes_edac should be used on the
platform where it is preferred over the corresponding chipset-specific
EDAC driver.

Unlike the existing edac_get_owner() check, the ghes_get_devices() check
works independent to the module_init ordering.

  [ bp: Massage. ]

Suggested-by: default avatarToshi Kani <toshi.kani@hpe.com>
Signed-off-by: default avatarJia He <justin.he@arm.com>
Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
Link: https://lore.kernel.org/r/20221010023559.69655-6-justin.he@arm.com
parent 802e7f1d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -4329,6 +4329,9 @@ static int __init amd64_edac_init(void)
	int err = -ENODEV;
	int i;

	if (ghes_get_devices())
		return -EBUSY;

	owner = edac_get_owner();
	if (owner && strncmp(owner, EDAC_MOD_STR, sizeof(EDAC_MOD_STR)))
		return -EBUSY;
+3 −0
Original line number Diff line number Diff line
@@ -599,6 +599,9 @@ static int __init armada_xp_edac_init(void)
{
	int res;

	if (ghes_get_devices())
		return -EBUSY;

	/* only polling is supported */
	edac_op_state = EDAC_OPSTATE_POLL;

+1 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@
#ifndef	__EDAC_MODULE_H__
#define	__EDAC_MODULE_H__

#include <acpi/ghes.h>
#include "edac_mc.h"
#include "edac_pci.h"
#include "edac_device.h"
+3 −0
Original line number Diff line number Diff line
@@ -756,6 +756,9 @@ static int __init i10nm_init(void)

	edac_dbg(2, "\n");

	if (ghes_get_devices())
		return -EBUSY;

	owner = edac_get_owner();
	if (owner && strncmp(owner, EDAC_MOD_STR, sizeof(EDAC_MOD_STR)))
		return -EBUSY;
+3 −0
Original line number Diff line number Diff line
@@ -1271,6 +1271,9 @@ static int __init igen6_init(void)

	edac_dbg(2, "\n");

	if (ghes_get_devices())
		return -EBUSY;

	owner = edac_get_owner();
	if (owner && strncmp(owner, EDAC_MOD_STR, sizeof(EDAC_MOD_STR)))
		return -ENODEV;
Loading