Re: [PATCH net-next v2 1/7] net: usb: lan78xx: Convert to PHYlink for improved PHY and MAC management

From: Russell King (Oracle)
Date: Mon Mar 10 2025 - 06:23:48 EST


On Mon, Mar 10, 2025 at 11:16:10AM +0100, Oleksij Rempel wrote:
> On Mon, Mar 10, 2025 at 10:11:29AM +0000, Russell King (Oracle) wrote:
> > On Mon, Mar 10, 2025 at 10:58:38AM +0100, Oleksij Rempel wrote:
> > > Hi Thangaraj,
> > >
> > > On Mon, Mar 10, 2025 at 09:29:45AM +0000, Thangaraj.S@xxxxxxxxxxxxx wrote:
> > > > > - mii_adv_to_linkmode_adv_t(fc, mii_adv);
> > > > > - linkmode_or(phydev->advertising, fc, phydev->advertising);
> > > > > + phy_suspend(phydev);
> > > > >
> > > >
> > > > Why phy_suspend called in the init? Is there any specific reason?
> > >
> > > In my tests with EVB-LAN7801-EDS, the attached PHY stayed UP in initial
> > > state.
> >
> > Why is that an issue?
>
> The local interface was in the administrative DOWN state, but link was up:
> - port LEDs are on
> - link partner sees the link is UP.
>
> It is not a big deal, but for me it looks inconsistent.

That's not an uncommon situation.

Given that the link was up for a period of time before the driver
probes, taking it down on probe, only to then have userspace then
bring the interface up and have to wait for negotiation to complete
slows down the interface initialisation.

As for the link partner, in such a situation the link partner can't
assume that this end is up _anyway_ because the link will be up
before the driver has probed.

So, I don't see the point of forcing the link down on probe.

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!