Re: [PATCH v2] counter: ti-eqep: balance pm_runtime on devm_clk_get_enabled() failure
From: Stepan Ionichev
Date: Fri May 29 2026 - 05:58:47 EST
On Wed, May 27, 2026 at 10:29 AM Andy Shevchenko <andy.shevchenko@xxxxxxxxx> 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