Re: [PATCH net-next v5 2/6] net: usb: lan78xx: Convert to PHYlink for improved PHY and MAC management
From: Maxime Chevallier
Date: Wed Mar 19 2025 - 06:48:30 EST
Hi Oleksij,
On Wed, 19 Mar 2025 09:49:48 +0100
Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx> wrote:
> Convert the LAN78xx driver to use the PHYlink framework for managing
> PHY and MAC interactions.
>
> Key changes include:
> - Replace direct PHY operations with phylink equivalents (e.g.,
> phylink_start, phylink_stop).
> - Introduce lan78xx_phylink_setup for phylink initialization and
> configuration.
> - Add phylink MAC operations (lan78xx_mac_config,
> lan78xx_mac_link_down, lan78xx_mac_link_up) for managing link
> settings and flow control.
> - Remove redundant and now phylink-managed functions like
> `lan78xx_link_status_change`.
> - update lan78xx_get/set_pause to use phylink helpers
>
> Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
[...]
> @@ -5158,7 +5137,7 @@ static int lan78xx_reset_resume(struct usb_interface *intf)
> if (ret < 0)
> return ret;
>
> - phy_start(dev->net->phydev);
> + phylink_start(dev->phylink);
You need RTNL to be held when calling this function.
I'm not familiar with USB but from what I get, this function is part of
the resume path (resume by resetting). I think you also need to
address the suspend path, it still has calls to
netif_carrier_off(dev->net), and you may need to use
phylink_suspend() / phylink_resume() ? (not sure)
Maxime