From e3a2d1cecff285a5b568a0551316d969ae378317 Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Tue, 23 Sep 2025 18:08:58 +0530 Subject: [PATCH] soc/qualcomm/qclib: Improve logging on invalid MRC cache data This patch downgrades the message severity from BIOS_ERR to BIOS_WARNING when mrc_cache_load_current() returns an invalid size (typically during the first boot or after firmware update). The failure to load previously saved MRC training data from flash is often non-fatal, as the system can typically proceed to perform a full memory training run. Therefore, a warning is more appropriate. The message is also updated to provide crucial diagnostic information, including the actual and expected data sizes, which aids in debugging cache corruption or version mismatch issues. w/o this patch ``` [ERROR] Unable to load previous training data. ``` w/ this patch ``` [WARN ] qclib: Invalid MRC data in flash (size: 0xffffffffffffffff, expected: 0x10000) ``` Change-Id: I810c868adf923e4527abe06a857b15950aa8f17a Signed-off-by: Subrata Banik Reviewed-on: https://review.coreboot.org/c/coreboot/+/89315 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Kapil Porwal --- src/soc/qualcomm/common/qclib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/soc/qualcomm/common/qclib.c b/src/soc/qualcomm/common/qclib.c index 1daa14b328..fa12ed9634 100644 --- a/src/soc/qualcomm/common/qclib.c +++ b/src/soc/qualcomm/common/qclib.c @@ -259,7 +259,8 @@ void qclib_load_and_run(void) data_size = mrc_cache_load_current(MRC_TRAINING_DATA, QCLIB_VERSION, _ddr_training, REGION_SIZE(ddr_training)); if (data_size < 0) { - printk(BIOS_ERR, "Unable to load previous training data.\n"); + printk(BIOS_WARNING, "qclib: Invalid MRC data in flash (size: %#zx, expected: %#zx)\n", + data_size, REGION_SIZE(ddr_training)); memset(_ddr_training, 0, REGION_SIZE(ddr_training)); data_size = REGION_SIZE(ddr_training); }