* [PATCH net-next] net: ipa: report TX_SUSPEND wakeups to the PM core
@ 2026-11-20 20:29 Michael Auer
2026-11-24 20:50 ` netdev-bot+sashiko
0 siblings, 1 reply; 2+ messages in thread
From: Michael Auer @ 2026-11-20 20:29 UTC (permalink / raw)
To: Alex Elder
Cc: Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, netdev, Michael Auer
Since commit 4b2274d3811a ("net: ipa: don't bother aborting system
resume") the IPA driver reports no wakeup event. The IPA interrupt
still wakes the system, but the wakeup source of the IPA device does
not count it, so only /sys/power/pm_wakeup_irq shows the cause.
User space that reads the wakeup sources cannot attribute a mobile
data wakeup. Plasma's powerdevil, for example, turns the display on
for every such wakeup.
Report a wakeup event when handling the TX_SUSPEND interrupt. This is
pm_wakeup_event(), not a hard wakeup, so it does not abort a suspend
in progress unless user space uses /sys/power/wakeup_count.
Found and tested on a OnePlus 6 (SDM845, IPA v3.5.1): a push message
over LTE wakes the phone from s2idle, and the IPA wakeup source now
counts it.
Signed-off-by: Michael Auer <mick@yoxcu.de>
---
Tested on a OnePlus 6 with an sdm845-mainline 7.1-rc1 based kernel, in
daily use since late September. On net-next it was only build tested
(W=1, arm64 and x86_64 allmodconfig).
The event is also counted when TX_SUSPEND fires after a runtime
suspend while the system is running. If that is not wanted, the call
could be limited to system resume. I kept the version I tested.
Tool use: the analysis, the code and the commit messages were
written with an LLM coding assistant (Claude Code). I reviewed all
of it and tested it on my phone as described above.
drivers/net/ipa/ipa_interrupt.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/ipa/ipa_interrupt.c b/drivers/net/ipa/ipa_interrupt.c
index 766b094eb069..547ed67930d6 100644
--- a/drivers/net/ipa/ipa_interrupt.c
+++ b/drivers/net/ipa/ipa_interrupt.c
@@ -92,6 +92,11 @@ static void ipa_interrupt_process(struct ipa_interrupt *interrupt, u32 irq_id)
break;
case IPA_IRQ_TX_SUSPEND:
+ /* Data arrived for a suspended endpoint. Report it as a
+ * wakeup event, so user space can see what woke the system.
+ */
+ pm_wakeup_event(ipa->dev, 0);
+
/* Clearing the SUSPEND_TX interrupt also clears the
* register that tells us which suspended endpoint(s)
* caused the interrupt, so defer clearing until after
base-commit: 2208ab00f4f213ade91ab775e7f8c4dacdcc856e
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH net-next] net: ipa: report TX_SUSPEND wakeups to the PM core
2026-11-20 20:29 [PATCH net-next] net: ipa: report TX_SUSPEND wakeups to the PM core Michael Auer
@ 2026-11-24 20:50 ` netdev-bot+sashiko
0 siblings, 0 replies; 2+ messages in thread
From: netdev-bot+sashiko @ 2026-11-24 20:50 UTC (permalink / raw)
To: mick; +Cc: elder, andrew+netdev, davem, edumazet, kuba, pabeni, netdev
Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 2
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] The new pm_wakeup_event(ipa->dev, 0) call is placed in
ipa_interrupt_process() (drivers/net/ipa/ipa_interrupt.c:98).
- [Low] The permanent commit message presents the change as restoring the
wakeup reporting lost in 4b2274d3811a ("net: ipa: don't bother…
- [Low] The commit message names commit 4b2274d3811a ("net: ipa: don't
bother aborting system resume") as the cause of the missing IPA wakeup…
--
net: ipa: report TX_SUSPEND wakeups to the PM core
This patch adds a pm_wakeup_event() call for the IPA device when
ipa_interrupt_process() handles the TX_SUSPEND interrupt. The goal is to
let user space attribute mobile data wakeups to the IPA wakeup source again.
That stopped working after commit 4b2274d3811a.
> Since commit 4b2274d3811a ("net: ipa: don't bother aborting system
> resume") the IPA driver reports no wakeup event. The IPA interrupt
> still wakes the system, but the wakeup source of the IPA device does
> not count it, so only /sys/power/pm_wakeup_irq shows the cause.
[Severity: Low]
Should this carry a Fixes: tag?
The commit message names 4b2274d3811a as the cause of the lost wakeup
accounting and describes a user-visible effect. However, there is no tag
like:
Fixes: 4b2274d3811a ("net: ipa: don't bother aborting system resume")
Without it, stable and backport tooling can't link this change to the
commit it says caused the regression. Whether net-next wants a Fixes tag
here is up to the maintainers.
If one is added, backporting the patch as written would also bring the
simulated TX_SUSPEND issue described below into stable kernels.
> Report a wakeup event when handling the TX_SUSPEND interrupt. This is
> pm_wakeup_event(), not a hard wakeup, so it does not abort a suspend
> in progress unless user space uses /sys/power/wakeup_count.
[Severity: Low]
Should the commit message say that the new call is not gated the way the
old one was?
The message of 4b2274d3811a says "a SYSTEM IPA power flag is used to avoid
calling pm_wakeup_dev_event() when runtime suspended". The call it removed
was inside a test_bit(IPA_POWER_FLAG_SYSTEM, ...) check.
The new pm_wakeup_event() in ipa_interrupt_process() runs on every
TX_SUSPEND. That includes TX_SUSPEND interrupts that arrive while the
system is fully awake and IPA is only runtime suspended after its
autosuspend delay. These now count as wakeup events for the IPA wakeup
source and for the global event counter.
The notes below the --- line discuss this, but that text won't end up in
git history. Readers of git log and backporters won't see the change in
what the IPA wakeup counters mean.
> diff --git a/drivers/net/ipa/ipa_interrupt.c b/drivers/net/ipa/ipa_interrupt.c
> index 766b094eb0694..547ed67930d61 100644
> --- a/drivers/net/ipa/ipa_interrupt.c
> +++ b/drivers/net/ipa/ipa_interrupt.c
> @@ -92,6 +92,11 @@ static void ipa_interrupt_process(struct ipa_interrupt *interrupt, u32 irq_id)
> break;
>
> case IPA_IRQ_TX_SUSPEND:
> + /* Data arrived for a suspended endpoint. Report it as a
> + * wakeup event, so user space can see what woke the system.
> + */
> + pm_wakeup_event(ipa->dev, 0);
[Severity: Medium]
Can this report a wakeup event when no interrupt fired at all?
The software workaround for the IPA v3.5.1 aggregation erratum also calls
ipa_interrupt_process() directly:
drivers/net/ipa/ipa_interrupt.c:
/* Simulate arrival of an IPA TX_SUSPEND interrupt */
void ipa_interrupt_simulate_suspend(struct ipa_interrupt *interrupt)
{
ipa_interrupt_process(interrupt, IPA_IRQ_TX_SUSPEND);
}
That workaround runs from the driver's own suspend path. It triggers when
an RX endpoint has an aggregation frame open at the moment it is suspended:
ipa_suspend()
pm_runtime_force_suspend()
ipa_runtime_suspend()
ipa_endpoint_suspend()
ipa_endpoint_suspend_one()
ipa_endpoint_program_suspend(endpoint, true)
ipa_endpoint_suspend_aggr()
ipa_interrupt_simulate_suspend()
ipa_interrupt_process(interrupt, IPA_IRQ_TX_SUSPEND)
pm_wakeup_event(ipa->dev, 0)
ipa_endpoint_modem_pause_all(enable=true) reaches the same path for the
modem RX endpoints. In ipa_data-v3.5.1.c, AP_LAN_RX and AP_MODEM_RX have
aggregation enabled. That is the SoC this patch was tested on.
On these paths, the IPA wakeup source counters and the global
registered-wakeup-event counter go up while the device is going to sleep.
Suppose the power button or the RTC then wakes the system. Wouldn't user
space that compares wakeup source counters across the suspend cycle blame
IPA for that wakeup?
Also, if user space uses /sys/power/wakeup_count, events_check_enabled is
set. This event is registered during dpm_suspend(). Could it make later
pm_wakeup_pending() checks return true, so the system suspend aborts with
-EBUSY even though no wakeup arrived?
The new comment "Data arrived for a suspended endpoint" is also not true
for this caller.
Would it work better to report the event only on the real hardware IRQ
path? For example, it could go in ipa_isr_thread() when IPA_IRQ_STTS shows
TX_SUSPEND. Another option is a flag that ipa_interrupt_simulate_suspend()
doesn't set.
> +
> /* Clearing the SUSPEND_TX interrupt also clears the
> * register that tells us which suspended endpoint(s)
> * caused the interrupt, so defer clearing until after
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261120202930.345970-1-mick%40yoxcu.de
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-24 20:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-20 20:29 [PATCH net-next] net: ipa: report TX_SUSPEND wakeups to the PM core Michael Auer
2026-11-24 20:50 ` netdev-bot+sashiko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox