Netdev List
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Birger Koblitz <mail@birger-koblitz.de>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Russell King <linux@armlinux.org.uk>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	linux-usb@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, Jianhui Xu <neuromoments@gmail.com>
Subject: Re: [PATCH net-next v5 09/13] ax88179_178a: Add Suspend/resume support for AX88179A/772D/279
Date: Mon, 3 Aug 2026 16:58:50 +0200	[thread overview]
Message-ID: <fa2cbf05-548b-4ce7-b69b-e46b6cbe486e@lunn.ch> (raw)
In-Reply-To: <5e15ac01-18c1-4cdf-a800-62e2b1427087@birger-koblitz.de>

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

  reply	other threads:[~2026-08-03 14:59 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-02 16:31 [PATCH net-next v5 00/13] ax88179_178a: Add support for AX88179A-based chips Birger Koblitz
2026-08-02 16:31 ` [PATCH net-next v5 01/13] ax88179_178a: Fix endianness of pause watermark register Birger Koblitz
2026-08-02 16:32 ` [PATCH net-next v5 02/13] ax88179_178a: Split driver into library and device specific code Birger Koblitz
2026-08-02 16:32 ` [PATCH net-next v5 03/13] ax88179_178a: Add netdev2data() convenience function Birger Koblitz
2026-08-02 21:10   ` Andrew Lunn
2026-08-02 16:32 ` [PATCH net-next v5 04/13] ax88179_178a: Add HW support for AX179A-based chips Birger Koblitz
2026-08-02 21:28   ` Andrew Lunn
2026-08-06 19:32     ` Birger Koblitz
2026-08-02 21:36   ` Andrew Lunn
2026-08-06 19:34     ` Birger Koblitz
2026-08-02 21:47   ` Andrew Lunn
2026-08-02 16:32 ` [PATCH net-next v5 05/13] ax88179_178a: Add EEE configuration support for AX88179A MACs Birger Koblitz
2026-08-02 16:32 ` [PATCH net-next v5 06/13] ax88179_178a: Add EEE configuration support for AX88179A PHYs Birger Koblitz
2026-08-02 16:32 ` [PATCH net-next v5 07/13] ax88179_178a: Add VLAN offload support for AX88179A Birger Koblitz
2026-08-02 21:37   ` Andrew Lunn
2026-08-02 16:32 ` [PATCH net-next v5 08/13] ax88179_178a: Add AX179A/AX279 multicast configuration Birger Koblitz
2026-08-02 16:32 ` [PATCH net-next v5 09/13] ax88179_178a: Add Suspend/resume support for AX88179A/772D/279 Birger Koblitz
2026-08-02 21:44   ` Andrew Lunn
2026-08-03  8:53     ` Birger Koblitz
2026-08-03 14:58       ` Andrew Lunn [this message]
2026-08-02 16:32 ` [PATCH net-next v5 10/13] ax88179_178a: Add ethtool get_drvinfo Birger Koblitz
2026-08-02 16:32 ` [PATCH net-next v5 11/13] ax88179_178a: Update driver name and information Birger Koblitz
2026-08-02 21:45   ` Andrew Lunn
2026-08-02 16:32 ` [PATCH net-next v5 12/13] ax88179_178a: Add support for AX88179A/772D/279 EEPROM access Birger Koblitz
2026-08-02 16:32 ` [PATCH net-next v5 13/13] ax88796b: Add support for AX88772D, AX88179A and AX88279 Birger Koblitz
2026-08-02 21:55   ` Andrew Lunn
2026-08-06 19:35     ` Birger Koblitz
2026-08-06 21:16       ` Andrew Lunn
2026-08-03  7:33 ` [PATCH net-next v5 00/13] ax88179_178a: Add support for AX88179A-based chips Jianhui Xu
2026-08-03  9:53   ` Birger Koblitz
2026-08-03 14:39     ` Yuan Xu
2026-08-06 19:38       ` Birger Koblitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fa2cbf05-548b-4ce7-b69b-e46b6cbe486e@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mail@birger-koblitz.de \
    --cc=netdev@vger.kernel.org \
    --cc=neuromoments@gmail.com \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox