Skip to content

Commit 3667179

Browse files
committed
RAS/AMD/ATL: Fix MI300 bank hash
JIRA: https://issues.redhat.com/browse/RHEL-38634 Tested: by AMD commit fe8a089 Author: Yazen Ghannam <yazen.ghannam@amd.com> Date: Fri Jun 7 16:32:59 2024 -0500 RAS/AMD/ATL: Fix MI300 bank hash Apply the SID bits to the correct offset in the Bank value. Do this in the temporary value so they don't need to be masked off later. Fixes: 87a6123 ("RAS/AMD/ATL: Add MI300 DRAM to normalized address translation support") Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Cc: <stable@kernel.org> Link: https://lore.kernel.org/r/20240607-mi300-dram-xl-fix-v1-1-2f11547a178c@amd.com Signed-off-by: Aristeu Rozanski <arozansk@redhat.com>
1 parent 792d77b commit 3667179

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

drivers/ras/amd/atl/umc.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -189,16 +189,11 @@ static unsigned long convert_dram_to_norm_addr_mi300(unsigned long addr)
189189

190190
/* Calculate hash for PC bit. */
191191
if (addr_hash.pc.xor_enable) {
192-
/* Bits SID[1:0] act as Bank[6:5] for PC hash, so apply them here. */
193-
bank |= sid << 5;
194-
195192
temp = bitwise_xor_bits(col & addr_hash.pc.col_xor);
196193
temp ^= bitwise_xor_bits(row & addr_hash.pc.row_xor);
197-
temp ^= bitwise_xor_bits(bank & addr_hash.bank_xor);
194+
/* Bits SID[1:0] act as Bank[5:4] for PC hash, so apply them here. */
195+
temp ^= bitwise_xor_bits((bank | sid << NUM_BANK_BITS) & addr_hash.bank_xor);
198196
pc ^= temp;
199-
200-
/* Drop SID bits for the sake of debug printing later. */
201-
bank &= 0x1F;
202197
}
203198

204199
/* Reconstruct the normalized address starting with NA[4:0] = 0 */

0 commit comments

Comments
 (0)