Skip to content

Commit 58029c3

Browse files
yghannambp3tk0v
authored andcommitted
RAS/AMD/FMPM: Get masked address
Some operations require checking, or ignoring, specific bits in an address value. For example, this can be comparing address values to identify unique structures. Currently, the full address value is compared when filtering for duplicates. This results in over counting and creation of extra records. This gives the impression that more unique events occurred than did in reality. Mask the address for physical rows on MI300. [ bp: Simplify. ] Fixes: 6f15e61 ("RAS: Introduce a FRU memory poison manager") Signed-off-by: Yazen Ghannam <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Cc: [email protected]
1 parent 6c44e53 commit 58029c3

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

drivers/ras/amd/atl/internal.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,4 +362,7 @@ static inline void atl_debug_on_bad_intlv_mode(struct addr_ctx *ctx)
362362
atl_debug(ctx, "Unrecognized interleave mode: %u", ctx->map.intlv_mode);
363363
}
364364

365+
#define MI300_UMC_MCA_COL GENMASK(5, 1)
366+
#define MI300_UMC_MCA_ROW13 BIT(23)
367+
365368
#endif /* __AMD_ATL_INTERNAL_H__ */

drivers/ras/amd/atl/umc.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ int get_umc_info_mi300(void)
229229
* Additionally, the PC and Bank bits may be hashed. This must be accounted for before
230230
* reconstructing the normalized address.
231231
*/
232-
#define MI300_UMC_MCA_COL GENMASK(5, 1)
233232
#define MI300_UMC_MCA_BANK GENMASK(9, 6)
234233
#define MI300_UMC_MCA_ROW GENMASK(24, 10)
235234
#define MI300_UMC_MCA_PC BIT(25)
@@ -360,7 +359,6 @@ static void _retire_row_mi300(struct atl_err *a_err)
360359
*
361360
* See MI300_UMC_MCA_ROW for the row bits in MCA_ADDR_UMC value.
362361
*/
363-
#define MI300_UMC_MCA_ROW13 BIT(23)
364362
static void retire_row_mi300(struct atl_err *a_err)
365363
{
366364
_retire_row_mi300(a_err);

drivers/ras/amd/fmpm.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,13 @@ static bool rec_has_valid_entries(struct fru_rec *rec)
250250
return true;
251251
}
252252

253+
/*
254+
* Row retirement is done on MI300 systems, and some bits are 'don't
255+
* care' for comparing addresses with unique physical rows. This
256+
* includes all column bits and the row[13] bit.
257+
*/
258+
#define MASK_ADDR(addr) ((addr) & ~(MI300_UMC_MCA_ROW13 | MI300_UMC_MCA_COL))
259+
253260
static bool fpds_equal(struct cper_fru_poison_desc *old, struct cper_fru_poison_desc *new)
254261
{
255262
/*
@@ -258,7 +265,7 @@ static bool fpds_equal(struct cper_fru_poison_desc *old, struct cper_fru_poison_
258265
*
259266
* Also, order the checks from most->least likely to fail to shortcut the code.
260267
*/
261-
if (old->addr != new->addr)
268+
if (MASK_ADDR(old->addr) != MASK_ADDR(new->addr))
262269
return false;
263270

264271
if (old->hw_id != new->hw_id)

0 commit comments

Comments
 (0)