Skip to content

Commit 5904dc5

Browse files
qzhuo2aegl
authored andcommitted
EDAC/{skx_common,i10nm}: Add RRL support for Intel Granite Rapids server
Compared to previous generations, Granite Rapids defines the RRL control bits {en_patspr, noover, en} in different positions, adds an extra RRL set for the new mode of the first patrol-scrub read error, and extends the number of CORRERRCNT registers from 4 to 8, encoding one counter per CORRERRCNT register. Add a Granite Rapids reg_rrl configuration table and adjust the code to accommodate the differences mentioned above for RRL support. Signed-off-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com> Signed-off-by: Tony Luck <tony.luck@intel.com> Tested-by: Feng Xu <feng.f.xu@intel.com> Link: https://lore.kernel.org/r/20250417150724.1170168-8-qiuxu.zhuo@intel.com
1 parent 126168f commit 5904dc5

File tree

2 files changed

+37
-4
lines changed

2 files changed

+37
-4
lines changed

drivers/edac/i10nm_base.c

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,29 @@ static struct reg_rrl spr_reg_rrl_hbm_pch1 = {
164164
.cecnt_widths = {4, 4, 4, 4},
165165
};
166166

167+
static struct reg_rrl gnr_reg_rrl_ddr = {
168+
.set_num = 4,
169+
.reg_num = 6,
170+
.modes = {FRE_SCRUB, FRE_DEMAND, LRE_SCRUB, LRE_DEMAND},
171+
.offsets = {
172+
{0x2f10, 0x2f20, 0x2f30, 0x2f50, 0x2f60, 0xba0},
173+
{0x2f14, 0x2f24, 0x2f38, 0x2f54, 0x2f64, 0xba8},
174+
{0x2f18, 0x2f28, 0x2f40, 0x2f58, 0x2f68, 0xbb0},
175+
{0x2f1c, 0x2f2c, 0x2f48, 0x2f5c, 0x2f6c, 0xbb8},
176+
},
177+
.widths = {4, 4, 8, 4, 4, 8},
178+
.v_mask = BIT(0),
179+
.uc_mask = BIT(1),
180+
.over_mask = BIT(2),
181+
.en_patspr_mask = BIT(14),
182+
.noover_mask = BIT(15),
183+
.en_mask = BIT(12),
184+
185+
.cecnt_num = 8,
186+
.cecnt_offsets = {0x2c10, 0x2c14, 0x2c18, 0x2c1c, 0x2c20, 0x2c24, 0x2c28, 0x2c2c},
187+
.cecnt_widths = {4, 4, 4, 4, 4, 4, 4, 4},
188+
};
189+
167190
static u64 read_imc_reg(struct skx_imc *imc, int chan, u32 offset, u8 width)
168191
{
169192
switch (width) {
@@ -353,8 +376,17 @@ static void show_retry_rd_err_log(struct decoded_addr *res, char *msg,
353376
width = rrl->cecnt_widths[i];
354377
corr = read_imc_reg(imc, ch, offset, width);
355378

356-
n += snprintf(msg + n, len - n, "%.4llx %.4llx ",
357-
corr & 0xffff, corr >> 16);
379+
/* CPUs {ICX,SPR} encode two counters per 4-byte CORRERRCNT register. */
380+
if (res_cfg->type <= SPR) {
381+
n += snprintf(msg + n, len - n, "%.4llx %.4llx ",
382+
corr & 0xffff, corr >> 16);
383+
} else {
384+
/* CPUs {GNR} encode one counter per CORRERRCNT register. */
385+
if (width == 4)
386+
n += snprintf(msg + n, len - n, "%.8llx ", corr);
387+
else
388+
n += snprintf(msg + n, len - n, "%.16llx ", corr);
389+
}
358390
}
359391

360392
/* Move back one space. */
@@ -985,6 +1017,7 @@ static struct res_config gnr_cfg = {
9851017
.uracu_bdf = {0, 0, 1},
9861018
.ddr_mdev_bdf = {0, 5, 1},
9871019
.sad_all_offset = 0x300,
1020+
.reg_rrl_ddr = &gnr_reg_rrl_ddr,
9881021
};
9891022

9901023
static const struct x86_cpu_id i10nm_cpuids[] = {

drivers/edac/skx_common.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@
8080
#define MCACOD_EXT_MEM_ERR 0x280
8181

8282
/* Max RRL register sets per {,sub-,pseudo-}channel. */
83-
#define NUM_RRL_SET 3
83+
#define NUM_RRL_SET 4
8484
/* Max RRL registers per set. */
8585
#define NUM_RRL_REG 6
8686
/* Max correctable error count registers. */
87-
#define NUM_CECNT_REG 4
87+
#define NUM_CECNT_REG 8
8888

8989
/* Modes of RRL register set. */
9090
enum rrl_mode {

0 commit comments

Comments
 (0)