mbox series

[U-Boot,00/14] usb: xhci: Add interrupt transfer support and full speed device support

Message ID 1505742050-5697-1-git-send-email-bmeng.cn@gmail.com
Headers show
Series usb: xhci: Add interrupt transfer support and full speed device support | expand

Message

Bin Meng Sept. 18, 2017, 1:40 p.m. UTC
This adds the missing interrupt transfer support to xHCI driver, so
that devices like USB keyboard that uses interrupt transfer when
CONFIG_SYS_USB_EVENT_POLL is defined can work.

This also adds full speed device support. Unlike low/high/super speed
devices, full speed device may report its endpoint 0 max packet size
as 8/16/32/64. xHCI driver guesses 64 for the first attempt to get the
initial 8 bytes device descriptor, and later adjusts the context for
endpoint 0.

This series also made several updates to xHCI driver to conform with
the spec.

This series is available at u-boot-x86/xhci-working for testing.


Bin Meng (14):
  dm: usb: Fix broken usb_stop()
  dm: usb: Remove no longer needed blk_unbind_all()
  usb: xhci: Don't assume LS/FS devices are always behind a HS hub
  usb: Handle audio extension endpoint descriptor in usb_parse_config()
  usb: xhci: Add interrupt transfer support
  usb: Only get 64 bytes device descriptor for full speed devices
  usb: Read device descriptor after device is addressed for xHCI
  usb: xhci: Fix max packet size for full speed device endpoint 0
  usb: hub: Clear port reset before usb_hub_port_connect_change()
  usb: hub: Clear BH reset status change for a 3.0 hub
  usb: xhci: Honor endpoint's interval
  usb: xhci: Program max burst size for endpoint
  usb: xhci: Set 'Error Count' to 0 for isoch endpoints
  usb: xhci: Set 'Average TRB Length' to 8 for control endpoints

 common/usb.c                  |  45 +++++---
 common/usb_hub.c              |  16 ++-
 drivers/usb/host/usb-uclass.c |  19 +++-
 drivers/usb/host/xhci-mem.c   |  24 +++-
 drivers/usb/host/xhci.c       | 249 ++++++++++++++++++++++++++++++++++++++++--
 drivers/usb/host/xhci.h       |   5 +-
 include/linux/usb/ch9.h       |  20 ++++
 7 files changed, 336 insertions(+), 42 deletions(-)

Comments

Marek Vasut Sept. 18, 2017, 3:13 p.m. UTC | #1
On 09/18/2017 03:40 PM, Bin Meng wrote:
> 
> This adds the missing interrupt transfer support to xHCI driver, so
> that devices like USB keyboard that uses interrupt transfer when
> CONFIG_SYS_USB_EVENT_POLL is defined can work.
> 
> This also adds full speed device support. Unlike low/high/super speed
> devices, full speed device may report its endpoint 0 max packet size
> as 8/16/32/64. xHCI driver guesses 64 for the first attempt to get the
> initial 8 bytes device descriptor, and later adjusts the context for
> endpoint 0.
> 
> This series also made several updates to xHCI driver to conform with
> the spec.
> 
> This series is available at u-boot-x86/xhci-working for testing.
Looks good to me. Stefan, can you please give A-B/R-B on the series ?
I'd like to pick it for 2017.09 :)
Stefan Roese Sept. 18, 2017, 3:26 p.m. UTC | #2
On 18.09.2017 17:13, Marek Vasut wrote:
> On 09/18/2017 03:40 PM, Bin Meng wrote:
>>
>> This adds the missing interrupt transfer support to xHCI driver, so
>> that devices like USB keyboard that uses interrupt transfer when
>> CONFIG_SYS_USB_EVENT_POLL is defined can work.
>>
>> This also adds full speed device support. Unlike low/high/super speed
>> devices, full speed device may report its endpoint 0 max packet size
>> as 8/16/32/64. xHCI driver guesses 64 for the first attempt to get the
>> initial 8 bytes device descriptor, and later adjusts the context for
>> endpoint 0.
>>
>> This series also made several updates to xHCI driver to conform with
>> the spec.
>>
>> This series is available at u-boot-x86/xhci-working for testing.
> Looks good to me. Stefan, can you please give A-B/R-B on the series ?
> I'd like to pick it for 2017.09 :)

That would be 2017.11, right?

Sure, I'll review and test this series most likely tomorrow.

Thanks,
Stefan
Marek Vasut Sept. 18, 2017, 3:33 p.m. UTC | #3
On 09/18/2017 05:26 PM, Stefan Roese wrote:
> On 18.09.2017 17:13, Marek Vasut wrote:
>> On 09/18/2017 03:40 PM, Bin Meng wrote:
>>>
>>> This adds the missing interrupt transfer support to xHCI driver, so
>>> that devices like USB keyboard that uses interrupt transfer when
>>> CONFIG_SYS_USB_EVENT_POLL is defined can work.
>>>
>>> This also adds full speed device support. Unlike low/high/super speed
>>> devices, full speed device may report its endpoint 0 max packet size
>>> as 8/16/32/64. xHCI driver guesses 64 for the first attempt to get the
>>> initial 8 bytes device descriptor, and later adjusts the context for
>>> endpoint 0.
>>>
>>> This series also made several updates to xHCI driver to conform with
>>> the spec.
>>>
>>> This series is available at u-boot-x86/xhci-working for testing.
>> Looks good to me. Stefan, can you please give A-B/R-B on the series ?
>> I'd like to pick it for 2017.09 :)
> 
> That would be 2017.11, right?

Yes :)

> Sure, I'll review and test this series most likely tomorrow.

Thanks

> Thanks,
> Stefan
Stefan Roese Sept. 18, 2017, 3:38 p.m. UTC | #4
Hi Bin,

On 18.09.2017 17:26, Stefan Roese wrote:
> On 18.09.2017 17:13, Marek Vasut wrote:
>> On 09/18/2017 03:40 PM, Bin Meng wrote:
>>>
>>> This adds the missing interrupt transfer support to xHCI driver, so
>>> that devices like USB keyboard that uses interrupt transfer when
>>> CONFIG_SYS_USB_EVENT_POLL is defined can work.
>>>
>>> This also adds full speed device support. Unlike low/high/super speed
>>> devices, full speed device may report its endpoint 0 max packet size
>>> as 8/16/32/64. xHCI driver guesses 64 for the first attempt to get the
>>> initial 8 bytes device descriptor, and later adjusts the context for
>>> endpoint 0.
>>>
>>> This series also made several updates to xHCI driver to conform with
>>> the spec.
>>>
>>> This series is available at u-boot-x86/xhci-working for testing.
>> Looks good to me. Stefan, can you please give A-B/R-B on the series ?
>> I'd like to pick it for 2017.09 :)
> 
> That would be 2017.11, right?
> 
> Sure, I'll review and test this series most likely tomorrow.

I did a quick test and most really looks very good. Thanks for all
this great work on this xHCI stuff.

BUT, issuing a few commands, I was able to hang my board. This
sequence is reproducible on my board:


U-Boot 2017.09-00246-g28758a2992 (Sep 18 2017 - 17:29:52 +0200)

CPU: x86_64, vendor Intel, device 30679h
DRAM:  4 GiB
MMC:   pci_mmc: 0, pci_mmc: 1, pci_mmc: 2
SF: Detected w25q64cv with page size 256 Bytes, erase size 4 KiB, total 8 MiB
Model: theadorable-x86-DFI-BT700
Net:   No ethernet found.
scanning bus for devices...
Target spinup took 0 ms.
SATA link 1 timeout.
AHCI 0001.0300 32 slots 2 ports 3 Gbps 0x3 impl SATA mode
flags: 64bit ncq stag pm led clo pio slum part sxs 
  Device 0: (0:0) Vendor: ATA Prod.: SanDisk Ultra II Rev: X411
            Type: Hard Disk
            Capacity: 457862.8 MB = 447.1 GB (937703088 x 512)
960138 bytes read in 72 ms (12.7 MiB/s)
Video: 800x600x16
Hit any key to stop autoboot:  0 
=> 
=> 
=> usb reset
resetting USB...
USB0:   Register 7000820 NbrPorts 7
Starting the controller
USB XHCI 1.00
scanning bus 0 for devices... cannot reset port 1!?
7 USB Device(s) found
       scanning usb for storage devices... 2 Storage Device(s) found
=> usb tree
USB device tree:
  1  Hub (5 Gb/s, 0mA)
  |  U-Boot XHCI Host Controller 
  |
  +-2  Hub (480 Mb/s, 100mA)
  | |
  | +-5  Hub (12 Mb/s, 100mA)
  |    
  +-3  Hub (480 Mb/s, 2mA)
  | |
  | +-6  Mass Storage (480 Mb/s, 98mA)
  | |    USBest Technology USB Mass Storage Device 09092207fbf0c4
  | |  
  | +-7  Mass Storage (480 Mb/s, 500mA)
  |      General  USB Flash Disk   000000000000034B
  |    
  +-4  Vendor specific (5 Gb/s, 64mA)
       Realtek USB 10/100/1000 LAN 000002000000
     
=> ls usb 1
            System Volume Information/
 16779264   PRIME-B350-PLUS-ASUS-0613.CAP
 16779264   PRIME-B350-PLUS-ASUS-0805.CAP

3 file(s), 1 dir(s)

=> usb tree
USB device tree:
  1  Hub (5 Gb/s, 0mA)
  |  U-Boot XHCI Host Controller 
  |
  +-2  Hub (480 Mb/s, 100mA)
  | |
  | +-5  Hub (12 Mb/s, 100mA)
  |    
  +-3  Hub (480 Mb/s, 2mA)
  | |
  | +-6  Mass Storage (480 Mb/s, 98mA)
  | |    USBest Technology USB Mass Storage Device 09092207fbf0c4
  | |  
  | +-7  Mass Storage (480 Mb/s, 500mA)
  |   |  General  USB Flash Disk   000000000000034B
  |   |
  |   |General Protection
EIP: 0010:[<7b56f724>] EFLAGS: 00010246
Original EIP :[<fff1e724>]
EAX: 7b33ac18 EBX: 00000000 ECX: ffffffbf EDX: 7b33ac18
ESI: 7b33ad30 EDI: 00000006 EBP: 7b37b188 ESP: 7b33ac08
 DS: 0018 ES: 0018 FS: 0020 GS: 0018 SS: 0018
CR0: 00000033 CR2: 00000000 CR3: 00000000 CR4: 00000600
DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
DR6: ffff0ff0 DR7: 00000400
Stack:
    0x7b33ac48 : 0x7b37b160
    0x7b33ac44 : 0x00000000
    0x7b33ac40 : 0x00000000
    0x7b33ac3c : 0x00000000
    0x7b33ac38 : 0x00000000
    0x7b33ac34 : 0x20202020
    0x7b33ac30 : 0x52474d54
    0x7b33ac2c : 0x7b37baa8
    0x7b33ac28 : 0x7b37baa8
    0x7b33ac24 : 0x7b33ad30
    0x7b33ac20 : 0x7b5aa84e
    0x7b33ac1c : 0x7b55f008
    0x7b33ac18 : 0xffffffbf
    0x7b33ac14 : 0xcc0a06e4
    0x7b33ac10 : 0xc0e88a40
    0x7b33ac0c : 0x568ad686
--->0x7b33ac08 : 0x7b56f776
    0x7b33ac04 : 0x00010246
    0x7b33ac00 : 0x00000010
    0x7b33abfc : 0x7b56f724
### ERROR ### Please RESET the board ###


Are you able to reproduce this on your board(s) as well? Any ideas
on this? Please let me know if I can do any further tests.

Thanks,
Stefan
Bin Meng Sept. 19, 2017, 1:38 a.m. UTC | #5
Hi Stefan,

On Mon, Sep 18, 2017 at 11:38 PM, Stefan Roese <sr@denx.de> wrote:
> Hi Bin,
>
> On 18.09.2017 17:26, Stefan Roese wrote:
>> On 18.09.2017 17:13, Marek Vasut wrote:
>>> On 09/18/2017 03:40 PM, Bin Meng wrote:
>>>>
>>>> This adds the missing interrupt transfer support to xHCI driver, so
>>>> that devices like USB keyboard that uses interrupt transfer when
>>>> CONFIG_SYS_USB_EVENT_POLL is defined can work.
>>>>
>>>> This also adds full speed device support. Unlike low/high/super speed
>>>> devices, full speed device may report its endpoint 0 max packet size
>>>> as 8/16/32/64. xHCI driver guesses 64 for the first attempt to get the
>>>> initial 8 bytes device descriptor, and later adjusts the context for
>>>> endpoint 0.
>>>>
>>>> This series also made several updates to xHCI driver to conform with
>>>> the spec.
>>>>
>>>> This series is available at u-boot-x86/xhci-working for testing.
>>> Looks good to me. Stefan, can you please give A-B/R-B on the series ?
>>> I'd like to pick it for 2017.09 :)
>>
>> That would be 2017.11, right?
>>
>> Sure, I'll review and test this series most likely tomorrow.
>
> I did a quick test and most really looks very good. Thanks for all
> this great work on this xHCI stuff.
>
> BUT, issuing a few commands, I was able to hang my board. This
> sequence is reproducible on my board:
>
>
> U-Boot 2017.09-00246-g28758a2992 (Sep 18 2017 - 17:29:52 +0200)
>
> CPU: x86_64, vendor Intel, device 30679h
> DRAM:  4 GiB
> MMC:   pci_mmc: 0, pci_mmc: 1, pci_mmc: 2
> SF: Detected w25q64cv with page size 256 Bytes, erase size 4 KiB, total 8 MiB
> Model: theadorable-x86-DFI-BT700
> Net:   No ethernet found.
> scanning bus for devices...
> Target spinup took 0 ms.
> SATA link 1 timeout.
> AHCI 0001.0300 32 slots 2 ports 3 Gbps 0x3 impl SATA mode
> flags: 64bit ncq stag pm led clo pio slum part sxs
>   Device 0: (0:0) Vendor: ATA Prod.: SanDisk Ultra II Rev: X411
>             Type: Hard Disk
>             Capacity: 457862.8 MB = 447.1 GB (937703088 x 512)
> 960138 bytes read in 72 ms (12.7 MiB/s)
> Video: 800x600x16
> Hit any key to stop autoboot:  0
> =>
> =>
> => usb reset
> resetting USB...
> USB0:   Register 7000820 NbrPorts 7
> Starting the controller
> USB XHCI 1.00
> scanning bus 0 for devices... cannot reset port 1!?
> 7 USB Device(s) found
>        scanning usb for storage devices... 2 Storage Device(s) found
> => usb tree
> USB device tree:
>   1  Hub (5 Gb/s, 0mA)
>   |  U-Boot XHCI Host Controller
>   |
>   +-2  Hub (480 Mb/s, 100mA)
>   | |
>   | +-5  Hub (12 Mb/s, 100mA)
>   |
>   +-3  Hub (480 Mb/s, 2mA)
>   | |
>   | +-6  Mass Storage (480 Mb/s, 98mA)
>   | |    USBest Technology USB Mass Storage Device 09092207fbf0c4
>   | |
>   | +-7  Mass Storage (480 Mb/s, 500mA)
>   |      General  USB Flash Disk   000000000000034B
>   |
>   +-4  Vendor specific (5 Gb/s, 64mA)
>        Realtek USB 10/100/1000 LAN 000002000000
>
> => ls usb 1
>             System Volume Information/
>  16779264   PRIME-B350-PLUS-ASUS-0613.CAP
>  16779264   PRIME-B350-PLUS-ASUS-0805.CAP
>
> 3 file(s), 1 dir(s)
>
> => usb tree
> USB device tree:
>   1  Hub (5 Gb/s, 0mA)
>   |  U-Boot XHCI Host Controller
>   |
>   +-2  Hub (480 Mb/s, 100mA)
>   | |
>   | +-5  Hub (12 Mb/s, 100mA)
>   |
>   +-3  Hub (480 Mb/s, 2mA)
>   | |
>   | +-6  Mass Storage (480 Mb/s, 98mA)
>   | |    USBest Technology USB Mass Storage Device 09092207fbf0c4
>   | |
>   | +-7  Mass Storage (480 Mb/s, 500mA)
>   |   |  General  USB Flash Disk   000000000000034B
>   |   |
>   |   |General Protection
> EIP: 0010:[<7b56f724>] EFLAGS: 00010246
> Original EIP :[<fff1e724>]
> EAX: 7b33ac18 EBX: 00000000 ECX: ffffffbf EDX: 7b33ac18
> ESI: 7b33ad30 EDI: 00000006 EBP: 7b37b188 ESP: 7b33ac08
>  DS: 0018 ES: 0018 FS: 0020 GS: 0018 SS: 0018
> CR0: 00000033 CR2: 00000000 CR3: 00000000 CR4: 00000600
> DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
> DR6: ffff0ff0 DR7: 00000400
> Stack:
>     0x7b33ac48 : 0x7b37b160
>     0x7b33ac44 : 0x00000000
>     0x7b33ac40 : 0x00000000
>     0x7b33ac3c : 0x00000000
>     0x7b33ac38 : 0x00000000
>     0x7b33ac34 : 0x20202020
>     0x7b33ac30 : 0x52474d54
>     0x7b33ac2c : 0x7b37baa8
>     0x7b33ac28 : 0x7b37baa8
>     0x7b33ac24 : 0x7b33ad30
>     0x7b33ac20 : 0x7b5aa84e
>     0x7b33ac1c : 0x7b55f008
>     0x7b33ac18 : 0xffffffbf
>     0x7b33ac14 : 0xcc0a06e4
>     0x7b33ac10 : 0xc0e88a40
>     0x7b33ac0c : 0x568ad686
> --->0x7b33ac08 : 0x7b56f776
>     0x7b33ac04 : 0x00010246
>     0x7b33ac00 : 0x00000010
>     0x7b33abfc : 0x7b56f724
> ### ERROR ### Please RESET the board ###
>
>
> Are you able to reproduce this on your board(s) as well? Any ideas
> on this? Please let me know if I can do any further tests.

This is an known issue of 'usb info' and 'usb tree' command. See
previous patch on ML @ http://patchwork.ozlabs.org/patch/810732/.
However, that patch has serious issues and needs rework. I can rework
that patch and include it as part of v2 if you like.

Regards,
Bin
Stefan Roese Sept. 19, 2017, 4:54 a.m. UTC | #6
Hi Bin,

On 19.09.2017 03:38, Bin Meng wrote:
> On Mon, Sep 18, 2017 at 11:38 PM, Stefan Roese <sr@denx.de> wrote:
>> Hi Bin,
>>
>> On 18.09.2017 17:26, Stefan Roese wrote:
>>> On 18.09.2017 17:13, Marek Vasut wrote:
>>>> On 09/18/2017 03:40 PM, Bin Meng wrote:
>>>>>
>>>>> This adds the missing interrupt transfer support to xHCI driver, so
>>>>> that devices like USB keyboard that uses interrupt transfer when
>>>>> CONFIG_SYS_USB_EVENT_POLL is defined can work.
>>>>>
>>>>> This also adds full speed device support. Unlike low/high/super speed
>>>>> devices, full speed device may report its endpoint 0 max packet size
>>>>> as 8/16/32/64. xHCI driver guesses 64 for the first attempt to get the
>>>>> initial 8 bytes device descriptor, and later adjusts the context for
>>>>> endpoint 0.
>>>>>
>>>>> This series also made several updates to xHCI driver to conform with
>>>>> the spec.
>>>>>
>>>>> This series is available at u-boot-x86/xhci-working for testing.
>>>> Looks good to me. Stefan, can you please give A-B/R-B on the series ?
>>>> I'd like to pick it for 2017.09 :)
>>>
>>> That would be 2017.11, right?
>>>
>>> Sure, I'll review and test this series most likely tomorrow.
>>
>> I did a quick test and most really looks very good. Thanks for all
>> this great work on this xHCI stuff.
>>
>> BUT, issuing a few commands, I was able to hang my board. This
>> sequence is reproducible on my board:
>>
>>
>> U-Boot 2017.09-00246-g28758a2992 (Sep 18 2017 - 17:29:52 +0200)
>>
>> CPU: x86_64, vendor Intel, device 30679h
>> DRAM:  4 GiB
>> MMC:   pci_mmc: 0, pci_mmc: 1, pci_mmc: 2
>> SF: Detected w25q64cv with page size 256 Bytes, erase size 4 KiB, total 8 MiB
>> Model: theadorable-x86-DFI-BT700
>> Net:   No ethernet found.
>> scanning bus for devices...
>> Target spinup took 0 ms.
>> SATA link 1 timeout.
>> AHCI 0001.0300 32 slots 2 ports 3 Gbps 0x3 impl SATA mode
>> flags: 64bit ncq stag pm led clo pio slum part sxs
>>    Device 0: (0:0) Vendor: ATA Prod.: SanDisk Ultra II Rev: X411
>>              Type: Hard Disk
>>              Capacity: 457862.8 MB = 447.1 GB (937703088 x 512)
>> 960138 bytes read in 72 ms (12.7 MiB/s)
>> Video: 800x600x16
>> Hit any key to stop autoboot:  0
>> =>
>> =>
>> => usb reset
>> resetting USB...
>> USB0:   Register 7000820 NbrPorts 7
>> Starting the controller
>> USB XHCI 1.00
>> scanning bus 0 for devices... cannot reset port 1!?
>> 7 USB Device(s) found
>>         scanning usb for storage devices... 2 Storage Device(s) found
>> => usb tree
>> USB device tree:
>>    1  Hub (5 Gb/s, 0mA)
>>    |  U-Boot XHCI Host Controller
>>    |
>>    +-2  Hub (480 Mb/s, 100mA)
>>    | |
>>    | +-5  Hub (12 Mb/s, 100mA)
>>    |
>>    +-3  Hub (480 Mb/s, 2mA)
>>    | |
>>    | +-6  Mass Storage (480 Mb/s, 98mA)
>>    | |    USBest Technology USB Mass Storage Device 09092207fbf0c4
>>    | |
>>    | +-7  Mass Storage (480 Mb/s, 500mA)
>>    |      General  USB Flash Disk   000000000000034B
>>    |
>>    +-4  Vendor specific (5 Gb/s, 64mA)
>>         Realtek USB 10/100/1000 LAN 000002000000
>>
>> => ls usb 1
>>              System Volume Information/
>>   16779264   PRIME-B350-PLUS-ASUS-0613.CAP
>>   16779264   PRIME-B350-PLUS-ASUS-0805.CAP
>>
>> 3 file(s), 1 dir(s)
>>
>> => usb tree
>> USB device tree:
>>    1  Hub (5 Gb/s, 0mA)
>>    |  U-Boot XHCI Host Controller
>>    |
>>    +-2  Hub (480 Mb/s, 100mA)
>>    | |
>>    | +-5  Hub (12 Mb/s, 100mA)
>>    |
>>    +-3  Hub (480 Mb/s, 2mA)
>>    | |
>>    | +-6  Mass Storage (480 Mb/s, 98mA)
>>    | |    USBest Technology USB Mass Storage Device 09092207fbf0c4
>>    | |
>>    | +-7  Mass Storage (480 Mb/s, 500mA)
>>    |   |  General  USB Flash Disk   000000000000034B
>>    |   |
>>    |   |General Protection
>> EIP: 0010:[<7b56f724>] EFLAGS: 00010246
>> Original EIP :[<fff1e724>]
>> EAX: 7b33ac18 EBX: 00000000 ECX: ffffffbf EDX: 7b33ac18
>> ESI: 7b33ad30 EDI: 00000006 EBP: 7b37b188 ESP: 7b33ac08
>>   DS: 0018 ES: 0018 FS: 0020 GS: 0018 SS: 0018
>> CR0: 00000033 CR2: 00000000 CR3: 00000000 CR4: 00000600
>> DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
>> DR6: ffff0ff0 DR7: 00000400
>> Stack:
>>      0x7b33ac48 : 0x7b37b160
>>      0x7b33ac44 : 0x00000000
>>      0x7b33ac40 : 0x00000000
>>      0x7b33ac3c : 0x00000000
>>      0x7b33ac38 : 0x00000000
>>      0x7b33ac34 : 0x20202020
>>      0x7b33ac30 : 0x52474d54
>>      0x7b33ac2c : 0x7b37baa8
>>      0x7b33ac28 : 0x7b37baa8
>>      0x7b33ac24 : 0x7b33ad30
>>      0x7b33ac20 : 0x7b5aa84e
>>      0x7b33ac1c : 0x7b55f008
>>      0x7b33ac18 : 0xffffffbf
>>      0x7b33ac14 : 0xcc0a06e4
>>      0x7b33ac10 : 0xc0e88a40
>>      0x7b33ac0c : 0x568ad686
>> --->0x7b33ac08 : 0x7b56f776
>>      0x7b33ac04 : 0x00010246
>>      0x7b33ac00 : 0x00000010
>>      0x7b33abfc : 0x7b56f724
>> ### ERROR ### Please RESET the board ###
>>
>>
>> Are you able to reproduce this on your board(s) as well? Any ideas
>> on this? Please let me know if I can do any further tests.
> 
> This is an known issue of 'usb info' and 'usb tree' command. See
> previous patch on ML @ http://patchwork.ozlabs.org/patch/810732/.
> However, that patch has serious issues and needs rework. I can rework
> that patch and include it as part of v2 if you like.

Ah, thanks. I had noticed this patch but was not aware of the
severity here.

I've tested with the v2 and it seems to work just fine now.

Thanks,
Stefan
Bin Meng Sept. 19, 2017, 4:58 a.m. UTC | #7
Hi Stefan,

On Tue, Sep 19, 2017 at 12:54 PM, Stefan Roese <sr@denx.de> wrote:
> Hi Bin,
>
>
> On 19.09.2017 03:38, Bin Meng wrote:
>>
>> On Mon, Sep 18, 2017 at 11:38 PM, Stefan Roese <sr@denx.de> wrote:
>>>
>>> Hi Bin,
>>>
>>> On 18.09.2017 17:26, Stefan Roese wrote:
>>>>
>>>> On 18.09.2017 17:13, Marek Vasut wrote:
>>>>>
>>>>> On 09/18/2017 03:40 PM, Bin Meng wrote:
>>>>>>
>>>>>>
>>>>>> This adds the missing interrupt transfer support to xHCI driver, so
>>>>>> that devices like USB keyboard that uses interrupt transfer when
>>>>>> CONFIG_SYS_USB_EVENT_POLL is defined can work.
>>>>>>
>>>>>> This also adds full speed device support. Unlike low/high/super speed
>>>>>> devices, full speed device may report its endpoint 0 max packet size
>>>>>> as 8/16/32/64. xHCI driver guesses 64 for the first attempt to get the
>>>>>> initial 8 bytes device descriptor, and later adjusts the context for
>>>>>> endpoint 0.
>>>>>>
>>>>>> This series also made several updates to xHCI driver to conform with
>>>>>> the spec.
>>>>>>
>>>>>> This series is available at u-boot-x86/xhci-working for testing.
>>>>>
>>>>> Looks good to me. Stefan, can you please give A-B/R-B on the series ?
>>>>> I'd like to pick it for 2017.09 :)
>>>>
>>>>
>>>> That would be 2017.11, right?
>>>>
>>>> Sure, I'll review and test this series most likely tomorrow.
>>>
>>>
>>> I did a quick test and most really looks very good. Thanks for all
>>> this great work on this xHCI stuff.
>>>
>>> BUT, issuing a few commands, I was able to hang my board. This
>>> sequence is reproducible on my board:
>>>
>>>
>>> U-Boot 2017.09-00246-g28758a2992 (Sep 18 2017 - 17:29:52 +0200)
>>>
>>> CPU: x86_64, vendor Intel, device 30679h
>>> DRAM:  4 GiB
>>> MMC:   pci_mmc: 0, pci_mmc: 1, pci_mmc: 2
>>> SF: Detected w25q64cv with page size 256 Bytes, erase size 4 KiB, total 8
>>> MiB
>>> Model: theadorable-x86-DFI-BT700
>>> Net:   No ethernet found.
>>> scanning bus for devices...
>>> Target spinup took 0 ms.
>>> SATA link 1 timeout.
>>> AHCI 0001.0300 32 slots 2 ports 3 Gbps 0x3 impl SATA mode
>>> flags: 64bit ncq stag pm led clo pio slum part sxs
>>>    Device 0: (0:0) Vendor: ATA Prod.: SanDisk Ultra II Rev: X411
>>>              Type: Hard Disk
>>>              Capacity: 457862.8 MB = 447.1 GB (937703088 x 512)
>>> 960138 bytes read in 72 ms (12.7 MiB/s)
>>> Video: 800x600x16
>>> Hit any key to stop autoboot:  0
>>> =>
>>> =>
>>> => usb reset
>>> resetting USB...
>>> USB0:   Register 7000820 NbrPorts 7
>>> Starting the controller
>>> USB XHCI 1.00
>>> scanning bus 0 for devices... cannot reset port 1!?
>>> 7 USB Device(s) found
>>>         scanning usb for storage devices... 2 Storage Device(s) found
>>> => usb tree
>>> USB device tree:
>>>    1  Hub (5 Gb/s, 0mA)
>>>    |  U-Boot XHCI Host Controller
>>>    |
>>>    +-2  Hub (480 Mb/s, 100mA)
>>>    | |
>>>    | +-5  Hub (12 Mb/s, 100mA)
>>>    |
>>>    +-3  Hub (480 Mb/s, 2mA)
>>>    | |
>>>    | +-6  Mass Storage (480 Mb/s, 98mA)
>>>    | |    USBest Technology USB Mass Storage Device 09092207fbf0c4
>>>    | |
>>>    | +-7  Mass Storage (480 Mb/s, 500mA)
>>>    |      General  USB Flash Disk   000000000000034B
>>>    |
>>>    +-4  Vendor specific (5 Gb/s, 64mA)
>>>         Realtek USB 10/100/1000 LAN 000002000000
>>>
>>> => ls usb 1
>>>              System Volume Information/
>>>   16779264   PRIME-B350-PLUS-ASUS-0613.CAP
>>>   16779264   PRIME-B350-PLUS-ASUS-0805.CAP
>>>
>>> 3 file(s), 1 dir(s)
>>>
>>> => usb tree
>>> USB device tree:
>>>    1  Hub (5 Gb/s, 0mA)
>>>    |  U-Boot XHCI Host Controller
>>>    |
>>>    +-2  Hub (480 Mb/s, 100mA)
>>>    | |
>>>    | +-5  Hub (12 Mb/s, 100mA)
>>>    |
>>>    +-3  Hub (480 Mb/s, 2mA)
>>>    | |
>>>    | +-6  Mass Storage (480 Mb/s, 98mA)
>>>    | |    USBest Technology USB Mass Storage Device 09092207fbf0c4
>>>    | |
>>>    | +-7  Mass Storage (480 Mb/s, 500mA)
>>>    |   |  General  USB Flash Disk   000000000000034B
>>>    |   |
>>>    |   |General Protection
>>> EIP: 0010:[<7b56f724>] EFLAGS: 00010246
>>> Original EIP :[<fff1e724>]
>>> EAX: 7b33ac18 EBX: 00000000 ECX: ffffffbf EDX: 7b33ac18
>>> ESI: 7b33ad30 EDI: 00000006 EBP: 7b37b188 ESP: 7b33ac08
>>>   DS: 0018 ES: 0018 FS: 0020 GS: 0018 SS: 0018
>>> CR0: 00000033 CR2: 00000000 CR3: 00000000 CR4: 00000600
>>> DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
>>> DR6: ffff0ff0 DR7: 00000400
>>> Stack:
>>>      0x7b33ac48 : 0x7b37b160
>>>      0x7b33ac44 : 0x00000000
>>>      0x7b33ac40 : 0x00000000
>>>      0x7b33ac3c : 0x00000000
>>>      0x7b33ac38 : 0x00000000
>>>      0x7b33ac34 : 0x20202020
>>>      0x7b33ac30 : 0x52474d54
>>>      0x7b33ac2c : 0x7b37baa8
>>>      0x7b33ac28 : 0x7b37baa8
>>>      0x7b33ac24 : 0x7b33ad30
>>>      0x7b33ac20 : 0x7b5aa84e
>>>      0x7b33ac1c : 0x7b55f008
>>>      0x7b33ac18 : 0xffffffbf
>>>      0x7b33ac14 : 0xcc0a06e4
>>>      0x7b33ac10 : 0xc0e88a40
>>>      0x7b33ac0c : 0x568ad686
>>> --->0x7b33ac08 : 0x7b56f776
>>>      0x7b33ac04 : 0x00010246
>>>      0x7b33ac00 : 0x00000010
>>>      0x7b33abfc : 0x7b56f724
>>> ### ERROR ### Please RESET the board ###
>>>
>>>
>>> Are you able to reproduce this on your board(s) as well? Any ideas
>>> on this? Please let me know if I can do any further tests.
>>
>>
>> This is an known issue of 'usb info' and 'usb tree' command. See
>> previous patch on ML @ http://patchwork.ozlabs.org/patch/810732/.
>> However, that patch has serious issues and needs rework. I can rework
>> that patch and include it as part of v2 if you like.
>
>
> Ah, thanks. I had noticed this patch but was not aware of the
> severity here.
>
> I've tested with the v2 and it seems to work just fine now.

Yep, I posted some comments to that v2 patch.

For this xHCI series, I've moved the patch state back to "New".

Regards,
Bin