Re: [PATCH 1/4] RAS: ATL: Read DRAM hole base early

From: Yazen Ghannam
Date: Mon Mar 18 2024 - 11:06:22 EST


On 3/14/24 12:35, John Allen wrote:

Please use "RAS/AMD/ATL:" for the $SUBJECT prefix.

Read DRAM hole base when constructing the address map as the value will
not change during translation.

More specifically, the value will not change during run time.


Signed-off-by: John Allen <john.allen@xxxxxxx>
---
drivers/ras/amd/atl/core.c | 15 ++-------------
drivers/ras/amd/atl/internal.h | 2 ++
drivers/ras/amd/atl/system.c | 21 +++++++++++++++++++++
3 files changed, 25 insertions(+), 13 deletions(-)

diff --git a/drivers/ras/amd/atl/core.c b/drivers/ras/amd/atl/core.c
index 6dc4e06305f7..c1710d233adb 100644
--- a/drivers/ras/amd/atl/core.c
+++ b/drivers/ras/amd/atl/core.c
@@ -51,22 +51,11 @@ static bool legacy_hole_en(struct addr_ctx *ctx)
static int add_legacy_hole(struct addr_ctx *ctx)
{
- u32 dram_hole_base;
- u8 func = 0;
-
if (!legacy_hole_en(ctx))
return 0;
- if (df_cfg.rev >= DF4)
- func = 7;
-
- if (df_indirect_read_broadcast(ctx->node_id, func, 0x104, &dram_hole_base))
- return -EINVAL;
-
- dram_hole_base &= DF_DRAM_HOLE_BASE_MASK;
-
- if (ctx->ret_addr >= dram_hole_base)
- ctx->ret_addr += (BIT_ULL(32) - dram_hole_base);
+ if (ctx->addr >= df_cfg.dram_hole_base)
+ ctx->addr += (BIT_ULL(32) - df_cfg.dram_hole_base);

There is a compilation error here. Please make sure to build each patch
individually.

Thanks,
Yazen