Skip to content

Commit 298ffd5

Browse files
committed
Merge remote-tracking branches 'ras/edac-cxl', 'ras/edac-drivers' and 'ras/edac-misc' into edac-updates
* ras/edac-cxl: EDAC/device: Fix dev_set_name() format string EDAC: Update memory repair control interface for memory sparing feature EDAC: Add a memory repair control feature EDAC: Add a Error Check Scrub control feature EDAC: Add scrub control feature EDAC: Add support for EDAC device features control * ras/edac-drivers: EDAC/ie31200: Switch Raptor Lake-S to interrupt mode EDAC/ie31200: Add Intel Raptor Lake-S SoCs support EDAC/ie31200: Break up ie31200_probe1() EDAC/ie31200: Fold the two channel loops into one loop EDAC/ie31200: Make struct dimm_data contain decoded information EDAC/ie31200: Make the memory controller resources configurable EDAC/ie31200: Simplify the pci_device_id table EDAC/ie31200: Fix the 3rd parameter name of *populate_dimm_info() EDAC/ie31200: Fix the error path order of ie31200_init() EDAC/ie31200: Fix the DIMM size mask for several SoCs EDAC/ie31200: Fix the size of EDAC_MC_LAYER_CHIP_SELECT layer EDAC/{skx_common,i10nm}: Fix some missing error reports on Emerald Rapids EDAC/igen6: Fix the flood of invalid error reports EDAC/ie31200: work around false positive build warning * ras/edac-misc: MAINTAINERS: Add a secondary maintainer for bluefield_edac EDAC/pnd2: Make read-only const array intlv static EDAC/igen6: Constify struct res_config EDAC/amd64: Simplify return statement in dct_ecc_enabled() EDAC: Use string choice helper functions Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
3 parents 4947272 + a5db1b2 + f30dab9 commit 298ffd5

File tree

13 files changed

+505
-314
lines changed

13 files changed

+505
-314
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8214,6 +8214,7 @@ F: drivers/edac/aspeed_edac.c
82148214

82158215
EDAC-BLUEFIELD
82168216
M: Shravan Kumar Ramani <shravankr@nvidia.com>
8217+
M: David Thompson <davthompson@nvidia.com>
82178218
S: Supported
82188219
F: drivers/edac/bluefield_edac.c
82198220

drivers/edac/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ config EDAC_I3200
196196

197197
config EDAC_IE31200
198198
tristate "Intel e312xx"
199-
depends on PCI && X86
199+
depends on PCI && X86 && X86_MCE_INTEL
200200
help
201201
Support for error detection and correction on the Intel
202202
E3-1200 based DRAM controllers.

drivers/edac/amd64_edac.c

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-only
22
#include <linux/ras.h>
3+
#include <linux/string_choices.h>
34
#include "amd64_edac.h"
45
#include <asm/amd_nb.h>
56
#include <asm/amd_node.h>
@@ -1171,22 +1172,21 @@ static void debug_dump_dramcfg_low(struct amd64_pvt *pvt, u32 dclr, int chan)
11711172
edac_dbg(1, " LRDIMM %dx rank multiply\n", (dcsm & 0x3));
11721173
}
11731174

1174-
edac_dbg(1, "All DIMMs support ECC:%s\n",
1175-
(dclr & BIT(19)) ? "yes" : "no");
1175+
edac_dbg(1, "All DIMMs support ECC: %s\n", str_yes_no(dclr & BIT(19)));
11761176

11771177

11781178
edac_dbg(1, " PAR/ERR parity: %s\n",
1179-
(dclr & BIT(8)) ? "enabled" : "disabled");
1179+
str_enabled_disabled(dclr & BIT(8)));
11801180

11811181
if (pvt->fam == 0x10)
11821182
edac_dbg(1, " DCT 128bit mode width: %s\n",
11831183
(dclr & BIT(11)) ? "128b" : "64b");
11841184

11851185
edac_dbg(1, " x4 logical DIMMs present: L0: %s L1: %s L2: %s L3: %s\n",
1186-
(dclr & BIT(12)) ? "yes" : "no",
1187-
(dclr & BIT(13)) ? "yes" : "no",
1188-
(dclr & BIT(14)) ? "yes" : "no",
1189-
(dclr & BIT(15)) ? "yes" : "no");
1186+
str_yes_no(dclr & BIT(12)),
1187+
str_yes_no(dclr & BIT(13)),
1188+
str_yes_no(dclr & BIT(14)),
1189+
str_yes_no(dclr & BIT(15)));
11901190
}
11911191

11921192
#define CS_EVEN_PRIMARY BIT(0)
@@ -1353,14 +1353,14 @@ static void umc_dump_misc_regs(struct amd64_pvt *pvt)
13531353
edac_dbg(1, "UMC%d UMC cap high: 0x%x\n", i, umc->umc_cap_hi);
13541354

13551355
edac_dbg(1, "UMC%d ECC capable: %s, ChipKill ECC capable: %s\n",
1356-
i, (umc->umc_cap_hi & BIT(30)) ? "yes" : "no",
1357-
(umc->umc_cap_hi & BIT(31)) ? "yes" : "no");
1356+
i, str_yes_no(umc->umc_cap_hi & BIT(30)),
1357+
str_yes_no(umc->umc_cap_hi & BIT(31)));
13581358
edac_dbg(1, "UMC%d All DIMMs support ECC: %s\n",
1359-
i, (umc->umc_cfg & BIT(12)) ? "yes" : "no");
1359+
i, str_yes_no(umc->umc_cfg & BIT(12)));
13601360
edac_dbg(1, "UMC%d x4 DIMMs present: %s\n",
1361-
i, (umc->dimm_cfg & BIT(6)) ? "yes" : "no");
1361+
i, str_yes_no(umc->dimm_cfg & BIT(6)));
13621362
edac_dbg(1, "UMC%d x16 DIMMs present: %s\n",
1363-
i, (umc->dimm_cfg & BIT(7)) ? "yes" : "no");
1363+
i, str_yes_no(umc->dimm_cfg & BIT(7)));
13641364

13651365
umc_debug_display_dimm_sizes(pvt, i);
13661366
}
@@ -1371,11 +1371,11 @@ static void dct_dump_misc_regs(struct amd64_pvt *pvt)
13711371
edac_dbg(1, "F3xE8 (NB Cap): 0x%08x\n", pvt->nbcap);
13721372

13731373
edac_dbg(1, " NB two channel DRAM capable: %s\n",
1374-
(pvt->nbcap & NBCAP_DCT_DUAL) ? "yes" : "no");
1374+
str_yes_no(pvt->nbcap & NBCAP_DCT_DUAL));
13751375

13761376
edac_dbg(1, " ECC capable: %s, ChipKill ECC capable: %s\n",
1377-
(pvt->nbcap & NBCAP_SECDED) ? "yes" : "no",
1378-
(pvt->nbcap & NBCAP_CHIPKILL) ? "yes" : "no");
1377+
str_yes_no(pvt->nbcap & NBCAP_SECDED),
1378+
str_yes_no(pvt->nbcap & NBCAP_CHIPKILL));
13791379

13801380
debug_dump_dramcfg_low(pvt, pvt->dclr0, 0);
13811381

@@ -1398,7 +1398,7 @@ static void dct_dump_misc_regs(struct amd64_pvt *pvt)
13981398
if (!dct_ganging_enabled(pvt))
13991399
debug_dump_dramcfg_low(pvt, pvt->dclr1, 1);
14001400

1401-
edac_dbg(1, " DramHoleValid: %s\n", dhar_valid(pvt) ? "yes" : "no");
1401+
edac_dbg(1, " DramHoleValid: %s\n", str_yes_no(dhar_valid(pvt)));
14021402

14031403
amd64_info("using x%u syndromes.\n", pvt->ecc_sym_sz);
14041404
}
@@ -2027,15 +2027,15 @@ static void read_dram_ctl_register(struct amd64_pvt *pvt)
20272027

20282028
if (!dct_ganging_enabled(pvt))
20292029
edac_dbg(0, " Address range split per DCT: %s\n",
2030-
(dct_high_range_enabled(pvt) ? "yes" : "no"));
2030+
str_yes_no(dct_high_range_enabled(pvt)));
20312031

20322032
edac_dbg(0, " data interleave for ECC: %s, DRAM cleared since last warm reset: %s\n",
2033-
(dct_data_intlv_enabled(pvt) ? "enabled" : "disabled"),
2034-
(dct_memory_cleared(pvt) ? "yes" : "no"));
2033+
str_enabled_disabled(dct_data_intlv_enabled(pvt)),
2034+
str_yes_no(dct_memory_cleared(pvt)));
20352035

20362036
edac_dbg(0, " channel interleave: %s, "
20372037
"interleave bits selector: 0x%x\n",
2038-
(dct_interleave_enabled(pvt) ? "enabled" : "disabled"),
2038+
str_enabled_disabled(dct_interleave_enabled(pvt)),
20392039
dct_sel_interleave_addr(pvt));
20402040
}
20412041

@@ -3208,8 +3208,7 @@ static bool nb_mce_bank_enabled_on_node(u16 nid)
32083208
nbe = reg->l & MSR_MCGCTL_NBE;
32093209

32103210
edac_dbg(0, "core: %u, MCG_CTL: 0x%llx, NB MSR is %s\n",
3211-
cpu, reg->q,
3212-
(nbe ? "enabled" : "disabled"));
3211+
cpu, reg->q, str_enabled_disabled(nbe));
32133212

32143213
if (!nbe)
32153214
goto out;
@@ -3353,12 +3352,9 @@ static bool dct_ecc_enabled(struct amd64_pvt *pvt)
33533352
edac_dbg(0, "NB MCE bank disabled, set MSR 0x%08x[4] on node %d to enable.\n",
33543353
MSR_IA32_MCG_CTL, nid);
33553354

3356-
edac_dbg(3, "Node %d: DRAM ECC %s.\n", nid, (ecc_en ? "enabled" : "disabled"));
3355+
edac_dbg(3, "Node %d: DRAM ECC %s.\n", nid, str_enabled_disabled(ecc_en));
33573356

3358-
if (!ecc_en || !nb_mce_en)
3359-
return false;
3360-
else
3361-
return true;
3357+
return ecc_en && nb_mce_en;
33623358
}
33633359

33643360
static bool umc_ecc_enabled(struct amd64_pvt *pvt)
@@ -3378,7 +3374,7 @@ static bool umc_ecc_enabled(struct amd64_pvt *pvt)
33783374
}
33793375
}
33803376

3381-
edac_dbg(3, "Node %d: DRAM ECC %s.\n", pvt->mc_node_id, (ecc_en ? "enabled" : "disabled"));
3377+
edac_dbg(3, "Node %d: DRAM ECC %s.\n", pvt->mc_node_id, str_enabled_disabled(ecc_en));
33823378

33833379
return ecc_en;
33843380
}

drivers/edac/debugfs.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
// SPDX-License-Identifier: GPL-2.0-only
2+
3+
#include <linux/string_choices.h>
4+
25
#include "edac_module.h"
36

47
static struct dentry *edac_debugfs;
@@ -22,7 +25,7 @@ static ssize_t edac_fake_inject_write(struct file *file,
2225
"Generating %d %s fake error%s to %d.%d.%d to test core handling. NOTE: this won't test the driver-specific decoding logic.\n",
2326
errcount,
2427
(type == HW_EVENT_ERR_UNCORRECTED) ? "UE" : "CE",
25-
errcount > 1 ? "s" : "",
28+
str_plural(errcount),
2629
mci->fake_inject_layer[0],
2730
mci->fake_inject_layer[1],
2831
mci->fake_inject_layer[2]

drivers/edac/i10nm_base.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,8 @@ static int i10nm_get_ddr_munits(void)
751751
continue;
752752
} else {
753753
d->imc[lmc].mdev = mdev;
754+
if (res_cfg->type == SPR)
755+
skx_set_mc_mapping(d, i, lmc);
754756
lmc++;
755757
}
756758
}

drivers/edac/i5400_edac.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include <linux/slab.h>
3232
#include <linux/edac.h>
3333
#include <linux/mmzone.h>
34+
#include <linux/string_choices.h>
3435

3536
#include "edac_module.h"
3637

@@ -899,7 +900,7 @@ static void decode_mtr(int slot_row, u16 mtr)
899900
edac_dbg(2, "\t\tWIDTH: x%d\n", MTR_DRAM_WIDTH(mtr));
900901

901902
edac_dbg(2, "\t\tELECTRICAL THROTTLING is %s\n",
902-
MTR_DIMMS_ETHROTTLE(mtr) ? "enabled" : "disabled");
903+
str_enabled_disabled(MTR_DIMMS_ETHROTTLE(mtr)));
903904

904905
edac_dbg(2, "\t\tNUMBANK: %d bank(s)\n", MTR_DRAM_BANKS(mtr));
905906
edac_dbg(2, "\t\tNUMRANK: %s\n",

drivers/edac/i7300_edac.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <linux/slab.h>
2424
#include <linux/edac.h>
2525
#include <linux/mmzone.h>
26+
#include <linux/string_choices.h>
2627

2728
#include "edac_module.h"
2829

@@ -620,7 +621,7 @@ static int decode_mtr(struct i7300_pvt *pvt,
620621
edac_dbg(2, "\t\tWIDTH: x%d\n", MTR_DRAM_WIDTH(mtr));
621622

622623
edac_dbg(2, "\t\tELECTRICAL THROTTLING is %s\n",
623-
MTR_DIMMS_ETHROTTLE(mtr) ? "enabled" : "disabled");
624+
str_enabled_disabled(MTR_DIMMS_ETHROTTLE(mtr)));
624625

625626
edac_dbg(2, "\t\tNUMBANK: %d bank(s)\n", MTR_DRAM_BANKS(mtr));
626627
edac_dbg(2, "\t\tNUMRANK: %s\n",
@@ -871,9 +872,9 @@ static int i7300_get_mc_regs(struct mem_ctl_info *mci)
871872
IS_MIRRORED(pvt->mc_settings) ? "" : "non-");
872873

873874
edac_dbg(0, "Error detection is %s\n",
874-
IS_ECC_ENABLED(pvt->mc_settings) ? "enabled" : "disabled");
875+
str_enabled_disabled(IS_ECC_ENABLED(pvt->mc_settings)));
875876
edac_dbg(0, "Retry is %s\n",
876-
IS_RETRY_ENABLED(pvt->mc_settings) ? "enabled" : "disabled");
877+
str_enabled_disabled(IS_RETRY_ENABLED(pvt->mc_settings)));
877878

878879
/* Get Memory Interleave Range registers */
879880
pci_read_config_word(pvt->pci_dev_16_1_fsb_addr_map, MIR0,

0 commit comments

Comments
 (0)