The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Stepan Ionichev <sozdayvek@gmail.com>
To: andy.shevchenko@gmail.com, wbg@kernel.org
Cc: m32285159@gmail.com, dlechner@baylibre.com, nuno.sa@analog.com,
	andy@kernel.org, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] counter: ti-eqep: balance pm_runtime on devm_clk_get_enabled() failure
Date: Fri, 29 May 2026 14:57:55 +0500	[thread overview]
Message-ID: <20260529095755.2533-1-sozdayvek@gmail.com> (raw)
In-Reply-To: <CAHp75VcKEDjzUs4wrErGHAXOPEJ6GRge0A_LHra-Gf7k4e-X5Q@mail.gmail.com>

On Wed, May 27, 2026 at 10:29 AM Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> > I'll revert for now. Would the proper fix be to replace all
> > pm_runtime_*() with their respective devm_pm_*() calls?
>
> Not all, but the ones that are opposite to
> pm_runtime_put*()/pm_runtime_disable(). It should be done carefully as
> well as PM runtime may be required before final registering of the
> device to access the registers (I haven't checked the driver, so I
> don't know if simple use devm_pm_*() will be enough).

The eqep driver has no runtime suspend/resume callbacks - it only
resumes in probe so that devm_clk_get_enabled() and counter_add() can
reach the registers. So devm_pm_runtime_enable() plus
pm_runtime_resume_and_get() before the clock get, with a devm action
for the put, keeps the device resumed across registration and unwinds
in reverse order on the error paths and on unbind. I'll send a v3 along
those lines.

Stepan

      reply	other threads:[~2026-05-29  9:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-25 15:21 [PATCH v2] counter: ti-eqep: balance pm_runtime on devm_clk_get_enabled() failure Stepan Ionichev
2026-05-26 10:32 ` Joshua Crofts
2026-05-27  7:12 ` William Breathitt Gray
2026-05-27  8:10 ` Andy Shevchenko
2026-05-27  8:18   ` William Breathitt Gray
2026-05-27  8:29     ` Andy Shevchenko
2026-05-29  9:57       ` Stepan Ionichev [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=20260529095755.2533-1-sozdayvek@gmail.com \
    --to=sozdayvek@gmail.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=andy@kernel.org \
    --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=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