[PATCH v8 1/7] RAS/AMD/ATL: Always build PRM address translation support

From: Yazen Ghannam

Date: Mon Jul 27 2026 - 17:21:15 EST


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().

Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Yazen Ghannam <yazen.ghannam@xxxxxxx>
---
drivers/ras/amd/atl/Kconfig | 4 ----
drivers/ras/amd/atl/Makefile | 3 +--
drivers/ras/amd/atl/internal.h | 8 --------
3 files changed, 1 insertion(+), 14 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.
--
2.53.0