Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2227214imu; Sat, 5 Jan 2019 18:48:19 -0800 (PST) X-Google-Smtp-Source: ALg8bN75Ti5ktYoU3nDvSH8hBmVSv929nm4+Oh6iLImXi+aGJB35Ckn1FwOLlgfCNC5jfTLjcvVG X-Received: by 2002:a17:902:9f93:: with SMTP id g19mr55513938plq.195.1546742899437; Sat, 05 Jan 2019 18:48:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546742899; cv=none; d=google.com; s=arc-20160816; b=VQ3noFFJwpcwfImMRvWCa4cbq/bfK2D5ziZW+MRwUHFEaEN8KlbWDxgrbxCvhviijT GTUR2yGXNEHLWqdAuQbERVkKhsLEZcobLKTypOXMFH3WK5y5LrvBE4iKRwT1UU4Fojqi 9GbdKJyjndNUTHT3eFnMEbUk2+GhvBkZSRhbkyCaWyZY0XWQFyILV0AZ8mBD+cgHMh8L 1tmrXLehuvs1UfjIvyLFf8XwUlzynxGoNj1wbISkGPQxOn5tda7KO7xZGAvYzQaVhQxX jbgzk7CTeyBo12tu3CA0WIH3OkTlJppaZZEyiPIeZ21ZDN4+oJglyX1+htIL3M2DWu3K /a9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=/rR5dOupwg4YMQUwnMBpm8fiyVCtVI0obPDtOZoRJfw=; b=uRJ5g11UZosg3JMTHLA5FyGrhnvEqo/0tak6qAIqICH1CzRjt+Kfe44omduudQrVk0 yYF9Zb3SYvoHl5RqQuVk+ytBTph1U2yr7hcUZ/68BMW7IobmovEHisVMOyOjraKKmF2z E4GU0r+yRm/NrPD2xKuyLTUdk0F3ltERYe5l0FzlfdC6dLB3R764iL2EfwqJgkti51Xp eZLf/PoTsX0chE09sGgYSczzBPExL6n2s/C+fJd3KG/Hc50HuaLQqEbrgDh9i5qO1eRk bbD/zRYHmDtiBZq9rlRaR3IjsDM7kmF3a36p34KptMeLbfbzIB3/IetdVgiRKE57uBt3 Rdyg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j10si7711949plg.123.2019.01.05.18.48.04; Sat, 05 Jan 2019 18:48:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726397AbfAFCqy (ORCPT + 99 others); Sat, 5 Jan 2019 21:46:54 -0500 Received: from mga09.intel.com ([134.134.136.24]:52179 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726375AbfAFCqy (ORCPT ); Sat, 5 Jan 2019 21:46:54 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Jan 2019 18:46:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,445,1539673200"; d="scan'208";a="264736108" Received: from saranya-h97m-d3h.iind.intel.com ([10.66.245.63]) by orsmga004.jf.intel.com with ESMTP; 05 Jan 2019 18:46:50 -0800 From: saranya.gopal@intel.com To: kernel@kolivas.org Cc: gregkh@linuxfoundation.org, pierre-louis.bossart@linux.intel.com, alsa-devel@alsa-project.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, tiwai@suse.de, felipe.balbi@linux.intel.com, Saranya Gopal Subject: [PATCH V3] usbcore: Select only first configuration for non-UAC3 compliant devices Date: Sun, 6 Jan 2019 08:14:02 +0530 Message-Id: <1546742642-29269-1-git-send-email-saranya.gopal@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Saranya Gopal In most of the UAC1 and UAC2 audio devices, the first configuration is most often the best configuration. However, with recent patch to support UAC3 configuration, second configuration was unintentionally chosen for some of the UAC1/2 devices that had more than one configuration. This was because of the existing check after the audio config check which selected any config which had a non-vendor class. This patch fixes this issue. Fixes: f13912d3f014 ("usbcore: Select UAC3 configuration for audio if present") Reported-by: Con Kolivas Signed-off-by: Saranya Gopal Tested-by: Con Kolivas --- Changes from V2: Added Tested-by tag Changes from V1: Added full commit name and more SHA1 numbers in Fixes tag drivers/usb/core/generic.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/usb/core/generic.c b/drivers/usb/core/generic.c index 356b05c..f713cec 100644 --- a/drivers/usb/core/generic.c +++ b/drivers/usb/core/generic.c @@ -143,9 +143,12 @@ int usb_choose_configuration(struct usb_device *udev) continue; } - if (i > 0 && desc && is_audio(desc) && is_uac3_config(desc)) { - best = c; - break; + if (i > 0 && desc && is_audio(desc)) { + if (is_uac3_config(desc)) { + best = c; + break; + } + continue; } /* From the remaining configs, choose the first one whose -- 1.9.1