From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Ming Qian <ming.qian@nxp.com>,
Sebastian Fricke <sebastian.fricke@collabora.com>,
Hans Verkuil <hverkuil-cisco@xs4all.nl>,
Sasha Levin <sashal@kernel.org>,
eagle.zhou@nxp.com, mchehab@kernel.org,
linux-media@vger.kernel.org
Subject: [PATCH AUTOSEL 6.6 10/20] media: amphion: Remove lock in s_ctrl callback
Date: Sun, 28 Jul 2024 11:45:08 -0400 [thread overview]
Message-ID: <20240728154605.2048490-10-sashal@kernel.org> (raw)
In-Reply-To: <20240728154605.2048490-1-sashal@kernel.org>
From: Ming Qian <ming.qian@nxp.com>
[ 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 | 2 --
drivers/media/platform/amphion/venc.c | 2 --
2 files changed, 4 deletions(-)
diff --git a/drivers/media/platform/amphion/vdec.c b/drivers/media/platform/amphion/vdec.c
index 133d77d1ea0c3..4f438eaa7d385 100644
--- a/drivers/media/platform/amphion/vdec.c
+++ b/drivers/media/platform/amphion/vdec.c
@@ -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;
}
diff --git a/drivers/media/platform/amphion/venc.c b/drivers/media/platform/amphion/venc.c
index 4eb57d793a9c0..16ed4d21519cd 100644
--- a/drivers/media/platform/amphion/venc.c
+++ b/drivers/media/platform/amphion/venc.c
@@ -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;
}
--
2.43.0
next prev parent reply other threads:[~2024-07-28 15:47 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-28 15:44 [PATCH AUTOSEL 6.6 01/20] drm/amd/display: Add delay to improve LTTPR UHBR interop Sasha Levin
2024-07-28 15:45 ` [PATCH AUTOSEL 6.6 02/20] drm/amdgpu: fix potential resource leak warning Sasha Levin
2024-07-28 15:45 ` [PATCH AUTOSEL 6.6 03/20] drm/amdgpu/pm: Fix the param type of set_power_profile_mode Sasha Levin
2024-07-28 15:45 ` [PATCH AUTOSEL 6.6 04/20] drm/amdgpu/pm: Fix the null pointer dereference for smu7 Sasha Levin
2024-07-28 15:45 ` [PATCH AUTOSEL 6.6 05/20] drm/amdgpu: Fix the null pointer dereference to ras_manager Sasha Levin
2024-07-28 15:45 ` [PATCH AUTOSEL 6.6 06/20] drm/amdgpu/pm: Fix the null pointer dereference in apply_state_adjust_rules Sasha Levin
2024-07-28 15:45 ` [PATCH AUTOSEL 6.6 07/20] drm/admgpu: fix dereferencing null pointer context Sasha Levin
2024-07-28 15:45 ` [PATCH AUTOSEL 6.6 08/20] drm/amdgpu: Add lock around VF RLCG interface Sasha Levin
2024-07-28 15:45 ` [PATCH AUTOSEL 6.6 09/20] drm/amd/pm: Fix the null pointer dereference for vega10_hwmgr Sasha Levin
2024-07-28 15:45 ` Sasha Levin [this message]
2024-07-28 15:45 ` [PATCH AUTOSEL 6.6 11/20] drm/amd/display: Add NULL check for 'afb' before dereferencing in amdgpu_dm_plane_handle_cursor_update Sasha Levin
2024-07-28 15:45 ` [PATCH AUTOSEL 6.6 12/20] drm/amd/display: Add null checker before passing variables Sasha Levin
2024-07-28 15:45 ` [PATCH AUTOSEL 6.6 13/20] media: uvcvideo: Ignore empty TS packets Sasha Levin
2024-07-28 15:45 ` [PATCH AUTOSEL 6.6 14/20] media: uvcvideo: Fix the bandwdith quirk on USB 3.x Sasha Levin
2024-07-28 15:45 ` [PATCH AUTOSEL 6.6 15/20] media: uvcvideo: Remove mappings form uvc_device_info Sasha Levin
2024-07-28 15:45 ` [PATCH AUTOSEL 6.6 16/20] media: xc2028: avoid use-after-free in load_firmware_cb() Sasha Levin
2024-07-28 15:45 ` [PATCH AUTOSEL 6.6 17/20] ext4: fix uninitialized variable in ext4_inlinedir_to_tree Sasha Levin
2024-07-28 15:45 ` [PATCH AUTOSEL 6.6 18/20] jbd2: avoid memleak in jbd2_journal_write_metadata_buffer Sasha Levin
2024-07-28 15:45 ` [PATCH AUTOSEL 6.6 19/20] s390/sclp: Prevent release of buffer in I/O Sasha Levin
2024-07-28 15:45 ` [PATCH AUTOSEL 6.6 20/20] SUNRPC: Fix a race to wake a sync task Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240728154605.2048490-10-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=eagle.zhou@nxp.com \
--cc=hverkuil-cisco@xs4all.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=ming.qian@nxp.com \
--cc=sebastian.fricke@collabora.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox