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

Wentao Liang vulab at iscas.ac.cn
Mon May 19 08:23:48 PDT 2025


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 at iscas.ac.cn>
---
 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




More information about the linux-arm-kernel mailing list