Skip to content

Commit

Permalink
x86 EDAC, sb_edac.c: Repair damage introduced when "fixing" channel a…
Browse files Browse the repository at this point in the history
…ddress

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]>
  • Loading branch information
aegl authored and Ingo Molnar committed Apr 22, 2016
1 parent 103f611 commit ff15e95
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/edac/sb_edac.c
Original file line number Diff line number Diff line change
Expand Up @@ -2118,7 +2118,7 @@ static int get_memory_error_data(struct mem_ctl_info *mci,
}

ch_way = TAD_CH(reg) + 1;
sck_way = 1 << TAD_SOCK(reg);
sck_way = TAD_SOCK(reg);

if (ch_way == 3)
idx = addr >> 6;
Expand Down Expand Up @@ -2157,7 +2157,7 @@ static int get_memory_error_data(struct mem_ctl_info *mci,
switch(ch_way) {
case 2:
case 4:
sck_xch = 1 << sck_way * (ch_way >> 1);
sck_xch = (1 << sck_way) * (ch_way >> 1);
break;
default:
sprintf(msg, "Invalid mirror set. Can't decode addr");
Expand Down Expand Up @@ -2193,7 +2193,7 @@ static int get_memory_error_data(struct mem_ctl_info *mci,

ch_addr = addr - offset;
ch_addr >>= (6 + shiftup);
ch_addr /= ch_way * sck_way;
ch_addr /= sck_xch;
ch_addr <<= (6 + shiftup);
ch_addr |= addr & ((1 << (6 + shiftup)) - 1);

Expand Down

0 comments on commit ff15e95

Please sign in to comment.