Re: [PATCH net-next v5 09/13] ax88179_178a: Add Suspend/resume support for AX88179A/772D/279
Birger Koblitz <[email protected]> Mon, 3 Aug 2026 10:53:18 +0200
| Newsgroups | org.kernel.vger.linux-usb,org.kernel.vger.linux-kernel,org.kernel.vger.netdev |
|---|---|
| Message-ID | <[email protected]> |
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.
>
> WoL is somewhat complex because it can be done in the PHY or the
> MAC. If it can be done in the PHY, you can power off the MAC. If the
> MAC needs to do it, it needs to stay awake.
>
> But what i don't get is how the MAC is implementing WAKE_PHY?
>
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?
Birger