From: Kevin.xie Date: Tue, 8 Nov 2022 08:37:45 +0000 (+0800) Subject: media: v4l2_driver: Supplement the missing runtime pm get ops on more than once strea... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=135da7576122c38df4d803b713d94561a84a75d7;p=platform%2Fkernel%2Flinux-starfive.git media: v4l2_driver: Supplement the missing runtime pm get ops on more than once stream_on cases. For example, if we run stf_isp_ctrl & v4l2test at the same time, s_stream for sensor will be called twice, so that rpm should be got twice too. Signed-off-by: Kevin.xie --- diff --git a/drivers/media/platform/starfive/v4l2_driver/imx219_mipi.c b/drivers/media/platform/starfive/v4l2_driver/imx219_mipi.c index 9bc20d1c9be5..7230fac922eb 100644 --- a/drivers/media/platform/starfive/v4l2_driver/imx219_mipi.c +++ b/drivers/media/platform/starfive/v4l2_driver/imx219_mipi.c @@ -1144,16 +1144,18 @@ static int imx219_set_stream(struct v4l2_subdev *sd, int enable) int ret = 0; mutex_lock(&imx219->mutex); - if (imx219->streaming && enable) - goto unlock; if (enable) { ret = pm_runtime_get_sync(&client->dev); if (ret < 0) { pm_runtime_put_noidle(&client->dev); + mutex_unlock(&imx219->mutex); return ret; } + if (imx219->streaming) + goto unlock; + /* * Apply default & customized values * and then start streaming.