usb/uas: only bind if the hcd supports SG
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Wed, 11 Jan 2012 11:42:32 +0000 (12:42 +0100)
committerLuis Henriques <luis.henriques@canonical.com>
Mon, 30 Apr 2012 18:15:15 +0000 (19:15 +0100)
commitfd96dbd8d26bc83a0fd8ba041c08144e5c9d78c7
tree834e27fb41e7aa841abd8283d25976607e9a89b8
parentaf2bf3762aee4ede2907dac6d0d369d32d1b947f
usb/uas: only bind if the hcd supports SG

BugLink: http://bugs.launchpad.net/bugs/901215

The UAS driver requires SG support by the HCD operating the device. This
patch stops UAS from operating on a HCD without sg support and prints a
message to let him know.

The spec says:
|For [USB2] backward compatibility, the device shall present [BOT] as
|alternate interface zero (primary) and [UAS] as alternate interface one
|(secondary). A device which does not need backward compatibility with
|[BOT] shall present [UAS] as alternate interface zero. In [USB2]
|systems, the [BOT] driver or an associated filter driver may need to
|issue a SET INTERFACE request for alternate interface one and then allow
|the [UAS] driver to load.

If the user used usb_modeswitch to switch to UAS then he can go back to
BOT or use a different HCD. In case UAS is the only interface then there
is currently no way out.
In future usb_sg_wait() should be extended to provide a non-blocking
interface so it can work with the UAS driver.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
(cherry picked from commit c898add51c7b5b99fcecdeaf4df2ca30949cacb6)

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Herton Krzesinski <herton.krzesinski@canonical.com>
drivers/usb/storage/uas.c