From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: phucduc.bui@gmail.com
Cc: wbg@kernel.org, David Lechner <david@lechnology.com>,
andy@kernel.org, dlechner@baylibre.com,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
m32285159@gmail.com, nuno.sa@analog.com, sozdayvek@gmail.com
Subject: Re: [PATCH v4 1/2] counter: ti-eqep: Fix runtime PM leak on probe failure
Date: Tue, 10 Nov 2026 01:23:23 +0200 [thread overview]
Message-ID: <avJV68gHL_jvZ6dZ@ashevche-desk.local> (raw)
In-Reply-To: <20261109084342.51865-2-phucduc.bui@gmail.com>
On Mon, Nov 09, 2026 at 03:43:41PM +0700, phucduc.bui@gmail.com wrote:
> ti_eqep_probe() enables runtime PM and takes a usage reference manually,
> then returns directly via dev_err_probe() if devm_clk_get_enabled()
> fails, leaking both.
>
> Manual cleanup via goto would mix managed and unmanaged resources,
> which leads to the wrong release order. Instead, use
> devm_pm_runtime_enable() and pm_runtime_resume_and_get() with a devm
> action for the put, so every probe error path unwinds in the correct
> reverse order. As a side effect, a runtime resume failure now aborts
> the probe instead of being ignored.
>
> ti_eqep_remove() no longer needs to touch runtime PM. While at it,
> report counter_add() failures with dev_err_probe().
I'm confused. Why the PM runtime is used (and announced) in this driver at all?
Do we have upper layer (like a bus driver) disable power before handing over to
the device driver?
TL;DR: what's the point in runtime PM here?
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2026-11-09 23:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-09 8:43 [PATCH v4 0/2] counter: ti-eqep: Fix runtime PM leak and use devm_counter_add() phucduc.bui
2026-11-09 8:43 ` [PATCH v4 1/2] counter: ti-eqep: Fix runtime PM leak on probe failure phucduc.bui
2026-11-09 23:23 ` Andy Shevchenko [this message]
2026-11-09 8:43 ` [PATCH v4 2/2] counter: ti-eqep: Use devm_counter_add() phucduc.bui
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=avJV68gHL_jvZ6dZ@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=david@lechnology.com \
--cc=dlechner@baylibre.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m32285159@gmail.com \
--cc=nuno.sa@analog.com \
--cc=phucduc.bui@gmail.com \
--cc=sozdayvek@gmail.com \
--cc=wbg@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®