]> git.hungrycats.org Git - linux/commitdiff
media: venus: Fix pm_runtime_set_suspended() with runtime pm enabled
authorJinjie Ruan <ruanjinjie@huawei.com>
Fri, 1 Nov 2024 09:40:50 +0000 (17:40 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 Dec 2024 09:33:03 +0000 (10:33 +0100)
commit 2a20869f7d798aa2b69e45b863eaf1b1ecf98278 upstream.

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: af2c3834c8ca ("[media] media: venus: adding core part and helper functions")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Acked-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/platform/qcom/venus/core.c

index 0fc9414f8f18497d0fd06323ba4e95097162e40e..b570eb8c37568f194b23d44a9bcccb2f8ffcd7aa 100644 (file)
@@ -406,8 +406,8 @@ err_of_depopulate:
        of_platform_depopulate(dev);
 err_runtime_disable:
        pm_runtime_put_noidle(dev);
-       pm_runtime_set_suspended(dev);
        pm_runtime_disable(dev);
+       pm_runtime_set_suspended(dev);
        hfi_destroy(core);
 err_core_deinit:
        hfi_core_deinit(core, false);