From: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
To: Tony Luck <tony.luck@intel.com>, Borislav Petkov <bp@alien8.de>
Cc: Qiuxu Zhuo <qiuxu.zhuo@intel.com>, Yi Lai <yi1.lai@intel.com>,
linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 4/8] EDAC/{skx_common,i10nm}: Introduce rrl_ctrl_mode
Date: Thu, 21 May 2026 15:31:08 +0800 [thread overview]
Message-ID: <20260521073112.3881223-5-qiuxu.zhuo@intel.com> (raw)
In-Reply-To: <20260521073112.3881223-1-qiuxu.zhuo@intel.com>
RRL (Retry Read error Log) ownership is currently inferred from
retry_rd_err_log magic values, making control semantics implicit
and harder to understand.
Introduce rrl_ctrl_mode to explicitly describe whether RRL is
controlled by none, BIOS, or Linux, and replace direct checks with
named control states to improve readability and maintainability.
No functional change intended.
Tested-by: Yi Lai <yi1.lai@intel.com>
Signed-off-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
---
drivers/edac/i10nm_base.c | 7 ++++---
drivers/edac/skx_common.h | 11 +++++++++++
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/drivers/edac/i10nm_base.c b/drivers/edac/i10nm_base.c
index 01cc86f697c8..fe148f1f2319 100644
--- a/drivers/edac/i10nm_base.c
+++ b/drivers/edac/i10nm_base.c
@@ -333,7 +333,7 @@ static void show_retry_rd_err_log(struct decoded_addr *res, char *msg,
n += scnprintf(msg + n, len - n, "%.16llx ", log);
/* Clear RRL status if RRL in Linux control mode. */
- if (retry_rd_err_log == 2 && !j && (log & status_mask))
+ if (res_cfg->rrl_ctrl_mode == RRL_CTRL_LINUX && !j && (log & status_mask))
skx_write_imc_reg(imc, ch, offset, width, log & ~status_mask);
}
}
@@ -1207,9 +1207,10 @@ static int __init i10nm_init(void)
mce_register_decode_chain(&i10nm_mce_dec);
skx_setup_debug("i10nm_test");
+ res_cfg->rrl_ctrl_mode = retry_rd_err_log;
if (retry_rd_err_log && res_cfg->reg_rrl_ddr) {
skx_set_show_rrl(show_retry_rd_err_log);
- if (retry_rd_err_log == 2)
+ if (retry_rd_err_log == RRL_CTRL_LINUX)
enable_retry_rd_err_log(true);
}
@@ -1230,7 +1231,7 @@ static void __exit i10nm_exit(void)
skx_set_decode(NULL);
if (retry_rd_err_log && res_cfg->reg_rrl_ddr) {
- if (retry_rd_err_log == 2)
+ if (retry_rd_err_log == RRL_CTRL_LINUX)
enable_retry_rd_err_log(false);
skx_set_show_rrl(NULL);
}
diff --git a/drivers/edac/skx_common.h b/drivers/edac/skx_common.h
index f7f016db122f..4091431356d6 100644
--- a/drivers/edac/skx_common.h
+++ b/drivers/edac/skx_common.h
@@ -93,6 +93,15 @@ enum rrl_source_type {
RRL_SRC_FRE_DEMAND,
};
+enum rrl_ctrl_mode {
+ /* Linux does not control RRL or reports values. */
+ RRL_CTRL_NONE,
+ /* Firmware retains control. Linux only reports values. */
+ RRL_CTRL_BIOS,
+ /* Linux takes control, resets mode bits, and clears valid/UC bits; reports values. */
+ RRL_CTRL_LINUX,
+};
+
/* RRL registers per {,sub-,pseudo-}channel. */
struct reg_rrl {
/* RRL register parts. */
@@ -272,6 +281,8 @@ struct res_config {
struct reg_rrl *reg_rrl_ddr;
/* RRL register sets per HBM channel */
struct reg_rrl *reg_rrl_hbm[2];
+ /* RRL control mode */
+ enum rrl_ctrl_mode rrl_ctrl_mode;
union {
/* {skx,i10nm}_edac */
struct {
--
2.43.0
next prev parent reply other threads:[~2026-05-21 7:39 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-21 7:31 [PATCH 0/8] EDAC: Add RRL support for Intel Diamond Rapids servers Qiuxu Zhuo
2026-05-21 7:31 ` [PATCH 1/8] EDAC/{skx_common,i10nm,imh}: Move MC register access helpers to skx_common Qiuxu Zhuo
2026-06-15 2:26 ` Borislav Petkov
2026-06-16 2:02 ` Zhuo, Qiuxu
2026-05-21 7:31 ` [PATCH 2/8] EDAC/{skx_common,skx,i10nm}: Split skx_set_decode() Qiuxu Zhuo
2026-05-21 7:31 ` [PATCH 3/8] EDAC/{skx_common,i10nm}: Rename rrl_mode to rrl_source_type Qiuxu Zhuo
2026-05-21 7:31 ` Qiuxu Zhuo [this message]
2026-05-21 7:31 ` [PATCH 5/8] EDAC/{skx_common,i10nm}: Move RRL handling to common code Qiuxu Zhuo
2026-05-21 7:31 ` [PATCH 6/8] EDAC/skx_common: Add SubChannel support to ADXL decode Qiuxu Zhuo
2026-05-21 7:31 ` [PATCH 7/8] EDAC/{skx_common,i10nm}: Prepare RRL for sub-channel granularity Qiuxu Zhuo
2026-05-21 7:31 ` [PATCH 8/8] EDAC/imh: Add RRL support for Intel Diamond Rapids server Qiuxu Zhuo
2026-05-27 16:18 ` [PATCH 0/8] EDAC: Add RRL support for Intel Diamond Rapids servers Luck, Tony
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260521073112.3881223-5-qiuxu.zhuo@intel.com \
--to=qiuxu.zhuo@intel.com \
--cc=bp@alien8.de \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tony.luck@intel.com \
--cc=yi1.lai@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox