mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2025-11-01 07:28:49 +00:00
Add pending patch to make address some workaround needed to make the Aeonsemi AS21xxx PHY working on the Airoha AN7581/AN7583 board. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
32 lines
1.0 KiB
Diff
32 lines
1.0 KiB
Diff
From 0146a02d9d182796c3d8e4a432c4d94cac042f8e Mon Sep 17 00:00:00 2001
|
|
From: Christian Marangi <ansuelsmth@gmail.com>
|
|
Date: Mon, 7 Jul 2025 18:58:25 +0200
|
|
Subject: [PATCH 1/4] net: phy: as21xxx: handle corner case with link and
|
|
autoneg complete
|
|
|
|
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(+)
|
|
|
|
--- a/drivers/net/phy/as21xxx.c
|
|
+++ b/drivers/net/phy/as21xxx.c
|
|
@@ -658,6 +658,13 @@ static int as21xxx_read_link(struct phy_
|
|
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;
|
|
}
|