From: Lukasz Odzioba <lukasz.odzioba@intel.com>
To: linux-kernel@vger.kernel.org, linux-edac@vger.kernel.org,
bp@alien8.de, dougthompson@xmission.com, mchehab@kernel.org
Cc: tony.luck@intel.com, hubert.chrzaniuk@intel.com,
lukasz.anaczkowski@intel.com, lukasz.odzioba@intel.com
Subject: [PATCH 1/1] EDAC, sb_edac: Fix channel reporting on Knights Landing
Date: Sat, 23 Jul 2016 01:44:49 +0200 [thread overview]
Message-ID: <1469231089-22837-1-git-send-email-lukasz.odzioba@intel.com> (raw)
On Intel Xeon Phi Knights Landing processor family the channels
of memory controller have untypical arrangement - MC0 is mapped to
CH3,4,5 and MC1 is mapped to CH0,1,2. This causes EDAC driver to
report the channel name incorrectly.
We missed this change earlier, so the code already contains
similar comment, but the translation function is incorrect.
Without this patch:
errors in DIMM_A and DIMM_D were reported in DIMM_D
errors in DIMM_B and DIMM_E were reported in DIMM_E
errors in DIMM_C and DIMM_F were reported in DIMM_F
Fixes: d0cdf9003140 ("sb_edac: Add Knights Landing (Xeon Phi gen 2) support")
Signed-off-by: Lukasz Odzioba <lukasz.odzioba@intel.com>
Signed-off-by: Hubert Chrzaniuk <hubert.chrzaniuk@intel.com>
---
drivers/edac/sb_edac.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c
index 6744d88..61e2c52 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[] = {
/* Knight's Landing Support */
/*
* KNL's memory channels are swizzled between memory controllers.
- * MC0 is mapped to CH3,5,6 and MC1 is mapped to CH0,1,2
+ * MC0 is mapped to CH3,4,5 and MC1 is mapped to CH0,1,2
*/
-#define knl_channel_remap(channel) ((channel + 3) % 6)
+#define knl_channel_remap(mc, chan) (mc ? chan : chan + 3)
/* Memory controller, TAD tables, error injection - 2-8-0, 2-9-0 (2 of these) */
#define PCI_DEVICE_ID_INTEL_KNL_IMC_MC 0x7840
@@ -1286,7 +1286,7 @@ static u32 knl_get_mc_route(int entry, u32 reg)
mc = GET_BITFIELD(reg, entry*3, (entry*3)+2);
chan = GET_BITFIELD(reg, (entry*2) + 18, (entry*2) + 18 + 1);
- return knl_channel_remap(mc*3 + chan);
+ return knl_channel_remap(mc, chan);
}
/*
@@ -3003,9 +3003,16 @@ static void sbridge_mce_output_error(struct mem_ctl_info *mci,
mscod, errcode,
m->bank);
} else {
- char A = *("A");
+ char mc, A = *("A");
- channel = knl_channel_remap(channel);
+ /*
+ * Reported channel is in range 0-2, so we can't map it
+ * back to mc. To figure out mc we check machine check
+ * bank register that reported this error.
+ * bank15 means mc0 and bank16 means mc1.
+ */
+ mc = m->bank == 16;
+ channel = knl_channel_remap(mc, channel);
channel_mask = 1 << channel;
snprintf(msg, sizeof(msg),
"%s%s err_code:%04x:%04x channel:%d (DIMM_%c)",
--
1.8.3.1
next reply other threads:[~2016-07-22 23:45 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-22 23:44 Lukasz Odzioba [this message]
2016-07-29 4:15 ` Odzioba, Lukasz
2016-08-03 6:44 ` Borislav Petkov
2016-08-03 7:06 ` Chrzaniuk, Hubert
2016-08-03 7:12 ` Borislav Petkov
2016-08-03 7:44 ` Chrzaniuk, Hubert
2016-08-03 7:58 ` Borislav Petkov
2016-08-03 8:54 ` Borislav Petkov
2016-08-03 9:25 ` Chrzaniuk, Hubert
2016-08-03 9:31 ` Borislav Petkov
2016-08-03 10:23 ` Chrzaniuk, Hubert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1469231089-22837-1-git-send-email-lukasz.odzioba@intel.com \
--to=lukasz.odzioba@intel.com \
--cc=bp@alien8.de \
--cc=dougthompson@xmission.com \
--cc=hubert.chrzaniuk@intel.com \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lukasz.anaczkowski@intel.com \
--cc=mchehab@kernel.org \
--cc=tony.luck@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®