[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20241126-uvc-granpower-ng-v1-1-6312bf26549c@chromium.org>
Date: Tue, 26 Nov 2024 16:18:51 +0000
From: Ricardo Ribalda <ribalda@...omium.org>
To: Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Hans de Goede <hdegoede@...hat.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Guennadi Liakhovetski <guennadi.liakhovetski@...el.com>
Cc: linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
Mauro Carvalho Chehab <mchehab+samsung@...nel.org>,
Ricardo Ribalda <ribalda@...omium.org>, stable@...r.kernel.org
Subject: [PATCH 1/9] media: uvcvideo: Do not set an async control owned by
other fh
If a file handle is waiting for a response from an async control, avoid
that other file handle operate with it.
Without this patch, the first file handle will never get the event
associated to that operation.
Cc: stable@...r.kernel.org
Fixes: e5225c820c05 ("media: uvcvideo: Send a control event when a Control Change interrupt arrives")
Signed-off-by: Ricardo Ribalda <ribalda@...omium.org>
---
drivers/media/usb/uvc/uvc_ctrl.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c
index 4fe26e82e3d1..5d3a28edf7f0 100644
--- a/drivers/media/usb/uvc/uvc_ctrl.c
+++ b/drivers/media/usb/uvc/uvc_ctrl.c
@@ -1950,6 +1950,10 @@ int uvc_ctrl_set(struct uvc_fh *handle,
if (!(ctrl->info.flags & UVC_CTRL_FLAG_SET_CUR))
return -EACCES;
+ /* Other file handle is waiting a response from this async control. */
+ if (ctrl->handle && ctrl->handle != handle)
+ return -EBUSY;
+
/* Clamp out of range values. */
switch (mapping->v4l2_type) {
case V4L2_CTRL_TYPE_INTEGER:
--
2.47.0.338.g60cca15819-goog
Powered by blists - more mailing lists