From: Alex Elder <elder@ieee.org>
To: Ruoyu Wang <ruoyuw560@gmail.com>, Alex Elder <elder@kernel.org>,
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>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] net: ipa: balance runtime PM reference on remove error
Date: Fri, 14 Aug 2026 11:54:47 -0500 [thread overview]
Message-ID: <4cc8fa8f-e827-43ea-8195-3e481bd6ee48@ieee.org> (raw)
In-Reply-To: <20260814134047.1387177-1-ruoyuw560@gmail.com>
On 8/14/26 8:40 AM, Ruoyu Wang wrote:
> ipa_remove() takes a runtime PM reference before accessing IPA hardware
> during teardown. If a concurrent modem start or stop keeps
> ipa_modem_stop() busy across both attempts, the callback intentionally
> returns without releasing the remaining resources because proceeding
> with teardown could crash. That return also skips the matching
> pm_runtime_put_noidle(), leaving the callback's usage-count reference
> held.
I concur that there should be a pm_runtime_put_noidle()
call before returning, to match the pm_runtime_get_sync()
earlier.
The exact code you're modifying here was added by commit
a92dbb9cdf046 ("net: ipa: Convert to platform remove
callback returning void"), but this particular error
was present before that.
The comment above this dev_err() call is rather confusing
and repetitive. Could you try to clarify what it means,
or write your own simple explanation to replace it?
Otherwise, this looks like a good change to me.
Thank you very much.
Reviewed-by: Alex Elder <elder@riscstar.com>
>
> Drop only this runtime PM reference before returning.
> pm_runtime_put_noidle() does not request an idle transition, so the
> hardware and resources retained on this exceptional path remain
> untouched while the usage count stays balanced.
>
> This issue was found by a static analysis checker and confirmed by
> manual source review.
>
> Fixes: 923a6b698447 ("net: ipa: get clock in ipa_probe()")
> Signed-off-by: Ruoyu Wang <ruoyuw560@gmail.com>
> ---
> drivers/net/ipa/ipa_main.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ipa/ipa_main.c b/drivers/net/ipa/ipa_main.c
> index 788dd99af2a4d..aab38fea91c61 100644
> --- a/drivers/net/ipa/ipa_main.c
> +++ b/drivers/net/ipa/ipa_main.c
> @@ -975,6 +975,7 @@ static void ipa_remove(struct platform_device *pdev)
> */
> dev_err(dev, "Failed to stop modem (%pe), leaking resources\n",
> ERR_PTR(ret));
> + pm_runtime_put_noidle(dev);
> return;
> }
>
prev parent reply other threads:[~2026-08-14 16:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-14 13:40 Ruoyu Wang
2026-08-14 16:54 ` Alex Elder [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=4cc8fa8f-e827-43ea-8195-3e481bd6ee48@ieee.org \
--to=elder@ieee.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=elder@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=ruoyuw560@gmail.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
all inboxes | Powered by JetHome®