Commit 267e5b1d authored by Qiuxu Zhuo's avatar Qiuxu Zhuo Committed by Tony Luck
Browse files

EDAC/igen6: Fix the flood of invalid error reports



The ECC_ERROR_LOG register of certain SoCs may contain the invalid value
~0, which results in a flood of invalid error reports in polling mode.

Fix the flood of invalid error reports by skipping the invalid ECC error
log value ~0.

Fixes: e14232af ("EDAC/igen6: Add polling support")
Reported-by: default avatarRamses <ramses@well-founded.dev>
Closes: https://lore.kernel.org/all/OISL8Rv--F-9@well-founded.dev/


Tested-by: default avatarRamses <ramses@well-founded.dev>
Reported-by: default avatarJohn <therealgraysky@proton.me>
Closes: https://lore.kernel.org/all/p5YcxOE6M3Ncxpn2-Ia_wCt61EM4LwIiN3LroQvT_-G2jMrFDSOW5k2A9D8UUzD2toGpQBN1eI0sL5dSKnkO8iteZegLoQEj-DwQaMhGx4A=@proton.me/


Tested-by: default avatarJohn <therealgraysky@proton.me>
Signed-off-by: default avatarQiuxu Zhuo <qiuxu.zhuo@intel.com>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
Link: https://lore.kernel.org/r/20250212083354.31919-1-qiuxu.zhuo@intel.com
parent c29dfd66
Loading
Loading
Loading
Loading
+15 −6
Original line number Diff line number Diff line
@@ -785,13 +785,22 @@ static u64 ecclog_read_and_clear(struct igen6_imc *imc)
{
	u64 ecclog = readq(imc->window + ECC_ERROR_LOG_OFFSET);

	if (ecclog & (ECC_ERROR_LOG_CE | ECC_ERROR_LOG_UE)) {
	/*
	 * Quirk: The ECC_ERROR_LOG register of certain SoCs may contain
	 *        the invalid value ~0. This will result in a flood of invalid
	 *        error reports in polling mode. Skip it.
	 */
	if (ecclog == ~0)
		return 0;

	/* Neither a CE nor a UE. Skip it.*/
	if (!(ecclog & (ECC_ERROR_LOG_CE | ECC_ERROR_LOG_UE)))
		return 0;

	/* Clear CE/UE bits by writing 1s */
	writeq(ecclog, imc->window + ECC_ERROR_LOG_OFFSET);
		return ecclog;
	}

	return 0;
	return ecclog;
}

static void errsts_clear(struct igen6_imc *imc)