[PATCH v9 1/7] RAS/AMD/ATL: Always build PRM address translation support
Yazen Ghannam <[email protected]> Thu, 30 Jul 2026 15:48:28 -0400
| Newsgroups | org.kernel.vger.linux-edac,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
PRM (Platform Runtime Mechanism) is the only address translation method for current and future AMD systems. The library should therefore always include it. The PRM helpers in <linux/prmt.h> already provide stubs that return an error when CONFIG_ACPI_PRMT is disabled. This lets prm.c build and link in all configurations. The library then falls back to native translation at runtime when no PRM handler is available. Drop the CONFIG_AMD_ATL_PRM option. Build prm.o unconditionally and remove the now-unneeded stub for prm_umc_norm_to_sys_addr(). Add -EOPNOTSUPP as "PRM not available". The acpi_call_prm_handler() stub returns this when CONFIG_ACPI_PRMT=n. Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Yazen Ghannam <[email protected]> --- drivers/ras/amd/atl/Kconfig | 4 ---- drivers/ras/amd/atl/Makefile | 3 +-- drivers/ras/amd/atl/internal.h | 8 -------- drivers/ras/amd/atl/prm.c | 2 +- 4 files changed, 2 insertions(+), 15 deletions(-) diff --git a/drivers/ras/amd/atl/Kconfig b/drivers/ras/amd/atl/Kconfig index 44c2fd7febc5..29befaf2a1e2 100644 --- a/drivers/ras/amd/atl/Kconfig +++ b/drivers/ras/amd/atl/Kconfig @@ -19,7 +19,3 @@ config AMD_ATL Enable this option if using DRAM ECC on Zen-based systems and OS-based error handling. - -config AMD_ATL_PRM - depends on AMD_ATL && ACPI_PRMT - def_bool y diff --git a/drivers/ras/amd/atl/Makefile b/drivers/ras/amd/atl/Makefile index b56892c0c0d9..ff52452b678f 100644 --- a/drivers/ras/amd/atl/Makefile +++ b/drivers/ras/amd/atl/Makefile @@ -12,9 +12,8 @@ amd_atl-y += core.o amd_atl-y += dehash.o amd_atl-y += denormalize.o amd_atl-y += map.o +amd_atl-y += prm.o amd_atl-y += system.o amd_atl-y += umc.o -amd_atl-$(CONFIG_AMD_ATL_PRM) += prm.o - obj-$(CONFIG_AMD_ATL) += amd_atl.o diff --git a/drivers/ras/amd/atl/internal.h b/drivers/ras/amd/atl/internal.h index 82a56d9c2be1..4fc4bc3c3500 100644 --- a/drivers/ras/amd/atl/internal.h +++ b/drivers/ras/amd/atl/internal.h @@ -287,15 +287,7 @@ u64 remove_base_and_hole(struct addr_ctx *ctx, u64 addr); /* GUIDs for PRM handlers */ extern const guid_t norm_to_sys_guid; -#ifdef CONFIG_AMD_ATL_PRM unsigned long prm_umc_norm_to_sys_addr(u8 socket_id, u64 umc_bank_inst_id, unsigned long addr); -#else -static inline unsigned long prm_umc_norm_to_sys_addr(u8 socket_id, u64 umc_bank_inst_id, - unsigned long addr) -{ - return -ENODEV; -} -#endif /* * Make a gap in @data that is @num_bits long starting at @bit_num. diff --git a/drivers/ras/amd/atl/prm.c b/drivers/ras/amd/atl/prm.c index 0f9bfa96e16a..eba9d104d09e 100644 --- a/drivers/ras/amd/atl/prm.c +++ b/drivers/ras/amd/atl/prm.c @@ -44,7 +44,7 @@ unsigned long prm_umc_norm_to_sys_addr(u8 socket_id, u64 bank_id, unsigned long if (!ret) return ret_addr; - if (ret == -ENODEV) + if (ret == -ENODEV || ret == -EOPNOTSUPP) pr_debug("PRM module/handler not available\n"); else pr_notice_once("PRM address translation failed\n"); -- 2.53.0