]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: uvcvideo: Run uvc_ctrl_init_ctrl for all controls
authorRicardo Ribalda <ribalda@chromium.org>
Mon, 18 Aug 2025 20:15:38 +0000 (20:15 +0000)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Sat, 13 Sep 2025 16:35:02 +0000 (18:35 +0200)
The function uvc_ctrl_init_ctrl() is called for every control for every
entity, but it exits early if the entity is a extension unit. The comment
claims that this is done to avoid querying XU controls during probe.

We only query a control if its entity GUIDs and index matches the
uvc_ctrls list. There are only controls for the following GUIDs:
UVC_GUID_UVC_PROCESSING, UVC_GUID_UVC_CAMERA and
UVC_GUID_EXT_GPIO_CONTROLLER.

In other words, XU controls will not be queried even without this
condition.

In future patches we want to add ChromeOS XU controls that need to the
initialized. We will make sure that all cameras with ChromeOS XU can
be queried at probe time.

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Reviewed-by: Hans de Goede <hansg@kernel.org>
Signed-off-by: Hans de Goede <hansg@kernel.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/usb/uvc/uvc_ctrl.c

index 535f729086e5274a5632de05cf046312c62794fd..277209ee40c1739d6e86952b7e4f740c38f2f80b 100644 (file)
@@ -3181,15 +3181,6 @@ static void uvc_ctrl_init_ctrl(struct uvc_video_chain *chain,
 {
        unsigned int i;
 
-       /*
-        * XU controls initialization requires querying the device for control
-        * information. As some buggy UVC devices will crash when queried
-        * repeatedly in a tight loop, delay XU controls initialization until
-        * first use.
-        */
-       if (UVC_ENTITY_TYPE(ctrl->entity) == UVC_VC_EXTENSION_UNIT)
-               return;
-
        for (i = 0; i < ARRAY_SIZE(uvc_ctrls); ++i) {
                const struct uvc_control_info *info = &uvc_ctrls[i];