Skip to contentSkip to conversation

net: ipa: report TX_SUSPEND wakeups to the PM core

PATCH New Michael Auer 1 participant 1 message Nov 20

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: ipa: report TX_SUSPEND wakeups to the PM core

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.

---
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(+)
drivers/net/ipa/ipa_interrupt.c +5 -0
index 766b094eb069..547ed67930d6 100644
@@ -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

Signature · 1 line
2.43.0