From: Marcel Holtmann <marcel@holtmann.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Oliver Neukum <oliver@neukum.org>,
linux-bluetooth@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: [rfc]btusb with SCO support
Date: Tue, 19 Aug 2008 20:19:46 +0200 [thread overview]
Message-ID: <1219169986.7591.169.camel@violet.holtmann.net> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0808191142160.2669-100000@iolanthe.rowland.org>
Hi Alan,
> > > And presumably, if the number of SCO connections increases from one to
> > > two then you need to switch to yet another altsetting -- while keeping
> > > the existing connection intact, yes?
> >
> > The connection will be kept alive. That is not the problem. We have to
> > cancel all URBs, select the new setting and then re-submit them.
>
> Along with any URBs that were generated while the new altsetting was
> being installed, right?
>
> If you're already keeping track of old URBs that were cancelled, why is
> it hard to keep track of new URBs as well?
>
> > As mentioned above, there is nothing much we can do. Once we get the
> > connection established event, we have to submit URBs. The event comes in
> > via an interrupt URB. In theory we could defer the processing of the HCI
> > events, but that would have bad impact on all other parts of Bluetooth
> > and doing this only for audio makes no sense.
>
> How about deferring only the submission of isoc URBs while doing all
> the others immediately?
the bulk, control and interrupt URBs are on a different interface and so
they are not affected.
> > > Is it possible to change the subsystem design so that, for example, in
> > > addition to getting a notify() callback when the connection settings
> > > change, you also call a ready() function in the subsystem core to tell
> > > it when the new settings are ready for use?
> >
> > I was thinking about that. However it is still the same problem. We do
> > have to submit URBs as soon as the connection is up. For the bulk URBs
> > (for ACL) it is no problem. The only issue is with isoc URB (for SCO),
> > because we have to pick an alternate setting first.
>
> Well, you _can't_ submit isoc URBs before changing the altsetting; it
> just won't work. So you can't start submitting them as soon as the
> connection is up -- the hardware doesn't allow it. One way or another
> they have to be deferred. The only question is how the deferrals
> should be implemented.
Our problem is only that we are using a workqueue and can't make any
assumption when we get scheduled. This is obviously not perfect, but it
seems there is nothing much that can be done.
I think the specification is simply bad and we have to live with it.
> > > If not, and you are forced to rely on queuing URBs for later
> > > submission, then I think it might be more appropriate to do this
> > > queuing in the Bluetooth driver code rather than in usbcore. You could
> > > have an entire anchor devoted to deferred URBs.
> >
> > What happens if we submit the isoc URBs right away and the call
> > usb_set_interface at some later time. Will these be canceled or what
> > happens to them when switching the endpoint.
>
> When you call usb_set_interface(), all pending URBs for that interface
> will be cancelled and will complete with a status of -ESHUTDOWN.
>
> (Hmm, looking at the code I see that the altsetting gets changed
> _before_ the old URBs are cancelled. That probably is a bug...)
Currently we cancel the URBs before calling usb_set_inferface.
Regards
Marcel
next prev parent reply other threads:[~2008-08-19 18:19 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-31 12:52 [rfc]btusb with SCO support Oliver Neukum
2008-07-31 14:03 ` Marcel Holtmann
2008-07-31 15:21 ` Oliver Neukum
2008-08-01 17:42 ` Marcel Holtmann
2008-08-02 23:47 ` Alan Stern
2008-08-01 10:32 ` Oliver Neukum
2008-08-01 17:43 ` Marcel Holtmann
2008-08-01 11:57 ` Oliver Neukum
2008-08-01 17:45 ` Marcel Holtmann
2008-08-04 8:33 ` Oliver Neukum
2008-08-04 16:05 ` Marcel Holtmann
2008-08-04 16:23 ` Oliver Neukum
2008-08-04 16:33 ` Marcel Holtmann
2008-08-04 17:01 ` Oliver Neukum
2008-08-04 17:25 ` Marcel Holtmann
2008-08-04 18:32 ` Oliver Neukum
2008-08-04 20:24 ` Marcel Holtmann
2008-08-05 11:15 ` Oliver Neukum
2008-08-08 21:14 ` Marcel Holtmann
2008-08-12 20:53 ` Oliver Neukum
2008-08-12 21:36 ` Marcel Holtmann
2008-08-13 15:16 ` Oliver Neukum
2008-08-13 18:23 ` Marcel Holtmann
2008-08-18 10:13 ` Marcel Holtmann
2008-08-18 12:57 ` Oliver Neukum
2008-08-18 13:38 ` Marcel Holtmann
2008-08-18 13:52 ` Oliver Neukum
2008-08-18 14:10 ` Marcel Holtmann
2008-08-18 14:27 ` Oliver Neukum
2008-08-18 14:36 ` Marcel Holtmann
2008-08-18 14:38 ` Oliver Neukum
2008-08-18 15:12 ` Marcel Holtmann
2008-08-18 16:03 ` Oliver Neukum
2008-08-18 17:07 ` Marcel Holtmann
2008-08-18 21:26 ` Oliver Neukum
2008-08-19 4:05 ` Marcel Holtmann
2008-08-19 7:03 ` Oliver Neukum
2008-08-19 7:19 ` Marcel Holtmann
2008-08-19 7:30 ` Oliver Neukum
2008-08-19 7:52 ` Marcel Holtmann
2008-08-19 14:49 ` Alan Stern
2008-08-19 15:18 ` Marcel Holtmann
2008-08-19 15:53 ` Alan Stern
2008-08-19 18:19 ` Marcel Holtmann [this message]
2008-08-19 18:57 ` Alan Stern
2008-08-20 6:39 ` Dave Higton
2008-08-20 13:50 ` Alan Stern
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=1219169986.7591.169.camel@violet.holtmann.net \
--to=marcel@holtmann.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=oliver@neukum.org \
--cc=stern@rowland.harvard.edu \
/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