Skip to content

Commit d7223ae

Browse files
committed
Merge tag 'edac_updates_for_v6.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras
Pull EDAC updates from Borislav Petkov: - i10nm: - switch to using scnprintf() - Add Granite Rapids-D support - synopsys: Make sure ECC error and counter registers are cleared during init/probing to avoid reporting stale errors - igen6: Add Wildcat Lake SoCs support - Make sure scrub features sysfs attributes are initialized properly - Allocate memory repair sysfs attributes statically to reduce stack usage - Fix DIMM module size computation for DIMMs with total capacity which is a non power-of-two number, in amd64_edac - Do not be too dramatic when reporting disabled memory controllers in igen6_edac - Add support to ie31200_edac for the following SoCs: - Core i5-14[67]00 - Bartless Lake-S SoCs - Raptor Lake-HX * tag 'edac_updates_for_v6.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras: EDAC/{skx_common,i10nm}: Use scnprintf() for safer buffer handling EDAC/synopsys: Clear the ECC counters on init EDAC/ie31200: Add Intel Raptor Lake-HX SoCs support EDAC/igen6: Add Intel Wildcat Lake SoCs support EDAC/i10nm: Add Intel Granite Rapids-D support EDAC/mem_repair: Reduce stack usage in edac_mem_repair_get_desc() EDAC/igen6: Reduce log level to debug for absent memory controllers EDAC/ie31200: Document which CPUs correspond to each Raptor Lake-S device ID EDAC/ie31200: Enable support for Core i5-14600 and i7-14700 ie31200/EDAC: Add Intel Bartlett Lake-S SoCs support
2 parents 909d2bb + 35928bc commit d7223ae

File tree

6 files changed

+140
-102
lines changed

6 files changed

+140
-102
lines changed

drivers/edac/i10nm_base.c

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
((GET_BITFIELD(reg, 0, 10) << 12) + 0x140000)
6363

6464
#define I10NM_GNR_IMC_MMIO_OFFSET 0x24c000
65+
#define I10NM_GNR_D_IMC_MMIO_OFFSET 0x206000
6566
#define I10NM_GNR_IMC_MMIO_SIZE 0x4000
6667
#define I10NM_HBM_IMC_MMIO_SIZE 0x9000
6768
#define I10NM_DDR_IMC_CH_CNT(reg) GET_BITFIELD(reg, 21, 24)
@@ -343,7 +344,7 @@ static void show_retry_rd_err_log(struct decoded_addr *res, char *msg,
343344

344345
status_mask = rrl->over_mask | rrl->uc_mask | rrl->v_mask;
345346

346-
n = snprintf(msg, len, " retry_rd_err_log[");
347+
n = scnprintf(msg, len, " retry_rd_err_log[");
347348
for (i = 0; i < rrl->set_num; i++) {
348349
scrub = (rrl->modes[i] == FRE_SCRUB || rrl->modes[i] == LRE_SCRUB);
349350
if (scrub_err != scrub)
@@ -355,9 +356,9 @@ static void show_retry_rd_err_log(struct decoded_addr *res, char *msg,
355356
log = read_imc_reg(imc, ch, offset, width);
356357

357358
if (width == 4)
358-
n += snprintf(msg + n, len - n, "%.8llx ", log);
359+
n += scnprintf(msg + n, len - n, "%.8llx ", log);
359360
else
360-
n += snprintf(msg + n, len - n, "%.16llx ", log);
361+
n += scnprintf(msg + n, len - n, "%.16llx ", log);
361362

362363
/* Clear RRL status if RRL in Linux control mode. */
363364
if (retry_rd_err_log == 2 && !j && (log & status_mask))
@@ -367,31 +368,31 @@ static void show_retry_rd_err_log(struct decoded_addr *res, char *msg,
367368

368369
/* Move back one space. */
369370
n--;
370-
n += snprintf(msg + n, len - n, "]");
371+
n += scnprintf(msg + n, len - n, "]");
371372

372373
if (len - n > 0) {
373-
n += snprintf(msg + n, len - n, " correrrcnt[");
374+
n += scnprintf(msg + n, len - n, " correrrcnt[");
374375
for (i = 0; i < rrl->cecnt_num && len - n > 0; i++) {
375376
offset = rrl->cecnt_offsets[i];
376377
width = rrl->cecnt_widths[i];
377378
corr = read_imc_reg(imc, ch, offset, width);
378379

379380
/* CPUs {ICX,SPR} encode two counters per 4-byte CORRERRCNT register. */
380381
if (res_cfg->type <= SPR) {
381-
n += snprintf(msg + n, len - n, "%.4llx %.4llx ",
382+
n += scnprintf(msg + n, len - n, "%.4llx %.4llx ",
382383
corr & 0xffff, corr >> 16);
383384
} else {
384385
/* CPUs {GNR} encode one counter per CORRERRCNT register. */
385386
if (width == 4)
386-
n += snprintf(msg + n, len - n, "%.8llx ", corr);
387+
n += scnprintf(msg + n, len - n, "%.8llx ", corr);
387388
else
388-
n += snprintf(msg + n, len - n, "%.16llx ", corr);
389+
n += scnprintf(msg + n, len - n, "%.16llx ", corr);
389390
}
390391
}
391392

392393
/* Move back one space. */
393394
n--;
394-
n += snprintf(msg + n, len - n, "]");
395+
n += scnprintf(msg + n, len - n, "]");
395396
}
396397
}
397398

@@ -687,6 +688,14 @@ static struct pci_dev *get_gnr_mdev(struct skx_dev *d, int logical_idx, int *phy
687688
return NULL;
688689
}
689690

691+
static u32 get_gnr_imc_mmio_offset(void)
692+
{
693+
if (boot_cpu_data.x86_vfm == INTEL_GRANITERAPIDS_D)
694+
return I10NM_GNR_D_IMC_MMIO_OFFSET;
695+
696+
return I10NM_GNR_IMC_MMIO_OFFSET;
697+
}
698+
690699
/**
691700
* get_ddr_munit() - Get the resource of the i-th DDR memory controller.
692701
*
@@ -715,7 +724,7 @@ static struct pci_dev *get_ddr_munit(struct skx_dev *d, int i, u32 *offset, unsi
715724
return NULL;
716725

717726
*offset = I10NM_GET_IMC_MMIO_OFFSET(reg) +
718-
I10NM_GNR_IMC_MMIO_OFFSET +
727+
get_gnr_imc_mmio_offset() +
719728
physical_idx * I10NM_GNR_IMC_MMIO_SIZE;
720729
*size = I10NM_GNR_IMC_MMIO_SIZE;
721730

@@ -1030,6 +1039,7 @@ static const struct x86_cpu_id i10nm_cpuids[] = {
10301039
X86_MATCH_VFM(INTEL_SAPPHIRERAPIDS_X, &spr_cfg),
10311040
X86_MATCH_VFM(INTEL_EMERALDRAPIDS_X, &spr_cfg),
10321041
X86_MATCH_VFM(INTEL_GRANITERAPIDS_X, &gnr_cfg),
1042+
X86_MATCH_VFM(INTEL_GRANITERAPIDS_D, &gnr_cfg),
10331043
X86_MATCH_VFM(INTEL_ATOM_CRESTMONT_X, &gnr_cfg),
10341044
X86_MATCH_VFM(INTEL_ATOM_CRESTMONT, &gnr_cfg),
10351045
X86_MATCH_VFM(INTEL_ATOM_DARKMONT_X, &gnr_cfg),

drivers/edac/ie31200_edac.c

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,31 @@
8787
#define PCI_DEVICE_ID_INTEL_IE31200_HB_CFL_10 0x3eca
8888

8989
/* Raptor Lake-S */
90-
#define PCI_DEVICE_ID_INTEL_IE31200_RPL_S_1 0xa703
91-
#define PCI_DEVICE_ID_INTEL_IE31200_RPL_S_2 0x4640
92-
#define PCI_DEVICE_ID_INTEL_IE31200_RPL_S_3 0x4630
93-
#define PCI_DEVICE_ID_INTEL_IE31200_RPL_S_4 0xa700
90+
#define PCI_DEVICE_ID_INTEL_IE31200_RPL_S_1 0xa703 /* 8P+8E, e.g. i7-13700 */
91+
#define PCI_DEVICE_ID_INTEL_IE31200_RPL_S_2 0x4640 /* 6P+8E, e.g. i5-13500, i5-13600, i5-14500 */
92+
#define PCI_DEVICE_ID_INTEL_IE31200_RPL_S_3 0x4630 /* 4P+0E, e.g. i3-13100E */
93+
#define PCI_DEVICE_ID_INTEL_IE31200_RPL_S_4 0xa700 /* 8P+16E, e.g. i9-13900, i9-14900 */
94+
#define PCI_DEVICE_ID_INTEL_IE31200_RPL_S_5 0xa740 /* 8P+12E, e.g. i7-14700 */
95+
#define PCI_DEVICE_ID_INTEL_IE31200_RPL_S_6 0xa704 /* 6P+8E, e.g. i5-14600 */
96+
97+
/* Raptor Lake-HX */
98+
#define PCI_DEVICE_ID_INTEL_IE31200_RPL_HX_1 0xa702 /* 8P+16E, e.g. i9-13950HX */
9499

95100
/* Alder Lake-S */
96101
#define PCI_DEVICE_ID_INTEL_IE31200_ADL_S_1 0x4660
97102

103+
/* Bartlett Lake-S */
104+
#define PCI_DEVICE_ID_INTEL_IE31200_BTL_S_1 0x4639
105+
#define PCI_DEVICE_ID_INTEL_IE31200_BTL_S_2 0x463c
106+
#define PCI_DEVICE_ID_INTEL_IE31200_BTL_S_3 0x4642
107+
#define PCI_DEVICE_ID_INTEL_IE31200_BTL_S_4 0x4643
108+
#define PCI_DEVICE_ID_INTEL_IE31200_BTL_S_5 0xa731
109+
#define PCI_DEVICE_ID_INTEL_IE31200_BTL_S_6 0xa732
110+
#define PCI_DEVICE_ID_INTEL_IE31200_BTL_S_7 0xa733
111+
#define PCI_DEVICE_ID_INTEL_IE31200_BTL_S_8 0xa741
112+
#define PCI_DEVICE_ID_INTEL_IE31200_BTL_S_9 0xa744
113+
#define PCI_DEVICE_ID_INTEL_IE31200_BTL_S_10 0xa745
114+
98115
#define IE31200_RANKS_PER_CHANNEL 8
99116
#define IE31200_DIMMS_PER_CHANNEL 2
100117
#define IE31200_CHANNELS 2
@@ -740,7 +757,20 @@ static const struct pci_device_id ie31200_pci_tbl[] = {
740757
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IE31200_RPL_S_2), (kernel_ulong_t)&rpl_s_cfg},
741758
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IE31200_RPL_S_3), (kernel_ulong_t)&rpl_s_cfg},
742759
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IE31200_RPL_S_4), (kernel_ulong_t)&rpl_s_cfg},
760+
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IE31200_RPL_S_5), (kernel_ulong_t)&rpl_s_cfg},
761+
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IE31200_RPL_S_6), (kernel_ulong_t)&rpl_s_cfg},
762+
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IE31200_RPL_HX_1), (kernel_ulong_t)&rpl_s_cfg},
743763
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IE31200_ADL_S_1), (kernel_ulong_t)&rpl_s_cfg},
764+
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IE31200_BTL_S_1), (kernel_ulong_t)&rpl_s_cfg},
765+
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IE31200_BTL_S_2), (kernel_ulong_t)&rpl_s_cfg},
766+
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IE31200_BTL_S_3), (kernel_ulong_t)&rpl_s_cfg},
767+
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IE31200_BTL_S_4), (kernel_ulong_t)&rpl_s_cfg},
768+
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IE31200_BTL_S_5), (kernel_ulong_t)&rpl_s_cfg},
769+
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IE31200_BTL_S_6), (kernel_ulong_t)&rpl_s_cfg},
770+
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IE31200_BTL_S_7), (kernel_ulong_t)&rpl_s_cfg},
771+
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IE31200_BTL_S_8), (kernel_ulong_t)&rpl_s_cfg},
772+
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IE31200_BTL_S_9), (kernel_ulong_t)&rpl_s_cfg},
773+
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IE31200_BTL_S_10), (kernel_ulong_t)&rpl_s_cfg},
744774
{ 0, } /* 0 terminated list. */
745775
};
746776
MODULE_DEVICE_TABLE(pci, ie31200_pci_tbl);

drivers/edac/igen6_edac.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,9 @@ static struct work_struct ecclog_work;
275275
#define DID_PTL_H_SKU2 0xb001
276276
#define DID_PTL_H_SKU3 0xb002
277277

278+
/* Compute die IDs for Wildcat Lake with IBECC */
279+
#define DID_WCL_SKU1 0xfd00
280+
278281
static int get_mchbar(struct pci_dev *pdev, u64 *mchbar)
279282
{
280283
union {
@@ -569,6 +572,17 @@ static struct res_config mtl_p_cfg = {
569572
.err_addr_to_imc_addr = adl_err_addr_to_imc_addr,
570573
};
571574

575+
static struct res_config wcl_cfg = {
576+
.machine_check = true,
577+
.num_imc = 1,
578+
.imc_base = 0xd800,
579+
.ibecc_base = 0xd400,
580+
.ibecc_error_log_offset = 0x170,
581+
.ibecc_available = mtl_p_ibecc_available,
582+
.err_addr_to_sys_addr = adl_err_addr_to_sys_addr,
583+
.err_addr_to_imc_addr = adl_err_addr_to_imc_addr,
584+
};
585+
572586
static struct pci_device_id igen6_pci_tbl[] = {
573587
{ PCI_VDEVICE(INTEL, DID_EHL_SKU5), (kernel_ulong_t)&ehl_cfg },
574588
{ PCI_VDEVICE(INTEL, DID_EHL_SKU6), (kernel_ulong_t)&ehl_cfg },
@@ -622,6 +636,7 @@ static struct pci_device_id igen6_pci_tbl[] = {
622636
{ PCI_VDEVICE(INTEL, DID_PTL_H_SKU1), (kernel_ulong_t)&mtl_p_cfg },
623637
{ PCI_VDEVICE(INTEL, DID_PTL_H_SKU2), (kernel_ulong_t)&mtl_p_cfg },
624638
{ PCI_VDEVICE(INTEL, DID_PTL_H_SKU3), (kernel_ulong_t)&mtl_p_cfg },
639+
{ PCI_VDEVICE(INTEL, DID_WCL_SKU1), (kernel_ulong_t)&wcl_cfg },
625640
{ },
626641
};
627642
MODULE_DEVICE_TABLE(pci, igen6_pci_tbl);
@@ -1351,7 +1366,7 @@ static int igen6_register_mcis(struct pci_dev *pdev, u64 mchbar)
13511366
}
13521367

13531368
if (lmc < res_cfg->num_imc) {
1354-
igen6_printk(KERN_WARNING, "Expected %d mcs, but only %d detected.",
1369+
igen6_printk(KERN_DEBUG, "Expected %d mcs, but only %d detected.",
13551370
res_cfg->num_imc, lmc);
13561371
res_cfg->num_imc = lmc;
13571372
}

drivers/edac/mem_repair.c

Lines changed: 22 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -286,17 +286,26 @@ static umode_t mem_repair_attr_visible(struct kobject *kobj, struct attribute *a
286286
return 0;
287287
}
288288

289-
#define MR_ATTR_RO(_name, _instance) \
290-
((struct edac_mem_repair_dev_attr) { .dev_attr = __ATTR_RO(_name), \
291-
.instance = _instance })
292-
293-
#define MR_ATTR_WO(_name, _instance) \
294-
((struct edac_mem_repair_dev_attr) { .dev_attr = __ATTR_WO(_name), \
295-
.instance = _instance })
296-
297-
#define MR_ATTR_RW(_name, _instance) \
298-
((struct edac_mem_repair_dev_attr) { .dev_attr = __ATTR_RW(_name), \
299-
.instance = _instance })
289+
static const struct device_attribute mem_repair_dev_attr[] = {
290+
[MR_TYPE] = __ATTR_RO(repair_type),
291+
[MR_PERSIST_MODE] = __ATTR_RW(persist_mode),
292+
[MR_SAFE_IN_USE] = __ATTR_RO(repair_safe_when_in_use),
293+
[MR_HPA] = __ATTR_RW(hpa),
294+
[MR_MIN_HPA] = __ATTR_RO(min_hpa),
295+
[MR_MAX_HPA] = __ATTR_RO(max_hpa),
296+
[MR_DPA] = __ATTR_RW(dpa),
297+
[MR_MIN_DPA] = __ATTR_RO(min_dpa),
298+
[MR_MAX_DPA] = __ATTR_RO(max_dpa),
299+
[MR_NIBBLE_MASK] = __ATTR_RW(nibble_mask),
300+
[MR_BANK_GROUP] = __ATTR_RW(bank_group),
301+
[MR_BANK] = __ATTR_RW(bank),
302+
[MR_RANK] = __ATTR_RW(rank),
303+
[MR_ROW] = __ATTR_RW(row),
304+
[MR_COLUMN] = __ATTR_RW(column),
305+
[MR_CHANNEL] = __ATTR_RW(channel),
306+
[MR_SUB_CHANNEL] = __ATTR_RW(sub_channel),
307+
[MEM_DO_REPAIR] = __ATTR_WO(repair)
308+
};
300309

301310
static int mem_repair_create_desc(struct device *dev,
302311
const struct attribute_group **attr_groups,
@@ -305,34 +314,13 @@ static int mem_repair_create_desc(struct device *dev,
305314
struct edac_mem_repair_context *ctx;
306315
struct attribute_group *group;
307316
int i;
308-
struct edac_mem_repair_dev_attr dev_attr[] = {
309-
[MR_TYPE] = MR_ATTR_RO(repair_type, instance),
310-
[MR_PERSIST_MODE] = MR_ATTR_RW(persist_mode, instance),
311-
[MR_SAFE_IN_USE] = MR_ATTR_RO(repair_safe_when_in_use, instance),
312-
[MR_HPA] = MR_ATTR_RW(hpa, instance),
313-
[MR_MIN_HPA] = MR_ATTR_RO(min_hpa, instance),
314-
[MR_MAX_HPA] = MR_ATTR_RO(max_hpa, instance),
315-
[MR_DPA] = MR_ATTR_RW(dpa, instance),
316-
[MR_MIN_DPA] = MR_ATTR_RO(min_dpa, instance),
317-
[MR_MAX_DPA] = MR_ATTR_RO(max_dpa, instance),
318-
[MR_NIBBLE_MASK] = MR_ATTR_RW(nibble_mask, instance),
319-
[MR_BANK_GROUP] = MR_ATTR_RW(bank_group, instance),
320-
[MR_BANK] = MR_ATTR_RW(bank, instance),
321-
[MR_RANK] = MR_ATTR_RW(rank, instance),
322-
[MR_ROW] = MR_ATTR_RW(row, instance),
323-
[MR_COLUMN] = MR_ATTR_RW(column, instance),
324-
[MR_CHANNEL] = MR_ATTR_RW(channel, instance),
325-
[MR_SUB_CHANNEL] = MR_ATTR_RW(sub_channel, instance),
326-
[MEM_DO_REPAIR] = MR_ATTR_WO(repair, instance)
327-
};
328-
329317
ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
330318
if (!ctx)
331319
return -ENOMEM;
332320

333321
for (i = 0; i < MR_MAX_ATTRS; i++) {
334-
memcpy(&ctx->mem_repair_dev_attr[i],
335-
&dev_attr[i], sizeof(dev_attr[i]));
322+
ctx->mem_repair_dev_attr[i].dev_attr = mem_repair_dev_attr[i];
323+
ctx->mem_repair_dev_attr[i].instance = instance;
336324
sysfs_attr_init(&ctx->mem_repair_dev_attr[i].dev_attr.attr);
337325
ctx->mem_repair_attrs[i] =
338326
&ctx->mem_repair_dev_attr[i].dev_attr.attr;

drivers/edac/skx_common.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -670,12 +670,12 @@ static void skx_mce_output_error(struct mem_ctl_info *mci,
670670
}
671671

672672
if (res->decoded_by_adxl) {
673-
len = snprintf(skx_msg, MSG_SIZE, "%s%s err_code:0x%04x:0x%04x %s",
673+
len = scnprintf(skx_msg, MSG_SIZE, "%s%s err_code:0x%04x:0x%04x %s",
674674
overflow ? " OVERFLOW" : "",
675675
(uncorrected_error && recoverable) ? " recoverable" : "",
676676
mscod, errcode, adxl_msg);
677677
} else {
678-
len = snprintf(skx_msg, MSG_SIZE,
678+
len = scnprintf(skx_msg, MSG_SIZE,
679679
"%s%s err_code:0x%04x:0x%04x ProcessorSocketId:0x%x MemoryControllerId:0x%x PhysicalRankId:0x%x Row:0x%x Column:0x%x Bank:0x%x BankGroup:0x%x",
680680
overflow ? " OVERFLOW" : "",
681681
(uncorrected_error && recoverable) ? " recoverable" : "",

0 commit comments

Comments
 (0)