[PATCH] net: cavium: thunder: Add log for verification fail in bgx_poll_for_link()

From: Wentao Liang
Date: Mon May 19 2025 - 11:24:42 EST


The bgx_poll_for_link() calls bgx_poll_reg() but does not handle the
return value. The link setting is not verified if the polling operation
times out. It helps to debug if the link polling fails.

Add a time out error log for bgx_poll_reg().

Signed-off-by: Wentao Liang <vulab@xxxxxxxxxxx>
---
drivers/net/ethernet/cavium/thunder/thunder_bgx.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
index 608cc6af5af1..eadc58de35ac 100644
--- a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
+++ b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
@@ -1007,8 +1007,9 @@ static void bgx_poll_for_link(struct work_struct *work)
/* Receive link is latching low. Force it high and verify it */
bgx_reg_modify(lmac->bgx, lmac->lmacid,
BGX_SPUX_STATUS1, SPU_STATUS1_RCV_LNK);
- bgx_poll_reg(lmac->bgx, lmac->lmacid, BGX_SPUX_STATUS1,
- SPU_STATUS1_RCV_LNK, false);
+ if (bgx_poll_reg(lmac->bgx, lmac->lmacid, BGX_SPUX_STATUS1,
+ SPU_STATUS1_RCV_LNK, false))
+ dev_err(lmac->bgx->pdev->dev, "BXG verification fail with time out.\n");

spu_link = bgx_reg_read(lmac->bgx, lmac->lmacid, BGX_SPUX_STATUS1);
smu_link = bgx_reg_read(lmac->bgx, lmac->lmacid, BGX_SMUX_RX_CTL);
--
2.42.0.windows.2