From: "Théo Lebrun" <theo.lebrun@bootlin.com>
To: "Nicolai Buchwitz" <nb@tipi-net.de>,
"Andrew Lunn" <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@kernel.org>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>
Cc: "Conor Dooley" <conor.dooley@microchip.com>,
"Sergio Prado" <sergio.prado@e-labworks.com>,
<netdev@vger.kernel.org>, "Dom Cobley" <popcornmix@gmail.com>
Subject: Re: [PATCH net] net: macb: don't disable an IRQ wake that was never enabled
Date: Mon, 23 Nov 2026 18:09:30 +0100 [thread overview]
Message-ID: <DN2R8R6SGV27.DU4IEVFTHBC0@bootlin.com> (raw)
In-Reply-To: <20261123-nb-macb-irq-wake-net-v1-1-ccdd60a9a1bc@tipi-net.de>
Hello Nicolai & Dom,
On Mon Nov 23, 2026 at 4:38 PM CET, Nicolai Buchwitz wrote:
> @@ -6589,7 +6590,11 @@ static int __maybe_unused macb_suspend(struct device *dev)
> }
> spin_unlock_irqrestore(&bp->lock, flags);
>
> - enable_irq_wake(bp->queues[0].irq);
> + err = enable_irq_wake(bp->queues[0].irq);
> + if (err)
> + netdev_warn(netdev, "Unable to enable IRQ %d as a wake source (error %d)\n",
> + bp->queues[0].irq, err);
> + bp->pm_data.irq_wake_enabled = !err;
> }
Your error handling is surprising to me: if we get asked to be a wakeup
source and fail doing so, we should refuse and error out. This will in
turn abort the system-wide suspend.
The risk is that we might be the only wakeup source. We'd sleep for a
really long time.
What's the behavior on the platform you noticed the issue? I can think
of two reasons that still make it work:
- you have another wakeup source or
- some other interrupt (PCI related) is your wakeup path.
In my mind, we should instead propagate the enable_irq_wake() error in
macb_suspend().
To go even further, we could move the enable_irq_wake() into
macb_set_wol() to report early to userspace that WoL isn't supported.
Lastly, if this is indeed a PCI related topic, then we need to
special-case the enable_irq_wake() call. From my LLM report, many PCI
MAC drivers only call device_set_wakeup_enable() at the set_wol
request. Then everything is handled at the bus level at suspend: a
pci_enable_wake() call made if the device is on the wakeup path.
What do you think?
Thanks,
--
Théo Lebrun, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2026-11-23 17:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 15:38 [PATCH net] net: macb: don't disable an IRQ wake that was never enabled Nicolai Buchwitz
2026-11-23 17:09 ` Théo Lebrun [this message]
2026-11-24 6:12 ` Nicolai Buchwitz
2026-11-24 10:20 ` Théo Lebrun
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=DN2R8R6SGV27.DU4IEVFTHBC0@bootlin.com \
--to=theo.lebrun@bootlin.com \
--cc=andrew+netdev@lunn.ch \
--cc=conor.dooley@microchip.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=kuba@kernel.org \
--cc=nb@tipi-net.de \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=popcornmix@gmail.com \
--cc=sergio.prado@e-labworks.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.