From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C7076C43387 for ; Mon, 7 Jan 2019 16:25:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8D34A2183E for ; Mon, 7 Jan 2019 16:25:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546878309; bh=9q8eSOrziRFFAET9RzSe4T/uzbEZUiMMLLBJ+rjR0Xs=; h=Subject:To:From:Date:List-ID:From; b=i3M9t0PCc6mxi0RkiIxdFcps4q2CZCTgoTF5PrYAJUyoRxv+fZqWsvyR21bjOneWm 09dqS9ckwAXgU+45hcXH5m3Z0GzJS42MIjaq0Q8fAjALgyGloq5dcWv8Ctrxs+YV7n ET+9aU0c2v5rJx7AnaCX2CPv5MjNoCuVasDTi2gs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730266AbfAGQZJ (ORCPT ); Mon, 7 Jan 2019 11:25:09 -0500 Received: from mail.kernel.org ([198.145.29.99]:40860 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728049AbfAGQZJ (ORCPT ); Mon, 7 Jan 2019 11:25:09 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (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 AC12B2183E; Mon, 7 Jan 2019 16:25:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546878308; bh=9q8eSOrziRFFAET9RzSe4T/uzbEZUiMMLLBJ+rjR0Xs=; h=Subject:To:From:Date:From; b=SaFRTsktOrzReC9SE6mjc1w64KcGiEELJ2cSi8whNcVs4eYgIxJ3ZGy/LrGzlSWZd 0RpErO+Un4wCYzRsxHfhZuKTXaYxpLfWdO8nZFNxzqtffFP9uj2j3QHDUBk2xu4nPf T+MQ/M2AUnMvhUMRrq404Vdsf7md5LsFiAWjAK24= Subject: patch "usbcore: Select only first configuration for non-UAC3 compliant" added to usb-linus To: saranya.gopal@intel.com, gregkh@linuxfoundation.org, kernel@kolivas.org, stable@vger.kernel.org From: Date: Mon, 07 Jan 2019 17:24:53 +0100 Message-ID: <1546878293243207@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org This is a note to let you know that I've just added the patch titled usbcore: Select only first configuration for non-UAC3 compliant to my usb git tree which can be found at git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git in the usb-linus branch. The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.) The patch will hopefully also be merged in Linus's tree for the next -rc kernel release. If you have any questions about this process, please let me know. >From ff2a8c532c14fd22fb26a36574d9ff199afbbe54 Mon Sep 17 00:00:00 2001 From: Saranya Gopal Date: Sun, 6 Jan 2019 08:14:02 +0530 Subject: usbcore: Select only first configuration for non-UAC3 compliant devices 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 Cc: stable Signed-off-by: Greg Kroah-Hartman --- 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 356b05c82dbc..f713cecc1f41 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 -- 2.20.1