Commit 7adcadb9 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'edac_updates_for_6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras

Pull EDAC updates from Borislav Petkov:

 - Make ghes_edac a simple module like the rest of the EDAC drivers and
   drop the forced built-in only configuration by disentangling it from
   GHES (Jia He)

 - The usual small cleanups and improvements all over EDAC land

* tag 'edac_updates_for_6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras:
  EDAC/i10nm: fix refcount leak in pci_get_dev_wrapper()
  EDAC/i5400: Fix typo in comment: vaious -> various
  EDAC/mc_sysfs: Increase legacy channel support to 12
  MAINTAINERS: Make Mauro EDAC reviewer
  MAINTAINERS: Make Manivannan Sadhasivam the maintainer of qcom_edac
  EDAC/igen6: Return the correct error type when not the MC owner
  apei/ghes: Use xchg_release() for updating new cache slot instead of cmpxchg()
  EDAC: Check for GHES preference in the chipset-specific EDAC drivers
  EDAC/ghes: Make ghes_edac a proper module
  EDAC/ghes: Prepare to make ghes_edac a proper module
  EDAC/ghes: Add a notifier for reporting memory errors
  efi/cper: Export several helpers for ghes_edac to use
  EDAC/i5000: Mark as BROKEN
parents 40deb5e4 3919430f
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -7386,9 +7386,9 @@ F: drivers/edac/thunderx_edac*
EDAC-CORE
M:	Borislav Petkov <bp@alien8.de>
M:	Mauro Carvalho Chehab <mchehab@kernel.org>
M:	Tony Luck <tony.luck@intel.com>
R:	James Morse <james.morse@arm.com>
R:	Mauro Carvalho Chehab <mchehab@kernel.org>
R:	Robert Richter <rric@kernel.org>
L:	linux-edac@vger.kernel.org
S:	Supported
@@ -7505,8 +7505,7 @@ S: Maintained
F:	drivers/edac/pnd2_edac.[ch]
EDAC-QCOM
M:	Channagoud Kadabi <ckadabi@codeaurora.org>
M:	Venkata Narendra Kumar Gutta <vnkgutta@codeaurora.org>
M:	Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
L:	linux-arm-msm@vger.kernel.org
L:	linux-edac@vger.kernel.org
S:	Maintained
+63 −3
Original line number Diff line number Diff line
@@ -94,6 +94,8 @@
#define FIX_APEI_GHES_SDEI_CRITICAL	__end_of_fixed_addresses
#endif

static ATOMIC_NOTIFIER_HEAD(ghes_report_chain);

static inline bool is_hest_type_generic_v2(struct ghes *ghes)
{
	return ghes->generic->header.type == ACPI_HEST_TYPE_GENERIC_ERROR_V2;
@@ -107,6 +109,13 @@ static inline bool is_hest_type_generic_v2(struct ghes *ghes)
bool ghes_disable;
module_param_named(disable, ghes_disable, bool, 0);

/*
 * "ghes.edac_force_enable" forcibly enables ghes_edac and skips the platform
 * check.
 */
static bool ghes_edac_force_enable;
module_param_named(edac_force_enable, ghes_edac_force_enable, bool, 0);

/*
 * All error sources notified with HED (Hardware Error Device) share a
 * single notifier callback, so they need to be linked and checked one
@@ -118,6 +127,13 @@ module_param_named(disable, ghes_disable, bool, 0);
static LIST_HEAD(ghes_hed);
static DEFINE_MUTEX(ghes_list_mutex);

/*
 * A list of GHES devices which are given to the corresponding EDAC driver
 * ghes_edac for further use.
 */
static LIST_HEAD(ghes_devs);
static DEFINE_MUTEX(ghes_devs_mutex);

/*
 * Because the memory area used to transfer hardware error information
 * from BIOS to Linux can be determined only in NMI, IRQ or timer
@@ -645,7 +661,7 @@ static bool ghes_do_proc(struct ghes *ghes,
		if (guid_equal(sec_type, &CPER_SEC_PLATFORM_MEM)) {
			struct cper_sec_mem_err *mem_err = acpi_hest_get_payload(gdata);

			ghes_edac_report_mem_error(sev, mem_err);
			atomic_notifier_call_chain(&ghes_report_chain, sev, mem_err);

			arch_apei_report_mem_error(sev, mem_err);
			queued = ghes_handle_memory_failure(gdata, sev);
@@ -1382,7 +1398,11 @@ static int ghes_probe(struct platform_device *ghes_dev)

	platform_set_drvdata(ghes_dev, ghes);

	ghes_edac_register(ghes, &ghes_dev->dev);
	ghes->dev = &ghes_dev->dev;

	mutex_lock(&ghes_devs_mutex);
	list_add_tail(&ghes->elist, &ghes_devs);
	mutex_unlock(&ghes_devs_mutex);

	/* Handle any pending errors right away */
	spin_lock_irqsave(&ghes_notify_lock_irq, flags);
@@ -1446,7 +1466,9 @@ static int ghes_remove(struct platform_device *ghes_dev)

	ghes_fini(ghes);

	ghes_edac_unregister(ghes);
	mutex_lock(&ghes_devs_mutex);
	list_del(&ghes->elist);
	mutex_unlock(&ghes_devs_mutex);

	kfree(ghes);

@@ -1501,3 +1523,41 @@ void __init acpi_ghes_init(void)
	else
		pr_info(GHES_PFX "Failed to enable APEI firmware first mode.\n");
}

/*
 * Known x86 systems that prefer GHES error reporting:
 */
static struct acpi_platform_list plat_list[] = {
	{"HPE   ", "Server  ", 0, ACPI_SIG_FADT, all_versions},
	{ } /* End */
};

struct list_head *ghes_get_devices(void)
{
	int idx = -1;

	if (IS_ENABLED(CONFIG_X86)) {
		idx = acpi_match_platform_list(plat_list);
		if (idx < 0) {
			if (!ghes_edac_force_enable)
				return NULL;

			pr_warn_once("Force-loading ghes_edac on an unsupported platform. You're on your own!\n");
		}
	}

	return &ghes_devs;
}
EXPORT_SYMBOL_GPL(ghes_get_devices);

void ghes_register_report_chain(struct notifier_block *nb)
{
	atomic_notifier_chain_register(&ghes_report_chain, nb);
}
EXPORT_SYMBOL_GPL(ghes_register_report_chain);

void ghes_unregister_report_chain(struct notifier_block *nb)
{
	atomic_notifier_chain_unregister(&ghes_report_chain, nb);
}
EXPORT_SYMBOL_GPL(ghes_unregister_report_chain);
+3 −2
Original line number Diff line number Diff line
@@ -53,8 +53,8 @@ config EDAC_DECODE_MCE
	  has been initialized.

config EDAC_GHES
	bool "Output ACPI APEI/GHES BIOS detected errors via EDAC"
	depends on ACPI_APEI_GHES && (EDAC=y)
	tristate "Output ACPI APEI/GHES BIOS detected errors via EDAC"
	depends on ACPI_APEI_GHES
	select UEFI_CPER
	help
	  Not all machines support hardware-driven error report. Some of those
@@ -211,6 +211,7 @@ config EDAC_R82600
config EDAC_I5000
	tristate "Intel Greencreek/Blackford chipset"
	depends on X86 && PCI
	depends on BROKEN
	help
	  Support for error detection and correction the Intel
	  Greekcreek/Blackford chipsets.
+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;

Loading