linux/drivers/usb/core
Dan Williams 48fc7dbd52 usb: xhci: change enumeration scheme to 'new scheme' by default
Change the default enumeration scheme for xhci attached non-SuperSpeed
devices from:

   Reset
   SetAddress [xhci address-device BSR = 0]
   GetDescriptor(8)
   GetDescriptor(18)

...to:

   Reset
   [xhci address-device BSR = 1]
   GetDescriptor(64)
   Reset
   SetAddress [xhci address-device BSR = 0]
   GetDescriptor(18)

...as some devices misbehave when encountering a SetAddress command
prior to GetDescriptor.  There are known legacy devices that require
this scheme, but testing has found at least one USB3 device that fails
enumeration when presented with this ordering.  For now, follow the ehci
case and enable 'new scheme' by default for non-SuperSpeed devices.

To support this enumeration scheme on xhci the AddressDevice operation
needs to be performed twice.  The first instance of the command enables
the HC's device and slot context info for the device, but omits sending
the device a SetAddress command (BSR == block set address request).
Then, after GetDescriptor completes, follow up with the full
AddressDevice+SetAddress operation.

As mentioned before, this ordering of events with USB3 devices causes an
extra state transition to be exposed to xhci.  Previously USB3 devices
would transition directly from 'enabled' to 'addressed' and never need
to underrun responses to 'get descriptor'. We do see the 64-byte
descriptor fetch the correct data, but the following 18-byte descriptor
read after the reset gets:

bLength            = 0
bDescriptorType    = 0
bcdUSB             = 0
bDeviceClass       = 0
bDeviceSubClass    = 0
bDeviceProtocol    = 0
bMaxPacketSize0    = 9

instead of:

bLength            = 12
bDescriptorType    = 1
bcdUSB             = 300
bDeviceClass       = 0
bDeviceSubClass    = 0
bDeviceProtocol    = 0
bMaxPacketSize0    = 9

which results in the discovery process looping until falling back to
'old scheme' enumeration.

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: David Moore <david.moore@gmail.com>
Suggested-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2013-12-10 13:54:37 -08:00
..
buffer.c usb: fix some scripts/kernel-doc warnings 2013-08-03 11:30:14 +08:00
config.c usb: core: get config and string descriptors for unauthorized devices 2013-12-09 13:27:32 -08:00
devices.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-02-26 20:16:07 -08:00
devio.c drivers: usb: core: devio.c: Spaces to tabs for proc_control_compat() 2013-10-16 13:38:37 -07:00
driver.c usb: core: Remove superfluous name casts 2013-12-03 11:17:28 -08:00
endpoint.c USB: core: be specific about attribute permissions 2013-08-25 15:12:03 -07:00
file.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-11-13 15:34:18 +09:00
generic.c USB: avoid error messages when a device is disconnected 2013-03-28 11:05:52 -07:00
hcd-pci.c usb: hcd: move controller wakeup setting initialization to individual driver 2013-12-08 18:06:46 -08:00
hcd.c usb: hcd: move controller wakeup setting initialization to individual driver 2013-12-08 18:06:46 -08:00
hub.c usb: xhci: change enumeration scheme to 'new scheme' by default 2013-12-10 13:54:37 -08:00
hub.h USB: global suspend and remote wakeup don't mix 2013-07-16 15:33:02 -07:00
Kconfig treewide: Fix typo in Kconfig 2013-10-14 15:23:02 +02:00
Makefile usb: Add driver/usb/core/(port.c,hub.h) files 2013-01-18 15:49:00 -08:00
message.c usb: Push USB2 LPM disable on disconnect into USB core. 2013-10-16 12:24:21 -07:00
notify.c usb: Add export.h for EXPORT_SYMBOL/THIS_MODULE where needed 2011-10-31 19:31:25 -04:00
otg_whitelist.h
port.c USB: core: be specific about attribute permissions 2013-08-25 15:12:03 -07:00
quirks.c Revert "USB: quirks: add touchscreen that is dazzeled by remote wakeup" 2013-12-08 18:07:38 -08:00
sysfs.c usb: Don't enable USB 2.0 Link PM by default. 2013-10-16 12:24:19 -07:00
urb.c usb: core: allow isoc URBs for wireless devices with an interval < 6 2013-12-09 13:27:32 -08:00
usb-acpi.c ACPI: Eliminate the DEVICE_ACPI_HANDLE() macro 2013-11-14 23:17:21 +01:00
usb.c drivers: usb: core: {file,hub,sysfs,usb}.c: Whitespace fixes 2013-10-11 17:02:37 -07:00
usb.h usbcore: set lpm_capable field for LPM capable root hubs 2013-09-17 09:49:24 -07:00