From fa1caf2d5ec6b396995ffbefbe11e6525acde6f4 Mon Sep 17 00:00:00 2001 From: Jonas Jelonek Date: Mon, 28 Sep 2026 23:17:20 +0000 Subject: [PATCH] realtek: pcs: rtl930x: fix RX calibration warning The calibration retry loop warns whenever it reaches the third attempt, even if that final attempt succeeds. Preserve the final check result and only warn when calibration actually remains unsuccessful. Assisted-by: ChatGPT (OpenAI GPT-5.6 Sol) Signed-off-by: Jonas Jelonek --- .../linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c index c748658cdf7..5f01c611e1d 100644 --- a/target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c +++ b/target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c @@ -3221,6 +3221,7 @@ static int rtpcs_930x_sds_config_attachment(struct rtpcs_serdes *sds, static int rtpcs_930x_sds_post_config(struct rtpcs_serdes *sds, enum rtpcs_sds_mode hw_mode) { + bool calib_failed; int calib_tries = 0; if (hw_mode == RTPCS_SDS_MODE_QSGMII) @@ -3231,8 +3232,9 @@ static int rtpcs_930x_sds_post_config(struct rtpcs_serdes *sds, enum rtpcs_sds_m rtpcs_930x_sds_do_rx_calibration(sds, hw_mode); calib_tries++; msleep(50); - } while (rtpcs_930x_sds_check_calibration(sds, hw_mode) && calib_tries < 3); - if (calib_tries >= 3) + calib_failed = rtpcs_930x_sds_check_calibration(sds, hw_mode); + } while (calib_failed && calib_tries < 3); + if (calib_failed) dev_warn(sds->ctrl->dev, "SerDes %u: RX calibration failed\n", sds->id); return 0;