From: Yazen Ghannam <yazen.ghannam@amd.com>
To: <bp@alien8.de>, <linux-edac@vger.kernel.org>
Cc: <linux-kernel@vger.kernel.org>,
Avadhut Naik <avanaik92@gmail.com>,
"Yazen Ghannam" <yazen.ghannam@amd.com>
Subject: [PATCH v9 1/7] RAS/AMD/ATL: Always build PRM address translation support
Date: Thu, 30 Jul 2026 15:48:28 -0400 [thread overview]
Message-ID: <20260730194834.3203601-2-yazen.ghannam@amd.com> (raw)
In-Reply-To: <20260730194834.3203601-1-yazen.ghannam@amd.com>
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 <yazen.ghannam@amd.com>
---
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
next prev parent reply other threads:[~2026-07-30 19:48 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-30 19:48 [PATCH v9 0/7] Incorporate DRAM address in EDAC messages Yazen Ghannam
2026-07-30 19:48 ` Yazen Ghannam [this message]
2026-07-31 23:55 ` [PATCH v9 1/7] RAS/AMD/ATL: Always build PRM address translation support Borislav Petkov
2026-08-03 15:24 ` Yazen Ghannam
2026-08-05 4:51 ` Borislav Petkov
2026-07-30 19:48 ` [PATCH v9 2/7] RAS/AMD/ATL: Refactor PRM address translation into a common helper Yazen Ghannam
2026-08-05 5:19 ` Borislav Petkov
2026-08-05 13:52 ` Yazen Ghannam
2026-07-30 19:48 ` [PATCH v9 3/7] RAS/AMD/ATL: Add unified UMC address translation interface Yazen Ghannam
2026-07-30 19:48 ` [PATCH v9 4/7] RAS/AMD, EDAC/amd64: Use unified interface for SPA translation Yazen Ghannam
2026-07-30 19:48 ` [PATCH v9 5/7] RAS/AMD/ATL: Remove the standalone SPA translation interface Yazen Ghannam
2026-07-30 19:48 ` [PATCH v9 6/7] RAS/AMD/ATL: Add DRAM address translation via PRM Yazen Ghannam
2026-07-30 19:48 ` [PATCH v9 7/7] EDAC/amd64: Include DRAM address in output Yazen Ghannam
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260730194834.3203601-2-yazen.ghannam@amd.com \
--to=yazen.ghannam@amd.com \
--cc=avanaik92@gmail.com \
--cc=bp@alien8.de \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox