lkml.org 
[lkml]   [2021]   [Oct]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v3 31/33] EDAC/amd64: Add check for when to add DRAM base and hole
Date
Some DF versions and interleaving modes require the DRAM base address
and hole adjustments to be done before accounting for hashing. Others
require this to be done after.

Add a check for this behavior. Save a boolean in the ctx struct which
can be appropriately set based on DF version or interleaving mode.

Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
---
v2->v3:
* New in v3.

drivers/edac/amd64_edac.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index 5dacd7e03202..07009901a283 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -1092,6 +1092,7 @@ struct addr_ctx {
u8 intlv_num_sockets;
u8 cs_id;
u8 node_id_shift;
+ bool late_hole_remove;
int (*dehash_addr)(struct addr_ctx *ctx);
void (*make_space_for_cs_id)(struct addr_ctx *ctx);
void (*insert_cs_id)(struct addr_ctx *ctx);
@@ -1638,12 +1639,15 @@ static int umc_normaddr_to_sysaddr(u64 *addr, u16 nid, u8 df_inst_id)
if (denormalize_addr(&ctx))
return -EINVAL;

- if (add_base_and_hole(&ctx))
+ if (!ctx.late_hole_remove && add_base_and_hole(&ctx))
return -EINVAL;

if (ctx.dehash_addr && ctx.dehash_addr(&ctx))
return -EINVAL;

+ if (ctx.late_hole_remove && add_base_and_hole(&ctx))
+ return -EINVAL;
+
if (addr_over_limit(&ctx))
return -EINVAL;

--
2.25.1
\
 
 \ /
  Last update: 2021-10-28 20:00    [W:0.199 / U:0.464 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site