mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joshua Crofts <joshua.crofts1@gmail.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: "Guangshuo Li" <lgs201920130244@gmail.com>,
	"Eugen Hristev" <ehristev@kernel.org>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Nicolas Ferre" <nicolas.ferre@microchip.com>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Claudiu Beznea" <claudiu.beznea@tuxon.dev>,
	linux-iio@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] iio: adc: at91-sama5d2: disable autosuspend on remove
Date: Sun, 27 Sep 2026 19:55:19 +0200	[thread overview]
Message-ID: <20260927195519.76c2885b@systembl0wer> (raw)
In-Reply-To: <20260917041128.6d10a2f6@jic23-hlaptop>

On Thu, 17 Sep 2026 04:11:28 +0100
Jonathan Cameron <jic23@kernel.org> wrote:

> On Mon, 14 Sep 2026 14:53:39 +0200
> Joshua Crofts <joshua.crofts1@gmail.com> wrote:
> 
> > On Mon, 14 Sep 2026 19:34:22 +0800
> > Guangshuo Li <lgs201920130244@gmail.com> wrote:
> >   
> > > at91_adc_probe() enables runtime PM autosuspend with
> > > pm_runtime_use_autosuspend(). The probe error path correctly undoes
> > > this setting with pm_runtime_dont_use_autosuspend(), but the normal
> > > remove path only disables runtime PM.
> > > 
> > > The runtime PM API requires pm_runtime_use_autosuspend() to be undone
> > > with pm_runtime_dont_use_autosuspend() at driver exit unless runtime PM
> > > was enabled with devm_pm_runtime_enable(). Leaving the autosuspend flag
> > > set therefore leaves the runtime PM state incompletely cleaned up after
> > > the driver is unbound.
> > > 
> > > Add the missing pm_runtime_dont_use_autosuspend() call to the remove
> > > path.
> > > 
> > > This issue was found by manual code inspection.
> > > 
> > > Fixes: 75d7556ac0e4 ("iio: adc: at91-sama5d2_adc: add runtime pm support")
> > > Cc: stable@vger.kernel.org
> > > Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
> > > ---
> > >  drivers/iio/adc/at91-sama5d2_adc.c | 1 +
> > >  1 file changed, 1 insertion(+)
> > > 
> > > diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c
> > > index e8a5285bb6d4..e68632e628c7 100644
> > > --- a/drivers/iio/adc/at91-sama5d2_adc.c
> > > +++ b/drivers/iio/adc/at91-sama5d2_adc.c
> > > @@ -2487,6 +2487,7 @@ static void at91_adc_remove(struct platform_device *pdev)
> > >  
> > >  	pm_runtime_disable(st->dev);
> > >  	pm_runtime_set_suspended(st->dev);
> > > +	pm_runtime_dont_use_autosuspend(st->dev);
> > >  	clk_disable_unprepare(st->per_clk);
> > >  
> > >  	regulator_disable(st->vref);    
> > 
> > Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>  
> Applied.
> 
> Please make sure to take into account both Joshua and Krzystof's
> feedback that multiple near identical changes to drivers in the
> same subsystem should be in a series.
> 

FYI, patches like these will become redundant as I have a patch adding
this to pm_runtime_reinit() so driver core calls this automatically on
unbind queued for 7.4 [1].

[1] https://lore.kernel.org/all/20260919-move-dont-use-autosuspend-v1-1-f6e2d1315c23@gmail.com/

-- 
Kind regards,
Joshua Crofts

  reply	other threads:[~2026-09-27 17:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-14 11:34 Guangshuo Li
2026-09-14 12:53 ` Joshua Crofts
2026-09-17  3:11   ` Jonathan Cameron
2026-09-27 17:55     ` Joshua Crofts [this message]
2026-09-27 21:04       ` Jonathan Cameron
2026-09-15 11:07 ` Krzysztof Kozlowski

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=20260927195519.76c2885b@systembl0wer \
    --to=joshua.crofts1@gmail.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=andy@kernel.org \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=dlechner@baylibre.com \
    --cc=ehristev@kernel.org \
    --cc=jic23@kernel.org \
    --cc=lgs201920130244@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=nuno.sa@analog.com \
    --cc=stable@vger.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®