alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Ard van Breemen <ard@kwaak.net>
To: alsa-devel@alsa-project.org
Cc: Ard van Breemen <ard@kwaak.net>
Subject: [PATCH 1/2] ALSA snd-usb-audio: Skip bSynchAddress endpoint check if it is invalid.
Date: Fri,  2 Aug 2019 13:52:14 +0200	[thread overview]
Message-ID: <20190802115215.311-2-ard@kwaak.net> (raw)
In-Reply-To: <20190802115215.311-1-ard@kwaak.net>

The Linux kernel assumes that get_endpoint(alts,0) and
get_endpoint(alts,1) are eachothers feedback endpoints.
To reassure that validity it will test bsynchaddress to comply with that
assumption. But if the bsyncaddress is 0 (invalid), it will flag that as
a wrong assumption and return an error.
Fix: Skip the test if bSynchAddress is 0.
Note: those with a valid bSynchAddress should have a code quirck added.

Signed-off-by: Ard van Breemen <ard@kwaak.net>
---
 sound/usb/pcm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
index 75b96929f76c..51a8faf25ed8 100644
--- a/sound/usb/pcm.c
+++ b/sound/usb/pcm.c
@@ -456,6 +456,7 @@ static int set_sync_endpoint(struct snd_usb_substream *subs,
 	}
 	ep = get_endpoint(alts, 1)->bEndpointAddress;
 	if (get_endpoint(alts, 0)->bLength >= USB_DT_ENDPOINT_AUDIO_SIZE &&
+	    get_endpoint(alts, 0)->bSynchAddress != 0 &&
 	    ((is_playback && ep != (unsigned int)(get_endpoint(alts, 0)->bSynchAddress | USB_DIR_IN)) ||
 	     (!is_playback && ep != (unsigned int)(get_endpoint(alts, 0)->bSynchAddress & ~USB_DIR_IN)))) {
 		dev_err(&dev->dev,
-- 
2.17.1

  reply	other threads:[~2019-08-02 11:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-02 11:52 [PATCH 0/2] ALSA snd-usb-audio: Add Pioneer DDJ-SX3 PCM support Ard van Breemen
2019-08-02 11:52 ` Ard van Breemen [this message]
2019-08-02 11:52 ` [PATCH 2/2] ALSA snd-usb-audio: Add Pioneer DDJ-SX3 PCM quirck Ard van Breemen
2019-08-06 10:52 ` [PATCH 0/2] ALSA snd-usb-audio: Add Pioneer DDJ-SX3 PCM support Takashi Iwai

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=20190802115215.311-2-ard@kwaak.net \
    --to=ard@kwaak.net \
    --cc=alsa-devel@alsa-project.org \
    /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).