[PATCH v2] RAS/AMD/ATL, EDAC/amd64: Only load ATL when needed

Mario Limonciello <[email protected]> Mon, 6 Jul 2026 16:21:15 -0500
Newsgroups org.kernel.vger.linux-edac
Message-ID <[email protected]>
From: Yazen Ghannam <[email protected]>

The AMD Address Translation Library (ATL) will attempt to load on all
AMD Zen/SMCA systems.

However, only systems with DRAM ECC enabled will use the library. Other
systems will fail to load the library and produce an unnecessary message
to the user.

Remove the ATL module dependency table to prevent autoloading. Request
ATL to load from EDAC once all system checks are complete.

Fixes: 3f3174996be6 ("RAS: Introduce AMD Address Translation Library")
Reported-by: Mario Limonciello <[email protected]>
Closes: https://lore.kernel.org/[email protected]
Signed-off-by: Yazen Ghannam <[email protected]>
Tested-by: Deskhmukh Shrirang <[email protected]>
Link: https://lore.kernel.org/all/[email protected]/
Signed-off-by: Mario Limonciello <[email protected]>
---
v2:
 * use request_module_nowait() (Boris)
---
 drivers/edac/amd64_edac.c  | 2 ++
 drivers/ras/amd/atl/core.c | 1 -
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index c6aa69dbd9fb1..475235c402e88 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -4173,6 +4173,8 @@ static int __init amd64_edac_init(void)
 		goto err_pci;
 	}
 
+	request_module_nowait("amd_atl");
+
 	/* register stuff with EDAC MCE */
 	if (boot_cpu_data.x86 >= 0x17) {
 		amd_register_ecc_decoder(decode_umc_error);
diff --git a/drivers/ras/amd/atl/core.c b/drivers/ras/amd/atl/core.c
index 0f7cd6dab0b0e..d77dacdd4f569 100644
--- a/drivers/ras/amd/atl/core.c
+++ b/drivers/ras/amd/atl/core.c
@@ -190,7 +190,6 @@ static const struct x86_cpu_id amd_atl_cpuids[] = {
 	X86_MATCH_FEATURE(X86_FEATURE_ZEN, NULL),
 	{ }
 };
-MODULE_DEVICE_TABLE(x86cpu, amd_atl_cpuids);
 
 static int __init amd_atl_init(void)
 {
-- 
2.43.0