[PATCH] iio: adc: Fix pm runtime clean-up in sun4i_gpadc_probe
Jonathan Cameron
jic23 at kernel.org
Sun Oct 12 10:52:16 PDT 2025
On Wed, 8 Oct 2025 19:57:47 +0300
Andy Shevchenko <andy.shevchenko at gmail.com> wrote:
> On Wed, Oct 8, 2025 at 7:52 PM Shuhao Fu <sfual at cse.ust.hk> wrote:
> >
> > In `sun4i_gpadc_probe`, in case of thermal register failure, the runtime
> > PM usage counter would not be decreased, resulting in a possible
> > inconsistency of runtime PM state.
> >
> > Fixes: b0a242894f11 ("iio: adc: sun4i-gpadc-iio: register in the thermal after registering in pm")
>
> This might fix this problem, but it doesn't fix the whole mess in the
> probe with devm/non-devm ordering.
>
Mostly this looks simple to fix. Starting with devm_iio_map_register() instead
of the non devm version.
Then devm_pm_runtime_enable(). However, I have no idea why we need a pm_runtime_put()
in the exit path. Maybe it's messing with the parent power? There isn't a matching
get.
Anyone have this hardware to hand for testing if we try to fix this up fully?
Jonathan
More information about the linux-arm-kernel
mailing list