Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: mick@yoxcu.de
Cc: elder@kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net,
	edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
	netdev@vger.kernel.org
Subject: Re: [PATCH net-next] net: ipa: report TX_SUSPEND wakeups to the PM core
Date: Tue, 24 Nov 2026 20:50:32 +0000	[thread overview]
Message-ID: <179555343259.3135.14377815060069063563@kernel.org> (raw)
In-Reply-To: <20261120202930.345970-1-mick@yoxcu.de>

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

      reply	other threads:[~2026-11-24 20:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

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=179555343259.3135.14377815060069063563@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=elder@kernel.org \
    --cc=kuba@kernel.org \
    --cc=mick@yoxcu.de \
    --cc=netdev@vger.kernel.org \
    --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