Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1912615imu; Sat, 5 Jan 2019 09:43:24 -0800 (PST) X-Google-Smtp-Source: ALg8bN5gElXzc0pFcFpP6xcbjKkJ2qnrJPYo0WnMxOg9n3oOnMz7VVqPr9inANpu+zdnTMDJFVkV X-Received: by 2002:a62:b15:: with SMTP id t21mr58879358pfi.136.1546710204113; Sat, 05 Jan 2019 09:43:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546710204; cv=none; d=google.com; s=arc-20160816; b=a2d1hZLnumbC0+3z3F2HmeEayP1o61+GKTLALz4v7HUhXbZvMHkZ7K3gf9SaeFoXrB apaLJv0ISV5IGaRy/QX5Uhbje04xb9NM2s61GB85z6+Gqu47u3inl5ZZhPTC9xPTEJqY PLIguwstCg/BIdWaKfMOoYiMKhr/LZMdRy3QG8CSP/CPBUcWsEYLnQ7ylH2wHvfQ4TA3 Toe/oTJVcaN1tfyWSatpbyQ+IdMyCCJJvdCZjOV0s8mlilj7ztSEA1tZ1TfEgjnyZ/h0 hIthlYQzJpn+XO/zKkp23yAsjTIRMnUddkenbTTOG70fuqHT/jHr2wmHkHsOBO+4pvMG ptoA== 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=QrOaU0xC8eYO5/QhnUZ7DFeYrIEbHc3AhazFAMDfzfk=; b=DJMsBajkn9Y3+oSu6UtYbid5IrI3+5gbkBhy3XnyFscnrsFlRwK6qyEERNHYHRS5Ld AoLcYjncbBdrbPFn1TRq2V6Dv++FcwRkBY6ReKMT64VHJKiO0jbC0BBHugMbIxv/+s4a bTYu8tXpZWbxGRPBrBHIoViXtjHWvDkrc60iMuoXrBt+2RLS4VnMRT0oOjhn6ek2lQRJ 1alPtIgB/frwmKKVtYyA18ocHp3j+5P50enzm/7fwMDvdr0ZZV+2ZJKVl4BmJ65B2Tw8 vdp/CPCp3nUzQNRmi+M+QERKwyJ+3y/xIKEYlsq1EdIdKBRmSY1Y4aFd0Neio5rMx21W UP5A== 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 135si19096664pge.572.2019.01.05.09.43.08; Sat, 05 Jan 2019 09:43:24 -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 S1726412AbfAERl6 (ORCPT + 99 others); Sat, 5 Jan 2019 12:41:58 -0500 Received: from mga09.intel.com ([134.134.136.24]:52085 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726252AbfAERl6 (ORCPT ); Sat, 5 Jan 2019 12:41:58 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Jan 2019 09:41:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,443,1539673200"; d="scan'208";a="289094851" Received: from saranya-h97m-d3h.iind.intel.com ([10.66.245.63]) by orsmga005.jf.intel.com with ESMTP; 05 Jan 2019 09:41:54 -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 V2] usbcore: Select only first configuration for non-UAC3 compliant devices Date: Sat, 5 Jan 2019 23:09:02 +0530 Message-Id: <1546709942-28634-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 --- 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