[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250519152348.2839-1-vulab@iscas.ac.cn>
Date: Mon, 19 May 2025 23:23:48 +0800
From: Wentao Liang <vulab@...as.ac.cn>
To: sgoutham@...vell.com,
andrew+netdev@...n.ch,
davem@...emloft.net,
edumazet@...gle.com,
kuba@...nel.org,
pabeni@...hat.com
Cc: linux-arm-kernel@...ts.infradead.org,
netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
Wentao Liang <vulab@...as.ac.cn>
Subject: [PATCH] net: cavium: thunder: Add log for verification fail in bgx_poll_for_link()
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@...as.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
Powered by blists - more mailing lists