Skip to content

Commit 16a2065

Browse files
committed
EDAC/i10nm: Fix NVDIMM detection
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2165650 Tested: tested with the EMR machine we have in the lab commit 2294a72 Author: Qiuxu Zhuo <qiuxu.zhuo@intel.com> Date: Wed Aug 18 10:57:00 2021 -0700 EDAC/i10nm: Fix NVDIMM detection MCDDRCFG is a per-channel register and uses bit{0,1} to indicate the NVDIMM presence on DIMM slot{0,1}. Current i10nm_edac driver wrongly uses MCDDRCFG as per-DIMM register and fails to detect the NVDIMM. Fix it by reading MCDDRCFG as per-channel register and using its bit{0,1} to check whether the NVDIMM is populated on DIMM slot{0,1}. Fixes: d4dc89d ("EDAC, i10nm: Add a driver for Intel 10nm server processors") Reported-by: Fan Du <fan.du@intel.com> Tested-by: Wen Jin <wen.jin@intel.com> Signed-off-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com> Signed-off-by: Tony Luck <tony.luck@intel.com> Link: https://lore.kernel.org/r/20210818175701.1611513-2-tony.luck@intel.com Signed-off-by: Aristeu Rozanski <arozansk@redhat.com>
1 parent 83c6973 commit 16a2065

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/edac/i10nm_base.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
#define I10NM_GET_DIMMMTR(m, i, j) \
3434
readl((m)->mbase + ((m)->hbm_mc ? 0x80c : 0x2080c) + \
3535
(i) * (m)->chan_mmio_sz + (j) * 4)
36-
#define I10NM_GET_MCDDRTCFG(m, i, j) \
36+
#define I10NM_GET_MCDDRTCFG(m, i) \
3737
readl((m)->mbase + ((m)->hbm_mc ? 0x970 : 0x20970) + \
38-
(i) * (m)->chan_mmio_sz + (j) * 4)
38+
(i) * (m)->chan_mmio_sz)
3939
#define I10NM_GET_MCMTR(m, i) \
4040
readl((m)->mbase + ((m)->hbm_mc ? 0xef8 : 0x20ef8) + \
4141
(i) * (m)->chan_mmio_sz)
@@ -450,10 +450,10 @@ static int i10nm_get_dimm_config(struct mem_ctl_info *mci,
450450

451451
ndimms = 0;
452452
amap = I10NM_GET_AMAP(imc, i);
453+
mcddrtcfg = I10NM_GET_MCDDRTCFG(imc, i);
453454
for (j = 0; j < imc->num_dimms; j++) {
454455
dimm = edac_get_dimm(mci, i, j, 0);
455456
mtr = I10NM_GET_DIMMMTR(imc, i, j);
456-
mcddrtcfg = I10NM_GET_MCDDRTCFG(imc, i, j);
457457
edac_dbg(1, "dimmmtr 0x%x mcddrtcfg 0x%x (mc%d ch%d dimm%d)\n",
458458
mtr, mcddrtcfg, imc->mc, i, j);
459459

0 commit comments

Comments
 (0)