All of lore.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: David Fries <david@fries.net>
Cc: David Griffith <dgriffi@cs.csubak.edu>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
	todd@fries.net
Subject: Re: bad endpoint address, MOTU FastLane
Date: Tue, 12 May 2009 09:55:08 +0200	[thread overview]
Message-ID: <4A092B5C.603@ladisch.de> (raw)
In-Reply-To: <20090511221203.GB4300@spacedout.fries.net>

David Fries wrote:
> usb_submit_urb returns -22 EINVAL invalid argument as it is trying to
> submit an interrupt packet to what is registered as an isoc endpoint.
> The second interface has the same end point addresses as the first.
> Any suggestions on how to deal with this class of broken hardware?
> 
> I:* If#= 0 Alt= 0 ...
> E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=1ms
> I:* If#= 1 Alt= 0 ...
> E:  Ad=81(I) Atr=01(Isoc) MxPS=   4 Ivl=1ms

AFAICS the USB core memorizes the descriptor belonging to a specific
endpoint number whenever usb_set_interface() is called.  In this case,
the second interface is initialized later, so the second set of
descriptors wins.

The driver could call usb_set_interface() again for the first interface
so that the USB core takes notice of the first set of endpoints again.
Please try the patch below.

I guess I'll have to write another quirk for this.


--- linux/sound/usb/usbmidi.c
+++ linux/sound/usb/usbmidi.c
@@ -1779,6 +1779,7 @@
 		err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints);
 		break;
 	case QUIRK_MIDI_RAW:
+		usb_set_interface(umidi->chip->dev, 0, 0);
 		umidi->usb_protocol_ops = &snd_usbmidi_raw_ops;
 		err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints);
 		break;

  reply	other threads:[~2009-05-12  7:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-11 22:12 bad endpoint address, MOTU FastLane David Fries
2009-05-12  7:55 ` Clemens Ladisch [this message]
2009-05-12 14:08   ` Alan Stern
2009-05-12 15:22     ` Todd T. Fries
2009-05-12 15:44       ` Alan Stern
2009-05-24 22:07   ` David Fries
2009-05-25  8:20     ` Clemens Ladisch
2009-05-26  0:41       ` David Fries
2009-05-26  7:25         ` Clemens Ladisch

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=4A092B5C.603@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=akpm@linux-foundation.org \
    --cc=david@fries.net \
    --cc=dgriffi@cs.csubak.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=todd@fries.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.