mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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>,
	"rmk+kernel@arm.linux.org.uk" <rmk+kernel@arm.linux.org.uk>,
	"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 10:49:31 +0000	[thread overview]
Message-ID: <C35ADE64-5E80-454C-A66A-BA2B22EFF386@crepuse.com> (raw)
In-Reply-To: <atEEi7Uc7DI2pkg5@lizhi-Precision-Tower-5810>

Hi Frank,

Thanks for the review.

> Look like need lock between terminate and issue_pendings. There are should
> other problems if interfere each others.
> 
> terminate should wait issue_pending finish and block queue new request.

Both pl330_issue_pending() and pl330_terminate_all() already use
pch->lock to protect the channel state. However, issue_pending()
also invokes pl330_tasklet() after releasing the lock, so this
does not establish complete synchronization.

I ran a source-based interleaving test. The original
code reproduces the extra runtime PM put after termination, while
the proposed one-line fix balances the references under the same
interleaving.

> This function can be called in an interrupt context
> 
> call pm_runtime_get() is risk, which may sleep.

pl330_probe() calls pm_runtime_irq_safe(&adev->dev), and the AMBA
runtime PM callbacks use clk_enable()/clk_disable() for IRQ-safe
devices. This allows pm_runtime_get_sync() to be called from
atomic context, provided the relevant PM callbacks and dependencies
satisfy the IRQ-safe requirements.

I agree that the remaining synchronization and error-handling
paths deserve further investigation.

Would it be reasonable to keep this patch focused on the
reproduced reference-count imbalance and address any confirmed
synchronization issues separately?

Thanks,
Mizuno

  reply	other threads:[~2026-10-16 10:49 UTC|newest]

Thread overview: 7+ 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 [this message]
2026-10-27 15:34       ` Frank Li
2026-10-16 14:25   ` Frank Li
2026-10-16 23:39     ` Mizuno Miotsuki

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=C35ADE64-5E80-454C-A66A-BA2B22EFF386@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=rmk+kernel@arm.linux.org.uk \
    --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®