[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aMLfGPIpWKwZszrY@shell.armlinux.org.uk>
Date: Thu, 11 Sep 2025 15:39:20 +0100
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: Marek Szyprowski <m.szyprowski@...sung.com>
Cc: Oleksij Rempel <o.rempel@...gutronix.de>,
Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Hubert Wiśniewski <hubert.wisniewski.25632@...il.com>,
stable@...r.kernel.org, kernel@...gutronix.de,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
Lukas Wunner <lukas@...ner.de>, Xu Yang <xu.yang_2@....com>,
linux-usb@...r.kernel.org
Subject: Re: [PATCH net v1 1/1] net: usb: asix: ax88772: drop phylink use in
PM to avoid MDIO runtime PM wakeups
On Thu, Sep 11, 2025 at 03:58:50PM +0200, Marek Szyprowski wrote:
> On 08.09.2025 13:26, Oleksij Rempel wrote:
> > Drop phylink_{suspend,resume}() from ax88772 PM callbacks.
> >
> > MDIO bus accesses have their own runtime-PM handling and will try to
> > wake the device if it is suspended. Such wake attempts must not happen
> > from PM callbacks while the device PM lock is held. Since phylink
> > {sus|re}sume may trigger MDIO, it must not be called in PM context.
> >
> > No extra phylink PM handling is required for this driver:
> > - .ndo_open/.ndo_stop control the phylink start/stop lifecycle.
> > - ethtool/phylib entry points run in process context, not PM.
> > - phylink MAC ops program the MAC on link changes after resume.
> >
> > Fixes: e0bffe3e6894 ("net: asix: ax88772: migrate to phylink")
> > Reported-by: Hubert Wiśniewski <hubert.wisniewski.25632@...il.com>
> > Cc: stable@...r.kernel.org
> > Signed-off-by: Oleksij Rempel <o.rempel@...gutronix.de>
> > ---
>
> This patch landed in today's linux-next as commit 5537a4679403 ("net:
> usb: asix: ax88772: drop phylink use in PM to avoid MDIO runtime PM
> wakeups"). In my tests I found that it breaks operation of asix ethernet
> usb dongle after system suspend-resume cycle. The ethernet device is
> still present in the system, but it is completely dysfunctional. Here is
> the log:
>
> root@...get:~# time rtcwake -s10 -mmem
> rtcwake: wakeup from "mem" using /dev/rtc0 at Thu Sep 11 13:02:23 2025
> PM: suspend entry (deep)
> Filesystems sync: 0.002 seconds
> Freezing user space processes
> Freezing user space processes completed (elapsed 0.003 seconds)
> OOM killer disabled.
> Freezing remaining freezable tasks
> Freezing remaining freezable tasks completed (elapsed 0.024 seconds)
> ...
> usb usb1: root hub lost power or was reset
> ...
> usb usb2: root hub lost power or was reset
> xhci-hcd xhci-hcd.7.auto: xHC error in resume, USBSTS 0x401, Reinit
> usb usb3: root hub lost power or was reset
> usb usb4: root hub lost power or was reset
> asix 2-1:1.0 eth0: Failed to write reg index 0x0000: -113
> asix 2-1:1.0 eth0: Failed to enable software MII access
> asix 2-1:1.0 eth0: Failed to read reg index 0x0000: -113
> asix 2-1:1.0 eth0: Failed to write reg index 0x0000: -113
> asix 2-1:1.0 eth0: Failed to enable software MII access
> ... (the above error repeated many times)
> ------------[ cut here ]------------
> WARNING: CPU: 0 PID: 9 at drivers/net/phy/phy.c:1346
> _phy_state_machine+0x158/0x2d0
> phy_check_link_status+0x0/0x140: returned: -110
I'm not surprised. I'm guessing phylib is using polled mode, and
removing the suspend/resume handling likely means that it's at the
mercy of the timings of the phylib state machine running (which is
what is complaining here) vs the MDIO bus being available for use.
Given that this happens, I'm convinced that the original patch is
the wrong approach. The driver needs the phylink suspend/resume
calls to shutdown and restart phylib polling, and the resume call
needs to be placed in such a location that the MDIO bus is already
accessible.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Powered by blists - more mailing lists