vsp1_pm_runtime_resume() can fail while deasserting reset, initializing
the device, or enabling the FCP. However, vsp1_pm_resume() ignores the
return value from pm_runtime_force_resume() and restarts video pipelines
even if the device failed to resume. This can access hardware that is
still unavailable while reporting a successful system resume.
Propagate the error and skip the pipeline restart when the device could
not be resumed.
Fixes: 1e6af546ee66 ("[media] v4l: vsp1: Implement runtime PM support")
Signed-off-by: Linmao Li <lilinmao@kylinos.cn>
---
drivers/media/platform/renesas/vsp1/vsp1_drv.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/media/platform/renesas/vsp1/vsp1_drv.c b/drivers/media/platform/renesas/vsp1/vsp1_drv.c
index 627b5046fa80..2a9f9f114575 100644
--- a/drivers/media/platform/renesas/vsp1/vsp1_drv.c
+++ b/drivers/media/platform/renesas/vsp1/vsp1_drv.c
@@ -641,8 +641,11 @@ static int vsp1_pm_suspend(struct device *dev)
static int vsp1_pm_resume(struct device *dev)
{
struct vsp1_device *vsp1 = dev_get_drvdata(dev);
+ int ret;
- pm_runtime_force_resume(vsp1->dev);
+ ret = pm_runtime_force_resume(vsp1->dev);
+ if (ret)
+ return ret;
/*
* When used as part of a display pipeline, the VSP is stopped and