linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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 <saranya.gopal@intel.com>
Subject: [PATCH V2] usbcore: Select only first configuration for non-UAC3 compliant devices
Date: Sat,  5 Jan 2019 23:09:02 +0530	[thread overview]
Message-ID: <1546709942-28634-1-git-send-email-saranya.gopal@intel.com> (raw)
In-Reply-To: <CABqErrHKFshAMBPHJp2vmGFE6k1GL1oDMSMbDRcBJNfUSxt9KQ@mail.gmail.com>

From: Saranya Gopal <saranya.gopal@intel.com>

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 <kernel@kolivas.org>
Signed-off-by: Saranya Gopal <saranya.gopal@intel.com>
---
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


  parent reply	other threads:[~2019-01-05 17:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-03 11:43 ALSA:usb audio Higher sample rates on usb audio no longer working Con Kolivas
2019-01-03 13:23 ` Takashi Iwai
2019-01-03 23:16   ` Con Kolivas
2019-01-04  6:27     ` Takashi Iwai
2019-01-04 15:23       ` [alsa-devel] " Pierre-Louis Bossart
2019-01-04 16:52         ` Gopal, Saranya
2019-01-04 17:13           ` Pierre-Louis Bossart
2019-01-04 20:34           ` Con Kolivas
2019-01-05 14:14             ` Gopal, Saranya
2019-01-05 14:02     ` [PATCH] usbcore: Select only first configuration for non-UAC3 compliant devices saranya.gopal
2019-01-05 14:35       ` Greg KH
2019-01-05 17:39     ` saranya.gopal [this message]
2019-01-05 22:02       ` [PATCH V2] " Con Kolivas
2019-01-06  2:44     ` [PATCH V3] " saranya.gopal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1546709942-28634-1-git-send-email-saranya.gopal@intel.com \
    --to=saranya.gopal@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=felipe.balbi@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel@kolivas.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).