mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Stepan Ionichev <sozdayvek@gmail.com>
Cc: dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/4] iio: PM-enable leak on probe error path (goto-variant drivers)
Date: Fri, 29 May 2026 14:08:47 +0100	[thread overview]
Message-ID: <20260529140847.46d71c22@jic23-huawei> (raw)
In-Reply-To: <cover.1780051096.git.sozdayvek@gmail.com>

On Fri, 29 May 2026 15:45:40 +0500
Stepan Ionichev <sozdayvek@gmail.com> wrote:

> This is the goto-variant follow-up to the standalone ti-ads1015 patch and
> the 4-patch series for the simple drivers.  In these four drivers probe
> calls pm_runtime_enable() but the existing register-failure path jumps to
> a manual cleanup label (out_err / buffer_cleanup / error_power_down)
> rather than returning directly.  None of those cleanup labels call
> pm_runtime_disable(), so the runtime PM enable_count leaks on probe
> failure and on subsequent rebind.
> 
> The conversion is the same as in the rest of the class: replace
> pm_runtime_enable() with devm_pm_runtime_enable() and drop the
> pm_runtime_disable() / pm_runtime_set_suspended() calls in .remove().
> On the new error path from devm_pm_runtime_enable() each patch jumps to
> the same existing cleanup label that iio_device_register() uses, so the
> manual unwind for the non-devm resources held earlier in probe still
> runs.  In apds9960 nothing is powered or registered at that point so a
> plain return is used.
This is v2.  Make sure you increment version numbers even for the sort
of commit message reformat you made here.  Sending as the same version
confuses readers and potentially scripts.

Note this is a clarification not a request that you resend now as v2!
J
> 
> Standalone precedent already on the list:
>   iio: adc: ti-ads1015 -
>   https://lore.kernel.org/all/20260529101011.3030-1-sozdayvek@gmail.com/
> 
> Companion 4-patch series for the simple-return drivers (isl29028,
> tsl2583, mlx90614, bmi088-accel) was posted alongside this one.
> 
> Stepan Ionichev (4):
>   iio: light: pa12203001: use devm_pm_runtime_enable() to fix probe
>     error path
>   iio: light: us5182d: use devm_pm_runtime_enable() to fix probe error
>     path
>   iio: light: apds9960: use devm_pm_runtime_enable() to fix probe error
>     path
>   iio: accel: mma8452: use devm_pm_runtime_enable() to fix probe error
>     path
> 
>  drivers/iio/accel/mma8452.c    | 7 +++----
>  drivers/iio/light/apds9960.c   | 6 +++---
>  drivers/iio/light/pa12203001.c | 7 +++----
>  drivers/iio/light/us5182d.c    | 7 +++----
>  4 files changed, 12 insertions(+), 15 deletions(-)
> 
> 
> base-commit: 7cb1c5b32a2bfde961fff8d5204526b609bcb30a


      parent reply	other threads:[~2026-05-29 13:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-29 10:45 Stepan Ionichev
2026-05-29 10:45 ` [PATCH 1/4] iio: light: pa12203001: use devm_pm_runtime_enable() to fix probe error path Stepan Ionichev
2026-05-29 17:19   ` Jonathan Cameron
2026-05-29 10:45 ` [PATCH 2/4] iio: light: us5182d: " Stepan Ionichev
2026-05-29 17:20   ` Jonathan Cameron
2026-05-29 10:45 ` [PATCH 3/4] iio: light: apds9960: " Stepan Ionichev
2026-05-29 17:22   ` Jonathan Cameron
2026-05-29 10:45 ` [PATCH 4/4] iio: accel: mma8452: " Stepan Ionichev
2026-05-29 17:23   ` Jonathan Cameron
2026-05-29 13:08 ` Jonathan Cameron [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=20260529140847.46d71c22@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=sozdayvek@gmail.com \
    /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®