On Tue, Dec 3, 2013 at 9:54 AM, Sarah Sharp <sarah.a.sharp@xxxxxxxxxxxxxxx> wrote: > On Wed, Nov 27, 2013 at 05:07:04PM +0100, Aymen BOUATTAY wrote: >> Hi Pratyush, >> >> Douglas Turner pointed me to this thread discussion >> http://www.spinics.net/lists/linux-usb/msg95103.html >> >> seems there is some issue to use new scheme enumeration with super speed devices >> >> Hi Sarah, >> Any comments will be appreciated > > Dan, I'm trying to remember if we actually ran into issues with USB 3.0 > devices not enumerating correctly with the new scheme, or if I was just > being cautious, since we have always enumerated USB 3.0 devices with the > old scheme. Do you remember if you actually ran into issues with the > new scheme enumeration? > Yeah, I had to refresh my recollection too... we do run into problems with this, hence the comments in the patch and the decision to disable this for superspeed devices. Tests with both a superspeed storage device and a hub fail with messages like the following where we fail to get a valid descriptor following the initial reset. It eventually works after falling back to the old scheme which is why the patch just defaults to new_scheme by default. [ 4596.670653] usb 3-1: use_new_scheme: new [ 4596.833461] usb 3-1: new SuperSpeed USB device number 2 using xhci_hcd [ 4596.852747] usb 3-1: got a wrong device descriptor, warm reset device [ 4597.971375] usb 3-1: use_new_scheme: new [ 4598.135695] usb 3-1: new SuperSpeed USB device number 3 using xhci_hcd [ 4598.155420] usb 3-1: got a wrong device descriptor, warm reset device [ 4599.274072] usb 3-1: use_new_scheme: old [ 4599.281802] usb 3-1: new SuperSpeed USB device number 4 using xhci_hcd [ 4599.605581] usb 3-1: New USB device found, idVendor=2109, idProduct=0810 [ 4599.614590] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [ 4599.623518] usb 3-1: Product: 4-Port USB 3.0 Hub [ 4599.629594] usb 3-1: Manufacturer: VIA Labs, Inc. [ 4599.733426] hub 3-1:1.0: USB hub found [ 4599.744470] hub 3-1:1.0: 4 ports detected [..] [ 4600.176055] usb 3-1.4: use_new_scheme: new [ 4600.303132] usb 3-1.4: new SuperSpeed USB device number 5 using xhci_hcd [ 4600.322531] usb 3-1.4: got a wrong device descriptor, warm reset device [ 4600.977226] usb 3-1.4: use_new_scheme: new [ 4601.104302] usb 3-1.4: new SuperSpeed USB device number 6 using xhci_hcd [ 4601.123944] usb 3-1.4: got a wrong device descriptor, warm reset device [ 4601.778398] usb 3-1.4: use_new_scheme: old [ 4601.784459] usb 3-1.4: new SuperSpeed USB device number 7 using xhci_hcd [ 4601.804194] usb 3-1.4: New USB device found, idVendor=174c, idProduct=55aa [ 4601.813222] usb 3-1.4: New USB device strings: Mfr=2, Product=3, SerialNumber=1 [ 4601.822452] usb 3-1.4: Product: Plugable USB3-SATA-UASP1 [ 4601.829362] usb 3-1.4: Manufacturer: ASM1053E [ 4601.835200] usb 3-1.4: SerialNumber: 12345678902B Note that these messages came from the incremental patch attached to attempt new scheme for superspeed devices. >> -----Original Message----- >> From: Pratyush Anand [mailto:pratyush.anand@xxxxxxxxx] >> Sent: mardi 26 novembre 2013 14:06 >> To: Aymen BOUATTAY; sarah.a.sharp@xxxxxxxxxxxxxxx >> Cc: linux-usb@xxxxxxxxxxxxxxx >> Subject: Re: Xhci Host not allowed to send get device desc at addr zero >> >> Hi Aymen >> >> >> On Tue, Nov 26, 2013 at 4:31 PM, Aymen BOUATTAY <aymen.bouattay@xxxxxx> wrote: >> > Hi, >> > >> > I'm using Kernel release 3.4 with an embedded xhci host controller >> > Seems USB core driver does not allow xhci controller to send a get >> > device descriptor at address zero As when a device is attached to the >> > root hub, usb core driver reset the device and if the link is >> > superspeed than do a set_address >> > >> > LeCroy Compliance test TD7.06 Data Payload Packet Framing Robustness >> > test script expects for get device descriptor at @ zero from host >> > Presumably because that is what that other operating system expects? >> > How to let xhci controller sending a get device descriptor command before setting an address to USB3 device ? You can try the attached patch on top of the new scheme enabling patch [1], but with the devices I have tried enumeration falls back to "old scheme". >> It does not work because USE_NEW_SCHEME has not been enabled for super speed devices. >> >> I see following comment >> >> "An xHCI controller cannot send any packets to a device until a set address command successfully completes." >> >> in >> >> commit c6515272b858742962c1de0f3bf497a048b9abd7 >> Author: Sarah Sharp <sarah.a.sharp@xxxxxxxxxxxxxxx> >> Date: Mon Apr 27 19:57:26 2009 -0700 >> USB: Support for addressing a USB device under xHCI >> >> Hi Sarah, >> >> But as per usb3.0 specs section 9.4.3 get descriptor should be allowed in default state. >> >> xhci specs is not very clear about it. >> >> xhci specs says >> "once a successful address device command has completed, system software can issue USB GET_DESCRIPTOR request through Default Control Endpoint to retrieve the USB Device, configuration, etc. descriptors from USB device." >> >> So, what if XHCI Software issues, SET ADDRESS(0) followed by GET DESC(Device). At a minimum XHCI needs to perform a "set address command BSR=1" before "get descriptor". Refer to the patch changelog [2] for the details: -- Dan [1]: https://git.kernel.org/cgit/linux/kernel/git/djbw/usb.git/log/?h=xhci-new-scheme [2]: https://git.kernel.org/cgit/linux/kernel/git/djbw/usb.git/commit/?h=xhci-new-scheme&id=5723570b
Attachment:
new-scheme-debug
Description: Binary data