Skip to content

Commit 995a6ec

Browse files
qzhuo2heftig
authored andcommitted
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: e14232a ("EDAC/igen6: Add polling support") Reported-by: Ramses <[email protected]> Closes: https://lore.kernel.org/all/[email protected]/ Tested-by: Ramses <[email protected]> Reported-by: John <[email protected]> Closes: https://lore.kernel.org/all/p5YcxOE6M3Ncxpn2-Ia_wCt61EM4LwIiN3LroQvT_-G2jMrFDSOW5k2A9D8UUzD2toGpQBN1eI0sL5dSKnkO8iteZegLoQEj-DwQaMhGx4A=@proton.me/ Tested-by: John <[email protected]> Signed-off-by: Qiuxu Zhuo <[email protected]> Signed-off-by: Tony Luck <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 9f0ea9a commit 995a6ec

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

drivers/edac/igen6_edac.c

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -785,13 +785,22 @@ static u64 ecclog_read_and_clear(struct igen6_imc *imc)
785785
{
786786
u64 ecclog = readq(imc->window + ECC_ERROR_LOG_OFFSET);
787787

788-
if (ecclog & (ECC_ERROR_LOG_CE | ECC_ERROR_LOG_UE)) {
789-
/* Clear CE/UE bits by writing 1s */
790-
writeq(ecclog, imc->window + ECC_ERROR_LOG_OFFSET);
791-
return ecclog;
792-
}
788+
/*
789+
* Quirk: The ECC_ERROR_LOG register of certain SoCs may contain
790+
* the invalid value ~0. This will result in a flood of invalid
791+
* error reports in polling mode. Skip it.
792+
*/
793+
if (ecclog == ~0)
794+
return 0;
793795

794-
return 0;
796+
/* Neither a CE nor a UE. Skip it.*/
797+
if (!(ecclog & (ECC_ERROR_LOG_CE | ECC_ERROR_LOG_UE)))
798+
return 0;
799+
800+
/* Clear CE/UE bits by writing 1s */
801+
writeq(ecclog, imc->window + ECC_ERROR_LOG_OFFSET);
802+
803+
return ecclog;
795804
}
796805

797806
static void errsts_clear(struct igen6_imc *imc)

0 commit comments

Comments
 (0)