diff mbox series

i2c: img-scb: disable autosuspend on remove

Message ID 20260914085519.1665498-1-lgs201920130244@gmail.com
State Needs Review / ACK
Delegated to: Andi Shyti
Headers show
Series i2c: img-scb: disable autosuspend on remove | expand

Commit Message

Guangshuo Li Sept. 14, 2026, 8:55 a.m. UTC
img_i2c_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 and leaves autosuspend enabled.

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().

Add the missing pm_runtime_dont_use_autosuspend() call to the remove
path so that the runtime PM state is fully restored when the driver is
unbound.

This issue was found by manual code inspection.

Fixes: 93222bd9b966 ("i2c: img-scb: Add runtime PM")
Cc: stable@vger.kernel.org
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
---
 drivers/i2c/busses/i2c-img-scb.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-img-scb.c b/drivers/i2c/busses/i2c-img-scb.c
index 88192c25c44c..9cfa403cda8e 100644
--- a/drivers/i2c/busses/i2c-img-scb.c
+++ b/drivers/i2c/busses/i2c-img-scb.c
@@ -1415,6 +1415,7 @@  static void img_i2c_remove(struct platform_device *dev)
 	pm_runtime_disable(&dev->dev);
 	if (!pm_runtime_status_suspended(&dev->dev))
 		img_i2c_runtime_suspend(&dev->dev);
+	pm_runtime_dont_use_autosuspend(&dev->dev);
 }
 
 static int img_i2c_runtime_suspend(struct device *dev)