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

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

 



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. Assume that usb-storage does not
refuse to bind.

Felipe, what is Nokia and the other people that have the multi-
functional gadgets use to switch from one function to the other?

Do those gadgets use separate _altsettings_ for BOT vs. UAS, or do they
use separate _configs_?

They have both. Both configs provide the same functions, if you look at
lsusb of the g_multi gadget:

...

The listing shows two configs: one for CDC + RNDIS and mass storage
BOT, the other for CDC ECM and mass storage BOT.  There's nothing about
UAS.

So you need a tool to switch between storage, CDC ....

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. So I loaded the g_multi driver. After that I loaded manually the storage driver and was able to access /dev/sda. 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

[  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

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.


Alan Stern




Sebastian
--
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