Skip to content

Commit d6b874f

Browse files
ribaldamchehab
authored andcommitted
media: uvcvideo: Flush the control cache when we get an event
Asynchronous controls trigger an event when they have completed their operation. This can make that the control cached value does not match the value in the device. Let's flush the cache to be on the safe side. Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Link: https://lore.kernel.org/r/20241203-uvc-fix-async-v6-5-26c867231118@chromium.org Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
1 parent 02baaa0 commit d6b874f

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/media/usb/uvc/uvc_ctrl.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1622,6 +1622,9 @@ void uvc_ctrl_status_event(struct uvc_video_chain *chain,
16221622

16231623
mutex_lock(&chain->ctrl_mutex);
16241624

1625+
/* Flush the control cache, the data might have changed. */
1626+
ctrl->loaded = 0;
1627+
16251628
handle = ctrl->handle;
16261629
if (handle)
16271630
uvc_ctrl_set_handle(handle, ctrl, NULL);

0 commit comments

Comments
 (0)