Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next 1/4] net: phy: as21xxx: handle corner case with link and autoneg complete
@ 2026-05-28 19:35 Christian Marangi
  2026-05-28 19:35 ` [PATCH net-next 2/4] net: phy: as21xxx: fix read_status speed handling Christian Marangi
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Christian Marangi @ 2026-05-28 19:35 UTC (permalink / raw)
  To: Christian Marangi, Andrew Lunn, Heiner Kallweit, Russell King,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	netdev, linux-kernel

Add missing case in custom read_link, when autoneg is started, autoneg
complete bit is reset but link is still not up.

Fixes: 830877d89edc ("net: phy: Add support for Aeonsemi AS21xxx PHYs")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
 drivers/net/phy/as21xxx.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/phy/as21xxx.c b/drivers/net/phy/as21xxx.c
index d5738117eca6..0db82da8dbdf 100644
--- a/drivers/net/phy/as21xxx.c
+++ b/drivers/net/phy/as21xxx.c
@@ -658,6 +658,13 @@ static int as21xxx_read_link(struct phy_device *phydev, int *bmcr)
 		return status;
 
 	phydev->link = !!(status & MDIO_STAT1_LSTATUS);
+	phydev->autoneg_complete = !!(status & MDIO_AN_STAT1_COMPLETE);
+
+	/* Consider the case that autoneg was started and "aneg complete"
+	 * bit has been reset, but "link up" bit not yet.
+	 */
+	if (phydev->autoneg == AUTONEG_ENABLE && !phydev->autoneg_complete)
+		phydev->link = 0;
 
 	return 0;
 }
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-05-28 19:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-28 19:35 [PATCH net-next 1/4] net: phy: as21xxx: handle corner case with link and autoneg complete Christian Marangi
2026-05-28 19:35 ` [PATCH net-next 2/4] net: phy: as21xxx: fix read_status speed handling Christian Marangi
2026-05-28 19:35 ` [PATCH net-next 3/4] net: phy: as21xxx: force C45 OPs for AUTONEG Christian Marangi
2026-05-28 19:35 ` [PATCH net-next 4/4] net: phy: as21xxx: fill in inband caps Christian Marangi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox