diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-08-15 15:29:23 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-08-15 15:29:23 -0400 |
commit | f2fa30a8b842920896f974010ac4011b8d697566 (patch) | |
tree | 0743819ce5d599ef25cc911850b8c64f623e3ef0 | |
parent | 694d0d0bb2030d2e36df73e2d23d5770511dbc8d (diff) | |
parent | c5b48fa7e298b9a8968a1c1fc0ef013069ca2dd2 (diff) |
Merge tag 'edac_fixes_for_4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp
Pull EDAC fix from Borislav Petkov:
"A fix to sb_edac correcting channel reporting on Knights Landing"
* tag 'edac_fixes_for_4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp:
EDAC, sb_edac: Fix channel reporting on Knights Landing
-rw-r--r-- | drivers/edac/sb_edac.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c index 4fb2eb7c800d..ce0067b7a2f6 100644 --- a/drivers/edac/sb_edac.c +++ b/drivers/edac/sb_edac.c | |||
@@ -552,9 +552,9 @@ static const struct pci_id_table pci_dev_descr_haswell_table[] = { | |||
552 | /* Knight's Landing Support */ | 552 | /* Knight's Landing Support */ |
553 | /* | 553 | /* |
554 | * KNL's memory channels are swizzled between memory controllers. | 554 | * KNL's memory channels are swizzled between memory controllers. |
555 | * MC0 is mapped to CH3,5,6 and MC1 is mapped to CH0,1,2 | 555 | * MC0 is mapped to CH3,4,5 and MC1 is mapped to CH0,1,2 |
556 | */ | 556 | */ |
557 | #define knl_channel_remap(channel) ((channel + 3) % 6) | 557 | #define knl_channel_remap(mc, chan) ((mc) ? (chan) : (chan) + 3) |
558 | 558 | ||
559 | /* Memory controller, TAD tables, error injection - 2-8-0, 2-9-0 (2 of these) */ | 559 | /* Memory controller, TAD tables, error injection - 2-8-0, 2-9-0 (2 of these) */ |
560 | #define PCI_DEVICE_ID_INTEL_KNL_IMC_MC 0x7840 | 560 | #define PCI_DEVICE_ID_INTEL_KNL_IMC_MC 0x7840 |
@@ -1286,7 +1286,7 @@ static u32 knl_get_mc_route(int entry, u32 reg) | |||
1286 | mc = GET_BITFIELD(reg, entry*3, (entry*3)+2); | 1286 | mc = GET_BITFIELD(reg, entry*3, (entry*3)+2); |
1287 | chan = GET_BITFIELD(reg, (entry*2) + 18, (entry*2) + 18 + 1); | 1287 | chan = GET_BITFIELD(reg, (entry*2) + 18, (entry*2) + 18 + 1); |
1288 | 1288 | ||
1289 | return knl_channel_remap(mc*3 + chan); | 1289 | return knl_channel_remap(mc, chan); |
1290 | } | 1290 | } |
1291 | 1291 | ||
1292 | /* | 1292 | /* |
@@ -2997,8 +2997,15 @@ static void sbridge_mce_output_error(struct mem_ctl_info *mci, | |||
2997 | } else { | 2997 | } else { |
2998 | char A = *("A"); | 2998 | char A = *("A"); |
2999 | 2999 | ||
3000 | channel = knl_channel_remap(channel); | 3000 | /* |
3001 | * Reported channel is in range 0-2, so we can't map it | ||
3002 | * back to mc. To figure out mc we check machine check | ||
3003 | * bank register that reported this error. | ||
3004 | * bank15 means mc0 and bank16 means mc1. | ||
3005 | */ | ||
3006 | channel = knl_channel_remap(m->bank == 16, channel); | ||
3001 | channel_mask = 1 << channel; | 3007 | channel_mask = 1 << channel; |
3008 | |||
3002 | snprintf(msg, sizeof(msg), | 3009 | snprintf(msg, sizeof(msg), |
3003 | "%s%s err_code:%04x:%04x channel:%d (DIMM_%c)", | 3010 | "%s%s err_code:%04x:%04x channel:%d (DIMM_%c)", |
3004 | overflow ? " OVERFLOW" : "", | 3011 | overflow ? " OVERFLOW" : "", |