Received: by 2002:a05:6622:f08:0:0:0:0 with SMTP id l8csp4480810ivc; Tue, 3 Nov 2020 13:09:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJwjvnGlRY52KjIAqxmJMiQC6n+EPLj2kZSshAoVgj2JldPLmMKEnPqz3bcmKFj02uxNoqdj X-Received: by 2002:aa7:cd56:: with SMTP id v22mr24484759edw.245.1604437758312; Tue, 03 Nov 2020 13:09:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604437758; cv=none; d=google.com; s=arc-20160816; b=VzATkeoxAYYMXlR00fUbqd0zAkCvGciFc8URWcKamDDQXWgHHc2DYvzUK7SCeJDxFL tE4aDjcXtUpiwHLQMc3kNEl6gtbtoY2WYeJYMMSH6VtqFsaB6cW2al7rWVQzZrXLt/Ja Mpo+nILK3F9sd4a8I+U++Fw0fd0SmEvX33xVAmGRSxXflh3IRe8UyquoP+Q3npd4/CmO Yv3vhp9mN/U4SHBCzAB+6xg/0rdLBs5LzeIV98E6NYSb3nP8IoLhIg2o2wdKfmYpMcX5 dDrn+wcWz2j8z+X/KjGMIpHxtDAAMVwXie9A6kJe6V6huJ0+17Xb46ayjnlEHa9Qp1Xs en1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=aEohNxVqr37OdTchRpsVzlpdd/UBrLfUK+f5jPMFsHg=; b=CUBo+vkewMTC+rLnti2uQP02S6IRkVyKXhsY7SCJQD3iY5o+AaD1cchpEBvoN7cbT+ Bz8+7qTTSr+SmHdbJxTOcuQCCPiPz6bdyqHxNf3qc/odQDtA1IM3DK1XP/acjot/8K+s 6j47TcnO3CQzZjBlEs7iQA+gOu+2RhgvEjZ0oBJMuiFgAuwlcEcQPYFt/itbBetIdlQ5 YrMXWwQg3ONtx8212PoeBGwPY5dYkQWayyzpeN38mKlRoJNSHfJDWEIJlpsZWi3VE1We x5qCfEfXtv9lNEh39guga8JGXPGcxDqWVNgvRHYoA1nObEvcJjjAR8cP+JaNLYPrjlQe y59g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=091Gy3cn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c14si10600269edr.82.2020.11.03.13.08.55; Tue, 03 Nov 2020 13:09:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=091Gy3cn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387859AbgKCVFg (ORCPT + 99 others); Tue, 3 Nov 2020 16:05:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:44178 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387843AbgKCVFg (ORCPT ); Tue, 3 Nov 2020 16:05:36 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EE6D220658; Tue, 3 Nov 2020 21:05:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604437535; bh=mXoUreHI0aNvEZzLZxyar8NXESuNJVxNrDSnXB+hF/4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=091Gy3cnRCJAy7T3ajbkEpqWksBfb58qQCgWnuoLB86Mn3XgfuCtbkCeJfCT8h+/p xhDDos7nh5GHICNCl71SFvesp2PrDm0BapfUuhNbQKnfQMtvFFG1CtpnnLecit77ey 1X+Bpkx9s/vGtVo3roDjuXhxlb8GqFUKxIYNCiHg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans de Goede , Laurent Pinchart , Mauro Carvalho Chehab Subject: [PATCH 4.19 117/191] media: uvcvideo: Fix uvc_ctrl_fixup_xu_info() not having any effect Date: Tue, 3 Nov 2020 21:36:49 +0100 Message-Id: <20201103203244.321392388@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203232.656475008@linuxfoundation.org> References: <20201103203232.656475008@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hans de Goede commit 93df48d37c3f03886d84831992926333e7810640 upstream. uvc_ctrl_add_info() calls uvc_ctrl_get_flags() which will override the fixed-up flags set by uvc_ctrl_fixup_xu_info(). uvc_ctrl_init_xu_ctrl() already calls uvc_ctrl_get_flags() before calling uvc_ctrl_add_info(), so the uvc_ctrl_get_flags() call in uvc_ctrl_add_info() is not necessary for xu ctrls. This commit moves the uvc_ctrl_get_flags() call for normal controls from uvc_ctrl_add_info() to uvc_ctrl_init_ctrl(), so that we no longer call uvc_ctrl_get_flags() twice for xu controls and so that we no longer override the fixed-up flags set by uvc_ctrl_fixup_xu_info(). This fixes the xu motor controls not working properly on a Logitech 046d:08cc, and presumably also on the other Logitech models which have a quirk for this in the uvc_ctrl_fixup_xu_info() function. Cc: stable@vger.kernel.org Signed-off-by: Hans de Goede Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- drivers/media/usb/uvc/uvc_ctrl.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) --- a/drivers/media/usb/uvc/uvc_ctrl.c +++ b/drivers/media/usb/uvc/uvc_ctrl.c @@ -2038,13 +2038,6 @@ static int uvc_ctrl_add_info(struct uvc_ goto done; } - /* - * Retrieve control flags from the device. Ignore errors and work with - * default flag values from the uvc_ctrl array when the device doesn't - * properly implement GET_INFO on standard controls. - */ - uvc_ctrl_get_flags(dev, ctrl, &ctrl->info); - ctrl->initialized = 1; uvc_trace(UVC_TRACE_CONTROL, "Added control %pUl/%u to device %s " @@ -2267,6 +2260,13 @@ static void uvc_ctrl_init_ctrl(struct uv if (uvc_entity_match_guid(ctrl->entity, info->entity) && ctrl->index == info->index) { uvc_ctrl_add_info(dev, ctrl, info); + /* + * Retrieve control flags from the device. Ignore errors + * and work with default flag values from the uvc_ctrl + * array when the device doesn't properly implement + * GET_INFO on standard controls. + */ + uvc_ctrl_get_flags(dev, ctrl, &ctrl->info); break; } }