Subject: Re: [PATCH] net: phy: Fix premature resume by a PHY driver

From: "Russell King (Oracle)" <[email-masked]>
Date: Fri, 18 Jul 2025 17:10:54 +0100

On Fri, Jul 18, 2025 at 03:42:22PM +0000, Abid Ali wrote:
> There are possibilities for phy_resume to be executed when the ethernet
> interface is initially taken UP after bootup. This is harmless in most
> cases, but the respective PHY driver`s resume callback cannot have any
> logic that should only be executed if it was previously suspended.

Sorry but no. The PHY will be "resumed" from boot, even if it wasn't
"suspended". So the idea that resume should only be called if it was
previously suspended is incorrect.

E.g. .ndo_open -> ... -> phy_attach_direct() -> phy_resume() ->
	phydrv->resume()

During this path, the PHY may or may not be suspended, depending on
the state of the hardware when control was passed to the kernel,
which includes kexec().

PHY drivers must cope with an already functional PHY when their
resume() method is called.

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