Skip to content

Commit 3a278a5

Browse files
Xulin SunSasha Levin
authored andcommitted
media: chips-media: wave5: Fix PM runtime usage count underflow
[ Upstream commit 9cf4452 ] Replace pm_runtime_put_sync() with pm_runtime_dont_use_autosuspend() in the remove path to properly pair with pm_runtime_use_autosuspend() from probe. This allows pm_runtime_disable() to handle reference count cleanup correctly regardless of current suspend state. The driver calls pm_runtime_put_sync() unconditionally in remove, but the device may already be suspended due to autosuspend configured in probe. When autosuspend has already suspended the device, the usage count is 0, and pm_runtime_put_sync() decrements it to -1. This causes the following warning on module unload: ------------[ cut here ]------------ WARNING: CPU: 1 PID: 963 at kernel/kthread.c:1430 kthread_destroy_worker+0x84/0x98 ... vdec 30210000.video-codec: Runtime PM usage count underflow! Fixes: 9707a62 ("media: chips-media: wave5: Add the v4l2 layer") Cc: stable@vger.kernel.org Signed-off-by: Xulin Sun <xulin.sun@windriver.com> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent a62ba5a commit 3a278a5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/media/platform/chips-media/wave5/wave5-vpu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ static void wave5_vpu_remove(struct platform_device *pdev)
356356
hrtimer_cancel(&dev->hrtimer);
357357
}
358358

359-
pm_runtime_put_sync(&pdev->dev);
359+
pm_runtime_dont_use_autosuspend(&pdev->dev);
360360
pm_runtime_disable(&pdev->dev);
361361

362362
mutex_destroy(&dev->dev_lock);

0 commit comments

Comments
 (0)