From: Frank Li <Frank.li@oss.nxp.com>
To: Golla Nagendra <nagendra.golla@amd.com>
Cc: Vinod Koul <vkoul@kernel.org>, Frank Li <Frank.Li@kernel.org>,
Michal Simek <michal.simek@amd.com>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Kedareswara rao Appana <appana.durga.rao@xilinx.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Michael Tretter <m.tretter@pengutronix.de>,
Harini Katakam <harini.katakam@amd.com>,
Shyam Pandey <radhey.shyam.pandey@amd.com>,
dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
devicetree@vger.kernel.org, git@amd.com
Subject: Re: [PATCH v4 2/6] PM: runtime: Add pm_runtime_if_active guard and conditional variant
Date: Fri, 9 Oct 2026 21:57:36 -0500 [thread overview]
Message-ID: <asmpoK1AdF5FAT4i@SMW015318> (raw)
In-Reply-To: <20261009-adma-pm-fix-and-per-channel-reset-v4-2-55f5fe409c55@amd.com>
On Fri, Oct 09, 2026 at 09:30:11AM +0530, Golla Nagendra wrote:
> Add a pm_runtime_if_active base guard and its _try conditional variant
> to pm_runtime.h for drivers that need to conditionally acquire a runtime
> PM reference only when the device is already active.
>
> The base guard must not be used directly via guard()/scoped_guard()
> because pm_runtime_get_if_active() only acquires a reference when it
> returns 1; the destructor unconditionally calls pm_runtime_put(), which
> would underflow usage_count on a suspended device. The base guard
> exists solely to back the DEFINE_GUARD_COND _try variant.
>
> The _try variant (used via PM_RUNTIME_ACQUIRE_IF_ACTIVE) satisfies the
> _try API contract that guards must not produce an error when runtime PM
> is disabled for the device. When pm_runtime_get_if_active() returns
> -EINVAL (runtime PM disabled),
If only resolve PM disabled case, I suggest define DEFINE_GUARD as no-ops
Frank
next prev parent reply other threads:[~2026-10-10 2:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-09 4:00 [PATCH v4 0/6] dmaengine: zynqmp_dma: Per-channel reset, IRQ guard improvements, and PM fixes Golla Nagendra
2026-10-09 4:00 ` [PATCH v4 1/6] dmaengine: zynqmp_dma: Use PM guard for probe-time runtime PM reference Golla Nagendra
2026-10-10 3:09 ` Frank Li
2026-10-09 4:00 ` [PATCH v4 2/6] PM: runtime: Add pm_runtime_if_active guard and conditional variant Golla Nagendra
2026-10-09 4:10 ` sashiko-bot
2026-10-10 2:57 ` Frank Li [this message]
2026-10-09 4:00 ` [PATCH v4 3/6] dmaengine: zynqmp_dma: Guard IRQ handler against spurious interrupts Golla Nagendra
2026-10-10 2:59 ` Frank Li
2026-10-09 4:00 ` [PATCH v4 4/6] dt-bindings: dma: xlnx,zynqmp-dma: Add Versal Net compatible support Golla Nagendra
2026-10-09 4:15 ` sashiko-bot
2026-10-09 15:33 ` Conor Dooley
2026-10-09 4:00 ` [PATCH v4 5/6] dmaengine: zynqmp_dma: Add new compatible string for Versal Net Golla Nagendra
2026-10-09 4:00 ` [PATCH v4 6/6] dmaengine: zynqmp_dma: Add per-channel reset support Golla Nagendra
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=asmpoK1AdF5FAT4i@SMW015318 \
--to=frank.li@oss.nxp.com \
--cc=Frank.Li@kernel.org \
--cc=appana.durga.rao@xilinx.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=git@amd.com \
--cc=harini.katakam@amd.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=m.tretter@pengutronix.de \
--cc=michal.simek@amd.com \
--cc=nagendra.golla@amd.com \
--cc=radhey.shyam.pandey@amd.com \
--cc=rafael@kernel.org \
--cc=robh@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