Re: [PATCH net-next v5 09/13] ax88179_178a: Add Suspend/resume support for AX88179A/772D/279

Andrew Lunn <[email protected]> Mon, 3 Aug 2026 16:58:50 +0200
Newsgroups org.kernel.vger.linux-usb,org.kernel.vger.linux-kernel,org.kernel.vger.netdev
Message-ID <[email protected]>
On Mon, Aug 03, 2026 at 10:53:18AM +0200, Birger Koblitz wrote:
> On 02/08/2026 23:44, Andrew Lunn wrote:
> > > +	/* Enable WoL */
> > > +	if (priv->wolopts) {
> > > +		ax88179_read_cmd(dev, AX_ACCESS_MAC, AX_MONITOR_MOD, 1, 1, &tmp8);
> > > +		if (priv->wolopts & WAKE_PHY)
> > > +			tmp8 |= AX_MONITOR_MODE_RWLC;
> > 
> > Have you tested WoL?
> Yes, I tested WoL with the initially submitted driver, and I later checked that
> the register writes around suspend/resume stayed the same. In fact, without
> proper WoL settings, the AX279 will immediately wake up the host again after
> suspend once USB wakeup is enabled for the respective USB device. I successfully
> tested WoL for PHY changes (link state changes, any type of packet received) for
> the 772D, 179A and 279. I did not manage to get WoL to work with magic packets,
> but I could also not make this work with the ASIX Windows driver or ASIX's
> out-of-tree Linux driver, so I assumed I was just not able to send the right type
> of magic packets or my network setup was broken.

sudo apt install wakeonlan

wakeonlan AA:BB:CC:DD:EE:FF

I've used this in the past.

> I really look at the suspend/resume functionality and WoL as a command that is
> sent to the MCU, which then configures MAC/PHY and the USB interface in one
> go and then puts the controller to sleep. It works by configuring a monitor mode
> in the MAC (cmd AX_ACCESS_MAC, register AX_MONITOR_MODe) and then "calling"
> AX88179A_WAKEUP_SETTING, register 8, with bits specifying
> EPHY_LOW_POWER_EN | S5_WOL_EN | S5_WOL_LOW_POWER | 0x8000 which is a mix of USB
> interface options and PHY configuration options plus a the EPHY_LOW_POWER_EN
> command.
> 
> It now looks like suspend/resume is broken in v5 according to Jianhui's tests. Hhowever,
> it was probably already broken in v4. Since this is intermittent, I wonder whether
> the polling of the phy by phylink is to blame, which sometimes may still come after
> the AX88179A_WAKEUP_SETTING sleep command. Can the polling be disabled by the driver
> in the suspend() function?

Better still, the PHY driver should configure WoL in the PHY, and use
phylinks WoL support for everything PHY related. It does require you
know what registers to set in the PHY.

As for waking up too early, we need to understand how the PHY is
waking the MAC. Often the PHYs have an interrupt output pin, which is
tied to a GPIO pin of the SoC which is wake capable. With a USB device
it will be different, but probably still an output from the PHY
connected to a pin of the USB MAC, which wakes the USB device.

It could be that interrupt output is wrongly configured, so it is
reporting some other event? Or it has not been cleared after the last
link up interrupt etc.

     Andrew