Re: [PATCH] usb/uas: only bind if the hcd supports SG

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 11 Jan 2012, Sebastian Andrzej Siewior wrote:

> On 01/11/2012 07:44 PM, Alan Stern wrote:
> > On Wed, 11 Jan 2012, Sebastian Andrzej Siewior wrote:
> >
> >> * Alan Stern | 2012-01-11 12:11:57 [-0500]:
> >>
> >>> On Wed, 11 Jan 2012, Sebastian Andrzej Siewior wrote:
> >>>> Well no. Even if you override it in kernel the user still could switch
> >>>> it if he wants to.
> >>>
> >>> How?  If usb-storage refuses to bind to devices that support UAS, the
> >>> user has no way to force it to bind.
> >>
> >> I meant if UAS does not work _or_ he prefers BOT, he can still switch
> >> back to BOT.
> >
> > How can the user switch back to BOT if usb-storage refuses to bind?
> 
> In case both configs are available and are working and the user prefers
> BOT over UAS he could switch back.

There's some confusion here.  Go back and look at the section from the 
UAS spec that you quoted in your patch description.  BOT and UAS are 
supposed to be different altsettings for the same interface in the same 
config.  Not different interfaces or different configs.

(Although implementing them in two different configs probably isn't so
terrible, because users can easily switch configs by hand.  At least, 
on Linux systems they can -- I don't know about Windows or Mac OS.)

>  Assume that usb-storage does not
> refuse to bind.

But my original question explicitly asked about what happens if 
usb-storage _does_ refuse to bind.  So did both of the follow-up 
questions.


> > I don't understand.  Why can't you use CDC and storage at the same
> > time?
> 
> I though you can only use _one_ Interface at a time. Hmmm.

On any composite USB device you should be able to use multiple 
interfaces at the same time.

>  So I loaded 
> the g_multi driver. After that I loaded manually the storage driver and 
> was able to access /dev/sda.

Why did you need to load it manually?  Doesn't the hotplug mechanism 
load it automatically?

>  Next thing I did was loading the network 
> driver and I got usb0 and usb1. I set the ip address. After that I tried 
> to access dev/sda again and it hung:
> 
> [  157.672942] usbcore: registered new interface driver cdc_ether
> root@squsb:~# hexdump -C /dev/sda | head

That sounds like a bug.

> [  216.804125] cdc_ether 1-1:2.0: forced unbind
> [  216.804735] dummy_hcd dummy_hcd: shutdown urb deba5db0 ep3in-intr
> [  216.808351] cdc_ether 1-1:2.0: usb1: unregister 'cdc_ether' 
> usb-dummy_hcd-1, CDC Ethernet Device
> [  216.904273] hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0002
> [  216.960175] usb 1-1: reset high-speed USB device number 2 using dummy_hcd
> [  217.020186] hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0002
> [  217.124086]  gadget: high-speed config #2: Multifunction with CDC ECM

Presumably these resets were caused by usb-storage timing out and 
trying to recover.

> This went for a while and then it ended with:
> [  254.459129] sd 0:0:0:0: Device offlined - not ready after error recovery
> [  254.461439] sd 0:0:0:0: rejecting I/O to offline device
> [  254.462150] sd 0:0:0:0: rejecting I/O to offline device
> [  254.462996]  sda: unable to read partition table
> 
> That makes me think that I can not use two of those at the same time. 
> But I can use one of them at a time.

No, you definitely should be able to use two interfaces at the same 
time.  Something needs to be fixed.  Did you try checking with usbmon?

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux