Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1744421imu; Sat, 5 Jan 2019 06:10:00 -0800 (PST) X-Google-Smtp-Source: AFSGD/UNwi1MFG93PS37i3ne+1zQdLm6UDtXxW2mmYmf7qnfJet/N8zw7perrkKl/z77zwSB5Kgl X-Received: by 2002:a62:e0d8:: with SMTP id d85mr55348404pfm.214.1546697400404; Sat, 05 Jan 2019 06:10:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546697400; cv=none; d=google.com; s=arc-20160816; b=BPx5oh3Y1NJwIZmwast14nXc3xfVB5qcqOpp5E5T1UBoQBezm+bBfVWql2QlRBRTpQ VCNpJumKerjrAt9WvzgXY/bxhimpa34kqNfzxlTuwaNkMgWSar+MkC0MQTCJRvoj0en3 3CXUdGjqxasCBM03FdZ9AGL55TOF0EjwrYNsAQJXjWAK+MF9GBmxMgVyXGZP5/ALJXBH fkXy3FUDuk0Im7w/reEqqX8W0NlvKL98ZgEp6cwJjv7nSyeexgBT8SV5Tgmh41loK++r vm/beF3OjIltmsmCxjN51IYixS5/DNzNVkULUX903juxwe9dCD8OE+fsDO6G/iOwwTxd g6Ig== 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=9fqhe5cjKdWX3abSHL6l6XvSCEYUNMQ7+sU7exvku0k=; b=WZn9+xAsXzvciYE8l6iSEGiC+m4i7MzD18YVgWytbeoptZMKjJzIPYVBssjPQ3rpsM 4C3epGPBSjcJjvZxPbTyZGD7vKUPVUIoj93TZHYr8hCn9UeJ2mU4ZbBcRZ/SXHGIcB7a ru3Xs8mVBOA5oHhbl3+Fg7fWUDbSjHrktYv/EzhR3hiw2F1uTTuWYR/Pg77QugBfneRQ G/X4Yp5JpVqMYVtFscJh3ku/jpY1e6bLyd6WPlKoEHAhtk1ZlytiK2Nn3pFMx7o11P6B xP6K9KrA2amr4s7CYF28u9k1xDx/HXrLyUh+X+DPmGZjaDKaZ4sWYFs2KDK+KajbWJ2p YUCQ== 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 n184si59139144pgn.95.2019.01.05.06.09.23; Sat, 05 Jan 2019 06:10:00 -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 S1726248AbfAEOGN (ORCPT + 99 others); Sat, 5 Jan 2019 09:06:13 -0500 Received: from mga18.intel.com ([134.134.136.126]:33340 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726200AbfAEOGN (ORCPT ); Sat, 5 Jan 2019 09:06:13 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Jan 2019 06:06:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,443,1539673200"; d="scan'208";a="124341077" Received: from saranya-h97m-d3h.iind.intel.com ([10.66.245.63]) by orsmga001.jf.intel.com with ESMTP; 05 Jan 2019 06:06:10 -0800 From: saranya.gopal@intel.com To: kernel@kolivas.org Cc: 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] usbcore: Select only first configuration for non-UAC3 compliant devices Date: Sat, 5 Jan 2019 19:32:37 +0530 Message-Id: <1546696957-28294-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: f13912d (Select UAC3 configuration for audio if present) Reported-by: Con Kolivas Signed-off-by: Saranya Gopal --- 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