Skip to content

Commit eba63df

Browse files
author
Hans Verkuil
committed
Revert "media: v4l2-ctrls: show all owned controls in log_status"
This reverts commit 9801b5b. This patch introduced a potential deadlock scenario: [Wed May 8 10:02:06 2024] Possible unsafe locking scenario: [Wed May 8 10:02:06 2024] CPU0 CPU1 [Wed May 8 10:02:06 2024] ---- ---- [Wed May 8 10:02:06 2024] lock(vivid_ctrls:1620:(hdl_vid_cap)->_lock); [Wed May 8 10:02:06 2024] lock(vivid_ctrls:1608:(hdl_user_vid)->_lock); [Wed May 8 10:02:06 2024] lock(vivid_ctrls:1620:(hdl_vid_cap)->_lock); [Wed May 8 10:02:06 2024] lock(vivid_ctrls:1608:(hdl_user_vid)->_lock); For now just revert. Fixes: 9801b5b ("media: v4l2-ctrls: show all owned controls in log_status") Cc: [email protected] Signed-off-by: Hans Verkuil <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]>
1 parent 6983352 commit eba63df

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

drivers/media/v4l2-core/v4l2-ctrls-core.c

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2507,8 +2507,7 @@ int v4l2_ctrl_handler_setup(struct v4l2_ctrl_handler *hdl)
25072507
EXPORT_SYMBOL(v4l2_ctrl_handler_setup);
25082508

25092509
/* Log the control name and value */
2510-
static void log_ctrl(const struct v4l2_ctrl_handler *hdl,
2511-
struct v4l2_ctrl *ctrl,
2510+
static void log_ctrl(const struct v4l2_ctrl *ctrl,
25122511
const char *prefix, const char *colon)
25132512
{
25142513
if (ctrl->flags & (V4L2_CTRL_FLAG_DISABLED | V4L2_CTRL_FLAG_WRITE_ONLY))
@@ -2518,11 +2517,7 @@ static void log_ctrl(const struct v4l2_ctrl_handler *hdl,
25182517

25192518
pr_info("%s%s%s: ", prefix, colon, ctrl->name);
25202519

2521-
if (ctrl->handler != hdl)
2522-
v4l2_ctrl_lock(ctrl);
25232520
ctrl->type_ops->log(ctrl);
2524-
if (ctrl->handler != hdl)
2525-
v4l2_ctrl_unlock(ctrl);
25262521

25272522
if (ctrl->flags & (V4L2_CTRL_FLAG_INACTIVE |
25282523
V4L2_CTRL_FLAG_GRABBED |
@@ -2541,7 +2536,7 @@ static void log_ctrl(const struct v4l2_ctrl_handler *hdl,
25412536
void v4l2_ctrl_handler_log_status(struct v4l2_ctrl_handler *hdl,
25422537
const char *prefix)
25432538
{
2544-
struct v4l2_ctrl_ref *ref;
2539+
struct v4l2_ctrl *ctrl;
25452540
const char *colon = "";
25462541
int len;
25472542

@@ -2553,12 +2548,9 @@ void v4l2_ctrl_handler_log_status(struct v4l2_ctrl_handler *hdl,
25532548
if (len && prefix[len - 1] != ' ')
25542549
colon = ": ";
25552550
mutex_lock(hdl->lock);
2556-
list_for_each_entry(ref, &hdl->ctrl_refs, node) {
2557-
if (ref->from_other_dev ||
2558-
(ref->ctrl->flags & V4L2_CTRL_FLAG_DISABLED))
2559-
continue;
2560-
log_ctrl(hdl, ref->ctrl, prefix, colon);
2561-
}
2551+
list_for_each_entry(ctrl, &hdl->ctrls, node)
2552+
if (!(ctrl->flags & V4L2_CTRL_FLAG_DISABLED))
2553+
log_ctrl(ctrl, prefix, colon);
25622554
mutex_unlock(hdl->lock);
25632555
}
25642556
EXPORT_SYMBOL(v4l2_ctrl_handler_log_status);

0 commit comments

Comments
 (0)