iio: accel: mma9553: disable autosuspend on remove
Subsystems (2)
PATCH 1/1 iio: accel: mma9553: disable autosuspend on remove
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.
--- drivers/iio/accel/mma9553.c | 1 + 1 file changed, 1 insertion(+)
drivers/iio/accel/mma9553.c +1 -0
@@ -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);
Signature · 1 line
2.43.0
Quoted 28 lines · On Mon, 14 Sep 2026 19:30:12 +0800 Guangshuo Li <[email protected]>…
mma9553_probe()enables runtime PM autosuspend withpm_runtime_use_autosuspend(). The probe error path correctly undoes this setting withpm_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 withpm_runtime_dont_use_autosuspend()at driver exit unless runtime PM was enabled withdevm_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")Signed-off-by Guangshuo Li <[email protected]>--- drivers/iio/accel/mma9553.c | 1 + 1 file changed, 1 insertion(+)drivers/iio/accel/mma9553.c +0
-0
drivers/iio/accel/mma9553.c static void mma9553_remove(struct i2c_client *client) · line 1142
Quoted 7 lines
drivers/iio/accel/mma9553.c +1
-0@@ -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);
Signature · 2 lines
Kind regards, Joshua Crofts
Quoted 32 lines · On Mon, 14 Sep 2026 14:51:18 +0200 Joshua Crofts <[email protected]>…
Quoted 29 lines · On Mon, 14 Sep 2026 19:30:12 +0800 Guangshuo Li <[email protected]>…
mma9553_probe()enables runtime PM autosuspend withpm_runtime_use_autosuspend(). The probe error path correctly undoes this setting withpm_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 withpm_runtime_dont_use_autosuspend()at driver exit unless runtime PM was enabled withdevm_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")Signed-off-by Guangshuo Li <[email protected]>--- drivers/iio/accel/mma9553.c | 1 + 1 file changed, 1 insertion(+)drivers/iio/accel/mma9553.c +0
-0@@ -1136,6 +1136,7 @@ static void mma9553_remove(struct i2c_client *client)
Quoted 9 lines
drivers/iio/accel/mma9553.c static void mma9553_remove(struct i2c_client *client) · line 1142
Quoted 6 lines
drivers/iio/accel/mma9553.c +1
-0iio_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 <[email protected]>
Applied.