[PATCH net-next v2 4/7] net: lan743x: keep the fixed link across reopen

From: Chris Babroski

Date: Tue Nov 24 2026 - 09:35:06 EST


On LAN7431 and PCI11x1x boards with no DT node and no PHY on the MDIO
bus, lan743x_phylink_connect() falls back to a fixed link with
phylink_set_fixed_link(). That switches phylink to fixed-link mode,
which neither phylink_stop() nor phylink_disconnect_phy() undoes.
phylink_set_fixed_link() only accepts a phylink that is still in PHY
mode, so it returns -EINVAL on every later open and the open fails. The
interface cannot be brought up again once it has been taken down, and
the reopen on resume fails the same way.

If phylink no longer expects a PHY, the fixed link from the earlier open
is still configured, so only start phylink.

Fixes: a5f199a8d8a0 ("net: lan743x: Migrate phylib to phylink")
Signed-off-by: Chris Babroski <cbabroski@xxxxxxxxxx>
---
drivers/net/ethernet/microchip/lan743x_main.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/microchip/lan743x_main.c b/drivers/net/ethernet/microchip/lan743x_main.c
index 8eb0645493e6..b226078bf3a9 100644
--- a/drivers/net/ethernet/microchip/lan743x_main.c
+++ b/drivers/net/ethernet/microchip/lan743x_main.c
@@ -3318,6 +3318,12 @@ static int lan743x_phylink_connect(struct lan743x_adapter *adapter)
struct phy_device *phydev;
int ret;

+ /* A fixed link set up by an earlier open is still in place */
+ if (!phylink_expects_phy(adapter->phylink)) {
+ phylink_start(adapter->phylink);
+ return 0;
+ }
+
if (dn)
ret = phylink_of_phy_connect(adapter->phylink, dn, 0);

--
2.34.1