Skip to content

Commit 6c44e53

Browse files
yghannambp3tk0v
authored andcommitted
RAS/AMD/ATL: Include row[13] bit in row retirement
Based on feedback from hardware folks, row[13] is part of the variable bits within a physical row (along with all column bits). Only half the physical addresses affected by a row are calculated if this bit is not included. Add the row[13] bit to the row retirement flow. Fixes: 3b566b3 ("RAS/AMD/ATL: Add MI300 row retirement support") Signed-off-by: Yazen Ghannam <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected]
1 parent 0af2f6b commit 6c44e53

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

drivers/ras/amd/atl/umc.c

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ static unsigned long convert_dram_to_norm_addr_mi300(unsigned long addr)
320320
* See amd_atl::convert_dram_to_norm_addr_mi300() for MI300 address formats.
321321
*/
322322
#define MI300_NUM_COL BIT(HWEIGHT(MI300_UMC_MCA_COL))
323-
static void retire_row_mi300(struct atl_err *a_err)
323+
static void _retire_row_mi300(struct atl_err *a_err)
324324
{
325325
unsigned long addr;
326326
struct page *p;
@@ -351,6 +351,23 @@ static void retire_row_mi300(struct atl_err *a_err)
351351
}
352352
}
353353

354+
/*
355+
* In addition to the column bits, the row[13] bit should also be included when
356+
* calculating addresses affected by a physical row.
357+
*
358+
* Instead of running through another loop over a single bit, just run through
359+
* the column bits twice and flip the row[13] bit in-between.
360+
*
361+
* See MI300_UMC_MCA_ROW for the row bits in MCA_ADDR_UMC value.
362+
*/
363+
#define MI300_UMC_MCA_ROW13 BIT(23)
364+
static void retire_row_mi300(struct atl_err *a_err)
365+
{
366+
_retire_row_mi300(a_err);
367+
a_err->addr ^= MI300_UMC_MCA_ROW13;
368+
_retire_row_mi300(a_err);
369+
}
370+
354371
void amd_retire_dram_row(struct atl_err *a_err)
355372
{
356373
if (df_cfg.rev == DF4p5 && df_cfg.flags.heterogeneous)

0 commit comments

Comments
 (0)