Skip to content

Commit ff15e95

Browse files
aeglIngo Molnar
authored andcommitted
x86 EDAC, sb_edac.c: Repair damage introduced when "fixing" channel address
In commit: eb1af3b ("Fix computation of channel address") I switched the "sck_way" variable from holding the log2 value read from the h/w to instead be the actual number. Unfortunately it is needed in log2 form when used to shift the address. Tested-by: Patrick Geary <[email protected]> Signed-off-by: Tony Luck <[email protected]> Acked-by: Mauro Carvalho Chehab <[email protected]> Cc: Aristeu Rozanski <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Cc: [email protected] Fixes: eb1af3b ("Fix computation of channel address") Signed-off-by: Ingo Molnar <[email protected]>
1 parent 103f611 commit ff15e95

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/edac/sb_edac.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2118,7 +2118,7 @@ static int get_memory_error_data(struct mem_ctl_info *mci,
21182118
}
21192119

21202120
ch_way = TAD_CH(reg) + 1;
2121-
sck_way = 1 << TAD_SOCK(reg);
2121+
sck_way = TAD_SOCK(reg);
21222122

21232123
if (ch_way == 3)
21242124
idx = addr >> 6;
@@ -2157,7 +2157,7 @@ static int get_memory_error_data(struct mem_ctl_info *mci,
21572157
switch(ch_way) {
21582158
case 2:
21592159
case 4:
2160-
sck_xch = 1 << sck_way * (ch_way >> 1);
2160+
sck_xch = (1 << sck_way) * (ch_way >> 1);
21612161
break;
21622162
default:
21632163
sprintf(msg, "Invalid mirror set. Can't decode addr");
@@ -2193,7 +2193,7 @@ static int get_memory_error_data(struct mem_ctl_info *mci,
21932193

21942194
ch_addr = addr - offset;
21952195
ch_addr >>= (6 + shiftup);
2196-
ch_addr /= ch_way * sck_way;
2196+
ch_addr /= sck_xch;
21972197
ch_addr <<= (6 + shiftup);
21982198
ch_addr |= addr & ((1 << (6 + shiftup)) - 1);
21992199

0 commit comments

Comments
 (0)