[PATCH v2 3/3] media: venus: Fix pm_runtime_set_suspended() with runtime pm enabled

Jinjie Ruan posted 3 patches 3 weeks, 2 days ago
[PATCH v2 3/3] media: venus: Fix pm_runtime_set_suspended() with runtime pm enabled
Posted by Jinjie Ruan 3 weeks, 2 days ago
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>
---
v2:
- Add Cc stable.
---
 drivers/media/platform/qcom/venus/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
index 84e95a46dfc9..cabcf710c046 100644
--- a/drivers/media/platform/qcom/venus/core.c
+++ b/drivers/media/platform/qcom/venus/core.c
@@ -412,8 +412,8 @@ static int venus_probe(struct platform_device *pdev)
 	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);
-- 
2.34.1
Re: [PATCH v2 3/3] media: venus: Fix pm_runtime_set_suspended() with runtime pm enabled
Posted by Stanimir Varbanov 3 weeks, 2 days ago

On 1.11.24 г. 11:40 ч., Jinjie Ruan wrote:
> 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>
> ---
> v2:
> - Add Cc stable.
> ---
>   drivers/media/platform/qcom/venus/core.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Acked-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com>

-- 
regards,
Stan
Re: [PATCH v2 3/3] media: venus: Fix pm_runtime_set_suspended() with runtime pm enabled
Posted by Bryan O'Donoghue 3 weeks, 2 days ago
On 01/11/2024 09:40, Jinjie Ruan wrote:
> 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>
> ---
> v2:
> - Add Cc stable.
> ---
>   drivers/media/platform/qcom/venus/core.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
> index 84e95a46dfc9..cabcf710c046 100644
> --- a/drivers/media/platform/qcom/venus/core.c
> +++ b/drivers/media/platform/qcom/venus/core.c
> @@ -412,8 +412,8 @@ static int venus_probe(struct platform_device *pdev)
>   	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);

Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>