Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: amphion: Fix pm_runtime_set_suspended() with runtime pm enabled

It is not valid to call pm_runtime_set_suspended() for devices
with runtime PM enabled because it returns -EAGAIN if it is enabled
already and working. So, call pm_runtime_disable() before to fix it.

Cc: stable@vger.kernel.org
Fixes: b50a64fc54af ("media: amphion: add amphion vpu device driver")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>

authored by

Jinjie Ruan and committed by
Hans Verkuil
316e7450 d6594d50

+1 -1
+1 -1
drivers/media/platform/amphion/vpu_drv.c
··· 151 151 media_device_cleanup(&vpu->mdev); 152 152 v4l2_device_unregister(&vpu->v4l2_dev); 153 153 err_vpu_deinit: 154 - pm_runtime_set_suspended(dev); 155 154 pm_runtime_disable(dev); 155 + pm_runtime_set_suspended(dev); 156 156 157 157 return ret; 158 158 }