[PATCH v1] usb: xhci: Check return value of wait for TRB_TRANSFER event

Minda Chen minda.chen at starfivetech.com
Wed Oct 18 03:22:24 CEST 2023



On 2023/10/17 19:20, Marek Vasut wrote:
> On 10/17/23 08:20, Minda Chen wrote:
>> xhci_wait_for_event() waiting TRB_TRANSFER event may return
>> NULL. Checking the return value to avoid crash.
>>
>> Signed-off-by: Minda Chen <minda.chen at starfivetech.com>
> 
> How did you trigger this error ? Is there a reproducer ? Details please ...

While Scanning a lenovo usb2.0 udisk, not 100 % reproduce

This is log.

StarFive # usb reset
resetting USB...
Bus xhci_pci: Register 5000420 NbrPorts 5
Starting the controller
USB XHCI 1.00
scanning bus xhci_pci for devices... WARN halted endpoint, queueing URB anyway.
Unexpected XHCI event TRB, skipping... (f77141f0 00000000 13000000 02008401)
Unhandled exception: Load access fault
EPC: 00000000f7f563c6 RA: 00000000f7f563c6 TVAL: 000000000000000c
EPC: 000000004024a3c6 RA: 000000004024a3c6 reloc adjusted

SP:  00000000f76f9a60 GP:  00000000f76fbdd0 TP:  0000000000000001
T0:  00000000f76fa168 T1:  00000000000000ff T2:  0000000000000016
S0:  00000000f7712fc0 S1:  00000000f76fb100 A0:  0000000000000000
A1:  0000000000000000 A2:  00000000f77145d0 A3:  00000000f7714590
A4:  0000000000000000 A5:  0000000000000020 A6:  000000000000000f
A7:  0000000000000100 S2:  0000000000000000 S3:  0000000000000000
S4:  00000000f7717050 S5:  00000000f7717050 S6:  0000000080000383
S7:  00000000f76f9dc0 S8:  00000000000000ff S9:  0000000000000001
S10: 00000000f76f9ba0 S11: 0000000000010c04 T3:  0000000000000010
T4:  0000000000000006 T5:  0000000000000080 T6:  00000000f76fa231

Code: 842a f0ef d75f 0593 0200 8522 f0ef ebdf (455c) 


This is USB info and storage info 

StarFive # 
1: Hub,  USB Revision 3.0
 - U-Boot XHCI Host Controller 
 - Class: Hub
 - PacketSize: 512  Configurations: 1
 - Vendor: 0x0000  Product 0x0000 Version 1.0
   Configuration: 1
   - Interfaces: 1 Self Powered 0mA
     Interface: 0
     - Alternate Setting 0, Endpoints: 1
     - Class Hub
     - Endpoint 1 In Interrupt MaxPacket 8 Interval 255ms

2: Hub,  USB Revision 2.10
 -  USB2.0 Hub 
 - Class: Hub
 - PacketSize: 64  Configurations: 1
 - Vendor: 0x2109  Product 0x3431 Version 4.32
   Configuration: 1
   - Interfaces: 1 Self Powered Remote Wakeup 100mA
     Interface: 0
     - Alternate Setting 0, Endpoints: 1
     - Class Hub
     - Endpoint 1 In Interrupt MaxPacket 1 Interval 12ms

3: Mass Storage,  USB Revision 2.0
 - Generic Mass Storage 31097778XB15113405
 - Class: (from Interface) Mass Storage
 - PacketSize: 64  Configurations: 1
 - Vendor: 0x17ef  Product 0x38ac Version 1.0
   Configuration: 1
   - Interfaces: 1 Bus Powered 200mA
     Interface: 0
     - Alternate Setting 0, Endpoints: 2
     - Class Mass Storage, Transp. SCSI, Bulk only
     - Endpoint 1 Out Bulk MaxPacket 512
     - Endpoint 2 In Bulk MaxPacket 512

StarFive # usb storage
  Device 0: Vendor:          Rev: 8.07 Prod: Lenovo SX1 64G  
            Type: Removable Hard Disk
            Capacity: 60000.0 MB = 58.5 GB (122880000 x 512)
StarFive # 


More information about the U-Boot mailing list