]> git.hungrycats.org Git - linux/commitdiff
media: amphion: Remove lock in s_ctrl callback
authorMing Qian <ming.qian@nxp.com>
Mon, 6 May 2024 08:49:17 +0000 (17:49 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Aug 2024 13:34:14 +0000 (15:34 +0200)
[ Upstream commit 065927b51eb1f042c3e026cebfd55e72ccc26093 ]

There is no need to add a lock in s_ctrl callback, it has been
synchronized by the ctrl_handler's lock, otherwise it may led to
a deadlock if the driver calls v4l2_ctrl_s_ctrl().

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Signed-off-by: Sebastian Fricke <sebastian.fricke@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/platform/amphion/vdec.c
drivers/media/platform/amphion/venc.c

index a57f9f4f3b87658caebda407053dcda2e6949fff..6a38a0fa0e2d480c76cc22b0d0036e15894da894 100644 (file)
@@ -195,7 +195,6 @@ static int vdec_op_s_ctrl(struct v4l2_ctrl *ctrl)
        struct vdec_t *vdec = inst->priv;
        int ret = 0;
 
-       vpu_inst_lock(inst);
        switch (ctrl->id) {
        case V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY_ENABLE:
                vdec->params.display_delay_enable = ctrl->val;
@@ -207,7 +206,6 @@ static int vdec_op_s_ctrl(struct v4l2_ctrl *ctrl)
                ret = -EINVAL;
                break;
        }
-       vpu_inst_unlock(inst);
 
        return ret;
 }
index 4eb57d793a9c0d60ec30b214196d59603346d45d..16ed4d21519cdbd47237f1faa803f785caffa87a 100644 (file)
@@ -518,7 +518,6 @@ static int venc_op_s_ctrl(struct v4l2_ctrl *ctrl)
        struct venc_t *venc = inst->priv;
        int ret = 0;
 
-       vpu_inst_lock(inst);
        switch (ctrl->id) {
        case V4L2_CID_MPEG_VIDEO_H264_PROFILE:
                venc->params.profile = ctrl->val;
@@ -579,7 +578,6 @@ static int venc_op_s_ctrl(struct v4l2_ctrl *ctrl)
                ret = -EINVAL;
                break;
        }
-       vpu_inst_unlock(inst);
 
        return ret;
 }