Skip to content

Commit 73267f7

Browse files
committed
EDAC/i10nm: Print an extra register set of retry_rd_err_log
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2165650 Tested: tested with the EMR machine we have in the lab commit d5f5e49 Author: Qiuxu Zhuo <qiuxu.zhuo@intel.com> Date: Fri Jul 22 16:33:37 2022 -0700 EDAC/i10nm: Print an extra register set of retry_rd_err_log Sapphire Rapids server adds an extra register set for logging more retry_rd_err_log data. So add code to print the extra register set. Signed-off-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com> Signed-off-by: Tony Luck <tony.luck@intel.com> Link: https://lore.kernel.org/all/20220722233338.341567-1-tony.luck@intel.com Signed-off-by: Aristeu Rozanski <arozansk@redhat.com>
1 parent e53951f commit 73267f7

File tree

2 files changed

+72
-11
lines changed

2 files changed

+72
-11
lines changed

drivers/edac/i10nm_base.c

Lines changed: 70 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,26 +81,38 @@ static u32 offsets_scrub_spr_hbm0[] = {0x2860, 0x2854, 0x2b08, 0x2858, 0x2828,
8181
static u32 offsets_scrub_spr_hbm1[] = {0x2c60, 0x2c54, 0x2f08, 0x2c58, 0x2c28, 0x0fa8};
8282
static u32 offsets_demand_icx[] = {0x22e54, 0x22e60, 0x22e64, 0x22e58, 0x22e5c, 0x20ee0};
8383
static u32 offsets_demand_spr[] = {0x22e54, 0x22e60, 0x22f10, 0x22e58, 0x22e5c, 0x20ee0};
84+
static u32 offsets_demand2_spr[] = {0x22c70, 0x22d80, 0x22f18, 0x22d58, 0x22c64, 0x20f10};
8485
static u32 offsets_demand_spr_hbm0[] = {0x2a54, 0x2a60, 0x2b10, 0x2a58, 0x2a5c, 0x0ee0};
8586
static u32 offsets_demand_spr_hbm1[] = {0x2e54, 0x2e60, 0x2f10, 0x2e58, 0x2e5c, 0x0fb0};
8687

8788
static void __enable_retry_rd_err_log(struct skx_imc *imc, int chan, bool enable,
88-
u32 *offsets_scrub, u32 *offsets_demand)
89+
u32 *offsets_scrub, u32 *offsets_demand,
90+
u32 *offsets_demand2)
8991
{
90-
u32 s, d;
92+
u32 s, d, d2;
9193

9294
s = I10NM_GET_REG32(imc, chan, offsets_scrub[0]);
9395
d = I10NM_GET_REG32(imc, chan, offsets_demand[0]);
96+
if (offsets_demand2)
97+
d2 = I10NM_GET_REG32(imc, chan, offsets_demand2[0]);
9498

9599
if (enable) {
96100
/* Save default configurations */
97101
imc->chan[chan].retry_rd_err_log_s = s;
98102
imc->chan[chan].retry_rd_err_log_d = d;
103+
if (offsets_demand2)
104+
imc->chan[chan].retry_rd_err_log_d2 = d2;
99105

100106
s &= ~RETRY_RD_ERR_LOG_NOOVER_UC;
101107
s |= RETRY_RD_ERR_LOG_EN;
102108
d &= ~RETRY_RD_ERR_LOG_NOOVER_UC;
103109
d |= RETRY_RD_ERR_LOG_EN;
110+
111+
if (offsets_demand2) {
112+
d2 &= ~RETRY_RD_ERR_LOG_UC;
113+
d2 |= RETRY_RD_ERR_LOG_NOOVER;
114+
d2 |= RETRY_RD_ERR_LOG_EN;
115+
}
104116
} else {
105117
/* Restore default configurations */
106118
if (imc->chan[chan].retry_rd_err_log_s & RETRY_RD_ERR_LOG_UC)
@@ -115,10 +127,21 @@ static void __enable_retry_rd_err_log(struct skx_imc *imc, int chan, bool enable
115127
d |= RETRY_RD_ERR_LOG_NOOVER;
116128
if (!(imc->chan[chan].retry_rd_err_log_d & RETRY_RD_ERR_LOG_EN))
117129
d &= ~RETRY_RD_ERR_LOG_EN;
130+
131+
if (offsets_demand2) {
132+
if (imc->chan[chan].retry_rd_err_log_d2 & RETRY_RD_ERR_LOG_UC)
133+
d2 |= RETRY_RD_ERR_LOG_UC;
134+
if (!(imc->chan[chan].retry_rd_err_log_d2 & RETRY_RD_ERR_LOG_NOOVER))
135+
d2 &= ~RETRY_RD_ERR_LOG_NOOVER;
136+
if (!(imc->chan[chan].retry_rd_err_log_d2 & RETRY_RD_ERR_LOG_EN))
137+
d2 &= ~RETRY_RD_ERR_LOG_EN;
138+
}
118139
}
119140

120141
I10NM_SET_REG32(imc, chan, offsets_scrub[0], s);
121142
I10NM_SET_REG32(imc, chan, offsets_demand[0], d);
143+
if (offsets_demand2)
144+
I10NM_SET_REG32(imc, chan, offsets_demand2[0], d2);
122145
}
123146

124147
static void enable_retry_rd_err_log(bool enable)
@@ -139,14 +162,17 @@ static void enable_retry_rd_err_log(bool enable)
139162
if (imc->hbm_mc) {
140163
__enable_retry_rd_err_log(imc, j, enable,
141164
res_cfg->offsets_scrub_hbm0,
142-
res_cfg->offsets_demand_hbm0);
165+
res_cfg->offsets_demand_hbm0,
166+
NULL);
143167
__enable_retry_rd_err_log(imc, j, enable,
144168
res_cfg->offsets_scrub_hbm1,
145-
res_cfg->offsets_demand_hbm1);
169+
res_cfg->offsets_demand_hbm1,
170+
NULL);
146171
} else {
147172
__enable_retry_rd_err_log(imc, j, enable,
148173
res_cfg->offsets_scrub,
149-
res_cfg->offsets_demand);
174+
res_cfg->offsets_demand,
175+
res_cfg->offsets_demand2);
150176
}
151177
}
152178
}
@@ -158,7 +184,10 @@ static void show_retry_rd_err_log(struct decoded_addr *res, char *msg,
158184
struct skx_imc *imc = &res->dev->imc[res->imc];
159185
u32 log0, log1, log2, log3, log4;
160186
u32 corr0, corr1, corr2, corr3;
187+
u32 lxg0, lxg1, lxg3, lxg4;
188+
u32 *xffsets = NULL;
161189
u64 log2a, log5;
190+
u64 lxg2a, lxg5;
162191
u32 *offsets;
163192
int n, pch;
164193

@@ -175,8 +204,12 @@ static void show_retry_rd_err_log(struct decoded_addr *res, char *msg,
175204
offsets = scrub_err ? res_cfg->offsets_scrub_hbm0 :
176205
res_cfg->offsets_demand_hbm0;
177206
} else {
178-
offsets = scrub_err ? res_cfg->offsets_scrub :
179-
res_cfg->offsets_demand;
207+
if (scrub_err) {
208+
offsets = res_cfg->offsets_scrub;
209+
} else {
210+
offsets = res_cfg->offsets_demand;
211+
xffsets = res_cfg->offsets_demand2;
212+
}
180213
}
181214

182215
log0 = I10NM_GET_REG32(imc, res->channel, offsets[0]);
@@ -185,10 +218,28 @@ static void show_retry_rd_err_log(struct decoded_addr *res, char *msg,
185218
log4 = I10NM_GET_REG32(imc, res->channel, offsets[4]);
186219
log5 = I10NM_GET_REG64(imc, res->channel, offsets[5]);
187220

221+
if (xffsets) {
222+
lxg0 = I10NM_GET_REG32(imc, res->channel, xffsets[0]);
223+
lxg1 = I10NM_GET_REG32(imc, res->channel, xffsets[1]);
224+
lxg3 = I10NM_GET_REG32(imc, res->channel, xffsets[3]);
225+
lxg4 = I10NM_GET_REG32(imc, res->channel, xffsets[4]);
226+
lxg5 = I10NM_GET_REG64(imc, res->channel, xffsets[5]);
227+
}
228+
188229
if (res_cfg->type == SPR) {
189230
log2a = I10NM_GET_REG64(imc, res->channel, offsets[2]);
190-
n = snprintf(msg, len, " retry_rd_err_log[%.8x %.8x %.16llx %.8x %.8x %.16llx]",
231+
n = snprintf(msg, len, " retry_rd_err_log[%.8x %.8x %.16llx %.8x %.8x %.16llx",
191232
log0, log1, log2a, log3, log4, log5);
233+
234+
if (len - n > 0) {
235+
if (xffsets) {
236+
lxg2a = I10NM_GET_REG64(imc, res->channel, xffsets[2]);
237+
n += snprintf(msg + n, len - n, " %.8x %.8x %.16llx %.8x %.8x %.16llx]",
238+
lxg0, lxg1, lxg2a, lxg3, lxg4, lxg5);
239+
} else {
240+
n += snprintf(msg + n, len - n, "]");
241+
}
242+
}
192243
} else {
193244
log2 = I10NM_GET_REG32(imc, res->channel, offsets[2]);
194245
n = snprintf(msg, len, " retry_rd_err_log[%.8x %.8x %.8x %.8x %.8x %.16llx]",
@@ -223,9 +274,16 @@ static void show_retry_rd_err_log(struct decoded_addr *res, char *msg,
223274
corr3 & 0xffff, corr3 >> 16);
224275

225276
/* Clear status bits */
226-
if (retry_rd_err_log == 2 && (log0 & RETRY_RD_ERR_LOG_OVER_UC_V)) {
227-
log0 &= ~RETRY_RD_ERR_LOG_OVER_UC_V;
228-
I10NM_SET_REG32(imc, res->channel, offsets[0], log0);
277+
if (retry_rd_err_log == 2) {
278+
if (log0 & RETRY_RD_ERR_LOG_OVER_UC_V) {
279+
log0 &= ~RETRY_RD_ERR_LOG_OVER_UC_V;
280+
I10NM_SET_REG32(imc, res->channel, offsets[0], log0);
281+
}
282+
283+
if (xffsets && (lxg0 & RETRY_RD_ERR_LOG_OVER_UC_V)) {
284+
lxg0 &= ~RETRY_RD_ERR_LOG_OVER_UC_V;
285+
I10NM_SET_REG32(imc, res->channel, xffsets[0], lxg0);
286+
}
229287
}
230288
}
231289

@@ -460,6 +518,7 @@ static struct res_config spr_cfg = {
460518
.offsets_scrub_hbm0 = offsets_scrub_spr_hbm0,
461519
.offsets_scrub_hbm1 = offsets_scrub_spr_hbm1,
462520
.offsets_demand = offsets_demand_spr,
521+
.offsets_demand2 = offsets_demand2_spr,
463522
.offsets_demand_hbm0 = offsets_demand_spr_hbm0,
464523
.offsets_demand_hbm1 = offsets_demand_spr_hbm1,
465524
};

drivers/edac/skx_common.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ struct skx_dev {
8282
struct pci_dev *edev;
8383
u32 retry_rd_err_log_s;
8484
u32 retry_rd_err_log_d;
85+
u32 retry_rd_err_log_d2;
8586
struct skx_dimm {
8687
u8 close_pg;
8788
u8 bank_xor_enable;
@@ -162,6 +163,7 @@ struct res_config {
162163
u32 *offsets_scrub_hbm0;
163164
u32 *offsets_scrub_hbm1;
164165
u32 *offsets_demand;
166+
u32 *offsets_demand2;
165167
u32 *offsets_demand_hbm0;
166168
u32 *offsets_demand_hbm1;
167169
};

0 commit comments

Comments
 (0)