[PATCH net] net: cxgb3: Ignore link changes on PHY read errors

Subsystems: cxgb3 ethernet driver (cxgb3), networking drivers, the rest

COLD20d

2 messages, 2 authors, 20d ago · open the first message on its own page

[PATCH net] net: cxgb3: Ignore link changes on PHY read errors

From: Ruoyu Wang <hidden>
Date: 2026-08-14 13:40:06

PHY link-status callbacks can fail before initializing all their output
parameters. For example, an MI1 timeout in get_link_status_r() leaves
link_ok unset, but t3_link_changed() then uses it to update MAC and
carrier state.

Return without changing link state when the callback fails. A later poll
or PHY event can retry the update with valid values.

This issue was found by a static analysis checker and confirmed by
manual source review.

Fixes: 4d22de3e6cc4 ("Add support for the latest 1G/10G Chelsio adapter, T3.")
Signed-off-by: Ruoyu Wang <redacted>
---
 drivers/net/ethernet/chelsio/cxgb3/t3_hw.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb3/t3_hw.c b/drivers/net/ethernet/chelsio/cxgb3/t3_hw.c
index a06003bfa04b9..cc04d21564253 100644
--- a/drivers/net/ethernet/chelsio/cxgb3/t3_hw.c
+++ b/drivers/net/ethernet/chelsio/cxgb3/t3_hw.c
@@ -1180,7 +1180,8 @@ void t3_link_changed(struct adapter *adapter, int port_id)
 	struct cmac *mac = &pi->mac;
 	struct link_config *lc = &pi->link_config;
 
-	phy->ops->get_link_status(phy, &link_ok, &speed, &duplex, &fc);
+	if (phy->ops->get_link_status(phy, &link_ok, &speed, &duplex, &fc))
+		return;
 
 	if (!lc->link_ok && link_ok) {
 		u32 rx_cfg, rx_hash_high, rx_hash_low;
-- 
2.51.0

Re: [PATCH net] net: cxgb3: Ignore link changes on PHY read errors

From: Jakub Kicinski <kuba@kernel.org>
Date: 2026-08-18 16:40:24

On Fri, 14 Aug 2026 21:39:59 +0800 Ruoyu Wang wrote:
PHY link-status callbacks can fail before initializing all their output
parameters. For example, an MI1 timeout in get_link_status_r() leaves
link_ok unset, but t3_link_changed() then uses it to update MAC and
carrier state.
Leave this ancient HW alone, please.
-- 
pw-bot: reject
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help