On 21/09/2010 23:01, Chris Frey wrote:
> On Tue, Sep 21, 2010 at 12:12:57PM +0100, Toby Gray wrote:
>> However there's clearly a reason for the call to usb_set_altinterface,
>> so can anyone remember what devices it was necessary for?
> It wasn't a specific device, it was all devices, I believe.  It was to work
> around a change in the kernel, which caused odd timeout issues.  Also,
> this fix made things work on Mac OSX and FreeBSD.
>
> The usb_set_altinterface() call is the only one in libusb that
> works directly with the interface, as far as I can tell.
>
> You can read the long, painstaking thread here.  I ended up doing
> a git-bisect on the kernel to find the spot where it was having trouble.
>
>       http://marc.info/?t=123554440300001&r=1&w=2
>
> Especially here, where Alan Stern says that calling set_altinterface()
> should always be safe.
>
>       http://marc.info/?l=linux-usb&m=123627088604495&w=2
>
Thanks for those links. It sounds like setting the alternate setting to 
0 for the interface is needed to make the connection work reliably, but 
that setting the alternate setting when URBs are outstanding on the 
other (usb-storage) interface really confuses most BlackBerry devices 
(although luckily not newer OSv5 ones as far as I can tell).

It's odd that I don't see the original issue described in the above 
thread on my Ubuntu 10.04 machine running 2.6.32, but as it was always a 
timing related issue that doesn't seem too surprising.
>> Depending on the history of that call and what devices it was needed
>> for, I'd suggest doing one of the following:
>> 1) Removing the call to it entirely
>> 2) Only call it if there are multiple alternate settings
>> 3) Add it as an option for the various tools and API users
>> 4) Carry on calling it but using a bAlternateSettings value retrieved
>> from the device; this won't fix the mass storage issue but will fix the
>> Barry code.
>>
>> What do people think?
> I think someone needs to reproduce the original problem from 2009, and
> see if option 2 would be a suitable fix, for Linux, Mac OSX, and FreeBSD. :-)
I don't think option 2 will help. I've tried a range of BlackBerry 
devices and none of them seem to have more than 1 alternate settings.

I'll have a more detailed look to see if there's some other way around 
this, although without being able to reproduce the original reason for 
calling usb_set_altinterface() that might be a bit tricky. So I'll 
probably try setting up a VM with a 2.6.28 kernel and see if I can 
reproduce the issue on there.

Regards,

Toby



------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Barry-devel mailing list
Barry-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/barry-devel

Reply via email to