Messages in this thread Patch in this message | | | From | Yazen Ghannam <> | Subject | [PATCH v2 1/2] EDAC/amd64: Check register values from all UMCs | Date | Wed, 15 Dec 2021 15:53:08 +0000 |
| |
The initial support for Unified Memory Controllers (UMCs) was added to AMD64 EDAC for the first generation of Zen systems. These systems have two UMCs per Die, and the code originally assumed two UMCs in various places.
Later systems have more than two UMCs, and this assumption was fixed in the following commits.
commit bdcee7747f5c ("EDAC/amd64: Support more than two Unified Memory Controllers") commit d971e28e2ce4 ("EDAC/amd64: Support more than two controllers for chip selects handling")
However, the determine_memory_type() function was missed in these changes, and two UMCs are still assumed.
Update determine_memory_type() to account for all UMCs when checking the register values.
Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com> --- Link: https://lkml.kernel.org/r/20211208174356.1997855-4-yazen.ghannam@amd.com
v1->v2: * Was patch 3 in v1. * Update commit message.
drivers/edac/amd64_edac.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c index ff29267e46a6..1df763128483 100644 --- a/drivers/edac/amd64_edac.c +++ b/drivers/edac/amd64_edac.c @@ -1621,9 +1621,16 @@ static void determine_memory_type(struct amd64_pvt *pvt) u32 dram_ctrl, dcsm; if (pvt->umc) { - if ((pvt->umc[0].dimm_cfg | pvt->umc[1].dimm_cfg) & BIT(5)) + u32 umc_cfg = 0, dimm_cfg = 0, i = 0; + + for_each_umc(i) { + umc_cfg |= pvt->umc[i].umc_cfg; + dimm_cfg |= pvt->umc[i].dimm_cfg; + } + + if (dimm_cfg & BIT(5)) pvt->dram_type = MEM_LRDDR4; - else if ((pvt->umc[0].dimm_cfg | pvt->umc[1].dimm_cfg) & BIT(4)) + else if (dimm_cfg & BIT(4)) pvt->dram_type = MEM_RDDR4; else pvt->dram_type = MEM_DDR4; -- 2.25.1
| |