Re: [PATCH v2 4/4] net: mtip: The L2 switch driver for imx287
From: Andrew Lunn
Date: Sun Mar 30 2025 - 18:01:54 EST
> > > + /* Prevent a state halted on mii error */
> > > + if (fep->mii_timeout && phy_dev->state == PHY_HALTED) {
> > > + phy_dev->state = PHY_UP;
> > > + goto spin_unlock;
> > > + }
> >
> > A MAC driver should not be playing around with the internal state of
> > phylib.
>
> Ok, I've replaced it with PHY API calls (phy_start() and
> phy_is_started()).
phy_start() and phy_stop() should be used in pairs. It is not good to
call start more often than stop.
What exactly is going on here? Why would there be MII errors?
Andrew