Patch "EDAC/sb_edac: Fix computation of channel address" has been added to the 4.5-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
EDAC/sb_edac: Fix computation of channel address
to the 4.5-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
edac-sb_edac-fix-computation-of-channel-address.patch
and it can be found in the queue-4.5 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
eb1af3b71f9d83e45f2fd2fd649356e98e1c582cMon Sep 17 00:00:00 2001
From: "Luck, Tony" <[email protected]>
Date: Wed, 9 Mar 2016 16:40:48 -0800
Subject: EDAC/sb_edac: Fix computation of channel address
From: Tony Luck <[email protected]>
commit eb1af3b71f9d83e45f2fd2fd649356e98e1c582c upstream.
Large memory Haswell-EX systems with multiple DIMMs per channel were sometimes reporting the wrong DIMM.
Found three problems:
1) Debug printouts for socket and channel interleave were not interpreting
the register fields correctly. The socket interleave field is a 2^X
value (0=1, 1=2, 2=4, 3=8). The channel interleave is X+1 (0=1, 1=2,
2=3. 3=4).2) Actual use of the socket interleave value didn't interpret as 2^X
3) Conversion of address to channel address was complicated, and wrong.
--- drivers/edac/sb_edac.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-)
drivers/edac/sb_edac.c +10 -16
@@ -1839,8 +1839,8 @@ static void get_memory_layout(const stru edac_dbg(0, "TAD#%d: up to %u.%03u GB (0x%016Lx), socket interleave %d, memory interleave %d, TGT: %d, %d, %d, %d, reg=0x%08x\n", n_tads, gb, (mb*1000)/1024, ((u64)tmp_mb) << 20L, - (u32)TAD_SOCK(reg), - (u32)TAD_CH(reg), + (u32)(1 << TAD_SOCK(reg)), + (u32)TAD_CH(reg) + 1, (u32)TAD_TGT0(reg), (u32)TAD_TGT1(reg), (u32)TAD_TGT2(reg),
@@ -2118,7 +2118,7 @@ static int get_memory_error_data(struct } ch_way =TAD_CH (reg) +1 ; - sck_way =TAD_SOCK (reg) +1 ; + sck_way =1 <<TAD_SOCK (reg);if (ch_way ==3 ) idx = addr >>6 ;
@@ -2175,7 +2175,7 @@ static int get_memory_error_data(struct n_tads, addr, limit, - (u32 )TAD_SOCK (reg), + sck_way, ch_way, offset, idx,
@@ -2190,18 +2190,12 @@ static int get_memory_error_data(struct offset, addr);return -EINVAL ; } - addr -= offset; -/* Store the low bits [0:6] of the addr */ - ch_addr = addr &0x7f ; -/* Remove socket wayness and remove 6 bits */ - addr >>=6 ; - addr =div_u64 (addr, sck_xch); -#if 0 -/* Divide by channel way */ - addr = addr / ch_way; -#endif -/* Recover the last 6 bits */ - ch_addr |= addr <<6 ; + + ch_addr = addr - offset; + ch_addr >>= (6 + shiftup); + ch_addr /= ch_way * sck_way; + ch_addr <<= (6 + shiftup); + ch_addr |= addr & ((1 << (6 + shiftup)) -1 );/* * Step 3) Decode rank
Patches currently in stable-queue which might be from [email protected] are
queue-4.5/edac-sb_edac-fix-computation-of-channel-address.patch