Re: [PATCH net v2] net: phylink: allow stopping a suspended instance
From: James Hilliard
Date: Tue Oct 13 2026 - 18:39:15 EST
On Mon, Oct 12, 2026 at 7:22 PM Andrew Lunn <andrew@xxxxxxx> wrote:
>
> On Mon, Oct 05, 2026 at 01:09:05PM -0600, James Hilliard wrote:
> > After a failed MAC resume, a driver must be able to stop phylink without
> > resuming it and reconfiguring the failed MAC. This is needed when recovery
> > leaves the interface administratively up but detached until a subsequent
> > down/up: ndo_stop() must finish the suspended phylink lifetime even though
> > the MAC could not be restored. The missing transition was identified by
> > code inspection of the stmmac recovery paths.
>
> I don't particularly like this. It feels like a workaround for a
> broken MAC. It would be better to fix the MAC so that resume does not
> fail.
Fixing an identified cause of resume failure belongs in the MAC
driver. The intended purpose here is narrower: allow orderly shutdown
after the driver has returned an error, rather than recover the MAC
through phylink.
stmmac_resume() already returns before phylink_resume() when hardware
setup fails. The associated stmmac recovery work keeps the interface
administratively up but detached, allowing an ordinary down/up to
recover it.
That leaves a subsequent ndo_stop() needing to finish the suspended
phylink lifetime. Calling phylink_resume() just to make shutdown
possible would reapply MAC configuration and restart link resolution
before the driver has successfully restored the MAC. That is the
transition this prerequisite was intended to address.
> As far as i know, this it theoretical, only triggered by fault
> injection. If we find a real error situation where the MAC cannot be
> resumed, then i will consider it. But until then, i prefer to reject
> this patch.
>
> Andrew