* [PATCH net] net: cxgb3: Ignore link changes on PHY read errors
@ 2026-08-14 13:39 Ruoyu Wang
2026-08-18 16:40 ` Jakub Kicinski
0 siblings, 1 reply; 2+ messages in thread
From: Ruoyu Wang @ 2026-08-14 13:39 UTC (permalink / raw)
To: Potnuri Bharat Teja, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Jeff Garzik, Divy Le Ray
Cc: netdev, linux-kernel, Ruoyu Wang
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 <ruoyuw560@gmail.com>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] net: cxgb3: Ignore link changes on PHY read errors
2026-08-14 13:39 [PATCH net] net: cxgb3: Ignore link changes on PHY read errors Ruoyu Wang
@ 2026-08-18 16:40 ` Jakub Kicinski
0 siblings, 0 replies; 2+ messages in thread
From: Jakub Kicinski @ 2026-08-18 16:40 UTC (permalink / raw)
To: Ruoyu Wang
Cc: Potnuri Bharat Teja, Andrew Lunn, David S. Miller, Eric Dumazet,
Paolo Abeni, Jeff Garzik, Divy Le Ray, netdev, linux-kernel
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-08-18 16:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-14 13:39 [PATCH net] net: cxgb3: Ignore link changes on PHY read errors Ruoyu Wang
2026-08-18 16:40 ` Jakub Kicinski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox