@@ -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)
@@ -320,7 +319,7 @@ static unsigned long convert_dram_to_norm_addr_mi300(unsigned long addr)
320319 * See amd_atl::convert_dram_to_norm_addr_mi300() for MI300 address formats.
321320 */
322321#define MI300_NUM_COL BIT(HWEIGHT(MI300_UMC_MCA_COL))
323- static void retire_row_mi300 (struct atl_err * a_err )
322+ static void _retire_row_mi300 (struct atl_err * a_err )
324323{
325324 unsigned long addr ;
326325 struct page * p ;
@@ -351,6 +350,22 @@ static void retire_row_mi300(struct atl_err *a_err)
351350 }
352351}
353352
353+ /*
354+ * In addition to the column bits, the row[13] bit should also be included when
355+ * calculating addresses affected by a physical row.
356+ *
357+ * Instead of running through another loop over a single bit, just run through
358+ * the column bits twice and flip the row[13] bit in-between.
359+ *
360+ * See MI300_UMC_MCA_ROW for the row bits in MCA_ADDR_UMC value.
361+ */
362+ static void retire_row_mi300 (struct atl_err * a_err )
363+ {
364+ _retire_row_mi300 (a_err );
365+ a_err -> addr ^= MI300_UMC_MCA_ROW13 ;
366+ _retire_row_mi300 (a_err );
367+ }
368+
354369void amd_retire_dram_row (struct atl_err * a_err )
355370{
356371 if (df_cfg .rev == DF4p5 && df_cfg .flags .heterogeneous )
0 commit comments