aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Luck <tony.luck@intel.com>2016-04-14 13:21:52 -0400
committerIngo Molnar <mingo@kernel.org>2016-04-22 04:10:01 -0400
commitff15e95c82768d589957dbb17d7eb7dba7904659 (patch)
treee320f679dbcc6b5bfdba29b5cee6f32c5d91e8fa
parent103f6112f253017d7062cd74d17f4a514ed4485c (diff)
x86 EDAC, sb_edac.c: Repair damage introduced when "fixing" channel address
In commit: eb1af3b71f9d ("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 <patrickg@supermicro.com> Signed-off-by: Tony Luck <tony.luck@intel.com> Acked-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Cc: Aristeu Rozanski <arozansk@redhat.com> Cc: Borislav Petkov <bp@alien8.de> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-edac@vger.kernel.org Cc: stable@vger.kernel.org Fixes: eb1af3b71f9d ("Fix computation of channel address") Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--drivers/edac/sb_edac.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c
index 93f0d4120289..f4666b0aeba6 100644
--- a/drivers/edac/sb_edac.c
+++ b/drivers/edac/sb_edac.c
@@ -2118,7 +2118,7 @@ static int get_memory_error_data(struct mem_ctl_info *mci,
2118 } 2118 }
2119 2119
2120 ch_way = TAD_CH(reg) + 1; 2120 ch_way = TAD_CH(reg) + 1;
2121 sck_way = 1 << TAD_SOCK(reg); 2121 sck_way = TAD_SOCK(reg);
2122 2122
2123 if (ch_way == 3) 2123 if (ch_way == 3)
2124 idx = addr >> 6; 2124 idx = addr >> 6;
@@ -2157,7 +2157,7 @@ static int get_memory_error_data(struct mem_ctl_info *mci,
2157 switch(ch_way) { 2157 switch(ch_way) {
2158 case 2: 2158 case 2:
2159 case 4: 2159 case 4:
2160 sck_xch = 1 << sck_way * (ch_way >> 1); 2160 sck_xch = (1 << sck_way) * (ch_way >> 1);
2161 break; 2161 break;
2162 default: 2162 default:
2163 sprintf(msg, "Invalid mirror set. Can't decode addr"); 2163 sprintf(msg, "Invalid mirror set. Can't decode addr");
@@ -2193,7 +2193,7 @@ static int get_memory_error_data(struct mem_ctl_info *mci,
2193 2193
2194 ch_addr = addr - offset; 2194 ch_addr = addr - offset;
2195 ch_addr >>= (6 + shiftup); 2195 ch_addr >>= (6 + shiftup);
2196 ch_addr /= ch_way * sck_way; 2196 ch_addr /= sck_xch;
2197 ch_addr <<= (6 + shiftup); 2197 ch_addr <<= (6 + shiftup);
2198 ch_addr |= addr & ((1 << (6 + shiftup)) - 1); 2198 ch_addr |= addr & ((1 << (6 + shiftup)) - 1);
2199 2199