* [PATCH] iio: accel: mma9553: disable autosuspend on remove
@ 2026-09-14 11:30 Guangshuo Li
2026-09-14 12:51 ` Joshua Crofts
0 siblings, 1 reply; 3+ messages in thread
From: Guangshuo Li @ 2026-09-14 11:30 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, Uwe Kleine-König (The Capable Hub),
Danilo Krummrich, Joshua Crofts, Matti Vaittinen, Pan Chuang,
Guangshuo Li, Irina Tirdea, linux-iio, linux-kernel
Cc: stable
mma9553_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: 40cb761306d6 ("iio: add driver for Freescale MMA9553")
Cc: stable@vger.kernel.org
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
---
drivers/iio/accel/mma9553.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/iio/accel/mma9553.c b/drivers/iio/accel/mma9553.c
index 8e7aaac89d47..5a36d415a837 100644
--- a/drivers/iio/accel/mma9553.c
+++ b/drivers/iio/accel/mma9553.c
@@ -1136,6 +1136,7 @@ static void mma9553_remove(struct i2c_client *client)
iio_device_unregister(indio_dev);
+ pm_runtime_dont_use_autosuspend(&client->dev);
pm_runtime_disable(&client->dev);
pm_runtime_set_suspended(&client->dev);
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] iio: accel: mma9553: disable autosuspend on remove
2026-09-14 11:30 [PATCH] iio: accel: mma9553: disable autosuspend on remove Guangshuo Li
@ 2026-09-14 12:51 ` Joshua Crofts
2026-09-17 3:09 ` Jonathan Cameron
0 siblings, 1 reply; 3+ messages in thread
From: Joshua Crofts @ 2026-09-14 12:51 UTC (permalink / raw)
To: Guangshuo Li
Cc: Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, Uwe Kleine-König (The Capable Hub),
Danilo Krummrich, Matti Vaittinen, Pan Chuang, Irina Tirdea,
linux-iio, linux-kernel, stable
On Mon, 14 Sep 2026 19:30:12 +0800
Guangshuo Li <lgs201920130244@gmail.com> wrote:
> mma9553_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: 40cb761306d6 ("iio: add driver for Freescale MMA9553")
> Cc: stable@vger.kernel.org
> Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
> ---
> drivers/iio/accel/mma9553.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/iio/accel/mma9553.c b/drivers/iio/accel/mma9553.c
> index 8e7aaac89d47..5a36d415a837 100644
> --- a/drivers/iio/accel/mma9553.c
> +++ b/drivers/iio/accel/mma9553.c
> @@ -1136,6 +1136,7 @@ static void mma9553_remove(struct i2c_client *client)
>
> iio_device_unregister(indio_dev);
>
> + pm_runtime_dont_use_autosuspend(&client->dev);
> pm_runtime_disable(&client->dev);
> pm_runtime_set_suspended(&client->dev);
>
Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>
--
Kind regards,
Joshua Crofts
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] iio: accel: mma9553: disable autosuspend on remove
2026-09-14 12:51 ` Joshua Crofts
@ 2026-09-17 3:09 ` Jonathan Cameron
0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2026-09-17 3:09 UTC (permalink / raw)
To: Joshua Crofts
Cc: Guangshuo Li, David Lechner, Nuno Sá,
Andy Shevchenko, Uwe Kleine-König (The Capable Hub),
Danilo Krummrich, Matti Vaittinen, Pan Chuang, Irina Tirdea,
linux-iio, linux-kernel, stable
On Mon, 14 Sep 2026 14:51:18 +0200
Joshua Crofts <joshua.crofts1@gmail.com> wrote:
> On Mon, 14 Sep 2026 19:30:12 +0800
> Guangshuo Li <lgs201920130244@gmail.com> wrote:
>
> > mma9553_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: 40cb761306d6 ("iio: add driver for Freescale MMA9553")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
> > ---
> > drivers/iio/accel/mma9553.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/iio/accel/mma9553.c b/drivers/iio/accel/mma9553.c
> > index 8e7aaac89d47..5a36d415a837 100644
> > --- a/drivers/iio/accel/mma9553.c
> > +++ b/drivers/iio/accel/mma9553.c
> > @@ -1136,6 +1136,7 @@ static void mma9553_remove(struct i2c_client *client)
> >
> > iio_device_unregister(indio_dev);
> >
> > + pm_runtime_dont_use_autosuspend(&client->dev);
> > pm_runtime_disable(&client->dev);
> > pm_runtime_set_suspended(&client->dev);
> >
>
> Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>
>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-09-17 3:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-14 11:30 [PATCH] iio: accel: mma9553: disable autosuspend on remove Guangshuo Li
2026-09-14 12:51 ` Joshua Crofts
2026-09-17 3:09 ` Jonathan Cameron
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®