From: Mizuno Miotsuki <founder@crepuse.com>
To: Frank Li <Frank.li@oss.nxp.com>
Cc: "vkoul@kernel.org" <vkoul@kernel.org>,
"dmaengine@vger.kernel.org" <dmaengine@vger.kernel.org>,
"krzk@kernel.org" <krzk@kernel.org>,
"ulfh@kernel.org" <ulfh@kernel.org>,
"Frank.Li@kernel.org" <Frank.Li@kernel.org>,
"m.szyprowski@samsung.com" <m.szyprowski@samsung.com>,
"huibin.hong@rock-chips.com" <huibin.hong@rock-chips.com>,
"sugar.zhang@rock-chips.com" <sugar.zhang@rock-chips.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3] dmaengine: pl330: Fix unbalanced runtime PM
Date: Fri, 16 Oct 2026 23:39:22 +0000 [thread overview]
Message-ID: <6D6012D6-03F2-43A5-9F87-91BE480A7435@crepuse.com> (raw)
In-Reply-To: <atIz5ZsJNUZ1ocE7@SMW015318>
Hi Frank,
Thanks for taking another look.
I think the interleaving you described is already prevented by
pch->lock.
Both pl330_tasklet() and pl330_terminate_all() check pch->active
and clear it while holding the same lock. Whichever gets the lock
first can claim the PM put, and the other should then see
pch->active == false.
The actual pm_runtime_put_autosuspend() calls happen after
releasing the lock, but the decision to make each call is still
protected by it.
The issue this patch addresses is that the tasklet currently sets
power_down unconditionally when work_list is empty. If
terminate_all() has already cleared pch->active and released the
PM reference, the tasklet can still issue another put.
I agree there may be other synchronization issues around
issue_pending() and tasklet callbacks, and I don't mean to claim
this patch fixes all of them.
But I don't see how both paths in your example could observe
pch->active == true for the same activation. Am I missing another
interleaving?
Thanks,
Mizuno
prev parent reply other threads:[~2026-10-16 23:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-20 10:27 [PATCH v2] " Sugar Zhang
2026-10-14 23:58 ` [PATCH v3] " Mizuno Miotsuki via B4 Relay
2026-10-15 16:51 ` Frank Li
2026-10-16 10:49 ` Mizuno Miotsuki
2026-10-27 15:34 ` Frank Li
2026-11-03 10:14 ` Mizuno Miotsuki
2026-10-16 14:25 ` Frank Li
2026-10-16 23:39 ` Mizuno Miotsuki [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=6D6012D6-03F2-43A5-9F87-91BE480A7435@crepuse.com \
--to=founder@crepuse.com \
--cc=Frank.Li@kernel.org \
--cc=Frank.li@oss.nxp.com \
--cc=dmaengine@vger.kernel.org \
--cc=huibin.hong@rock-chips.com \
--cc=krzk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=sugar.zhang@rock-chips.com \
--cc=ulfh@kernel.org \
--cc=vkoul@kernel.org \
/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®