Skip to content

USB 2.0 devices are not detected by xhci ports. #2

Description

@hetii

Hello dear.
At the beginning, I would like to thank you very much for your efforts in writing the xhci driver.

For some time now, I've been playing with a Synology DS1515+ NAS

My adventures with this NAS are described in the thread:
https://www.elektroda.pl/rtvforum/topic4047099.html

This device has four usb 3.0 ports on the back.

Currently, I have tested the Bjorn driver from the repository https://github.com/bjornfor/grub
and yours based on the xhci-module-upstreaming-squash_v4 branch.

On Bjorn's driver, the xhci port sees usb 2.0 flash drives, and a usb keyboard, but for the keyboard I get a message
“setup_transfer: should NOT be called (this may happen when a HUB is attached to the USB3.0 controller)”,
but at least the usb command returns my keyboard to the list of available devices.
Of course, usb3.0 flash drives are not supported here.

In your driver I have support for flash drives 3.0,
but it seems that none of the usb 2.0 devices connected to my xhci ports are detected.
usb command does not display them in its list.

An additional problem I've noticed is that devices plugged into usb3.0 ports must be reconnected after loading the xhci driver in order to be detected.
I think the driver should automatically enumerate the devices after its loading.

Therefore, I basically have three questions.

  1. Are usb 2.0 devices currently supported in your current driver version?
  2. Is branch xhci-module-upstreaming-squash_v4 the final version of your driver code?
  3. Do you have any ideas what I can change to address the above problems?

In all cases I use your driver on top of grub-2.12: hetii#1

Some logs from grub:

grub> set debug=xhci
grub> insmod xhci
bus/usb/xhci-pci.c:54: XHCI grub_xhci_pci_iter: begin
bus/usb/xhci-pci.c:54: XHCI grub_xhci_pci_iter: begin
...
bus/usb/xhci-pci.c:54: XHCI grub_xhci_pci_iter: begin
bus/usb/xhci-pci.c:74: XHCI grub_xhci_pci_iter: class OK
bus/usb/xhci-pci.c:85: XHCI grub_xhci_pci_iter: bus rev. num. OK
bus/usb/xhci-pci.c:116: XHCI grub_xhci_pci_iter: 32-bit XHCI OK
bus/usb/xhci-pci.c:119: XHCI grub_xhci_pci_iter: iobase of XHCC: 80000000
bus/usb/xhci-pci.c:185: inithw: XHCI grub_xhci_pci_iter: ownership OK
bus/usb/xhci.c:1218: XHCI init: CAPLENGTH: 0x20
bus/usb/xhci.c:1220: XHCI init: HCIVERSION: 0x0100
bus/usb/xhci.c:1222: XHCI init: HCSPARAMS1: 0x08000450
bus/usb/xhci.c:1224: XHCI init: HCSPARAMS2: 0x2c0000f9
bus/usb/xhci.c:1226: XHCI init: HCSPARAMS3: 0x07ff0003
bus/usb/xhci.c:1228: XHCI init: HCCPARAMS: 0x07ff0003
bus/usb/xhci.c:1230: XHCI init: DBOFF: 0x00003000
bus/usb/xhci.c:1232: XHCI init: RTOFF: 0x00002000
bus/usb/xhci.c:1241: XHCI init: 8 ports, 80 slots, 64 byte contexts
bus/usb/xhci.c:1272: XHCI init: protocol USB  2.00, 4 ports (offset 1), def 0,
psic 0
bus/usb/xhci.c:1272: XHCI init: protocol USB  3.00, 4 ports (offset 5), def 0,
psic 0
bus/usb/xhci.c:1326: XHCI init: Minimum supported page size 0x1000
bus/usb/xhci.c:1338: XHCI init: device memory 0x761ed000 (761ed000)
bus/usb/xhci.c:1349: XHCI init: event ring table memory 0x761eea40 (761eea40)
bus/usb/xhci.c:1360: XHCI init: command ring memory 0x75ef0000 (75ef0000)
bus/usb/xhci.c:1371: XHCI init: event ring memory 0x75ed0000 (75ed0000)
bus/usb/xhci.c:1381: XHCI init: set up 5 scratch pad buffers
bus/usb/xhci.c:1404: XHCI init: Allocated 5 scratch buffers of size 0x1000
bus/usb/xhci.c:1042: grub_xhci_reset: resetting HC
bus/usb/xhci.c:550: xhci_check_status: xHCI halted
bus/usb/xhci.c:1091: XHCI OP COMMAND: 00000000
bus/usb/xhci.c:1093: XHCI OP STATUS: 00000011
bus/usb/xhci.c:1095: XHCI OP PAGESIZE: 00000001
bus/usb/xhci.c:1097: XHCI OP DNCTRL: 00000000
bus/usb/xhci.c:1099: XHCI OP CRCR_LOW: 00000000
bus/usb/xhci.c:1101: XHCI OP CRCR_HIGH: 00000000
bus/usb/xhci.c:1103: XHCI OP DCBAAP_LOW: 761ed000
bus/usb/xhci.c:1105: XHCI OP DCBAAP_HIGH: 00000000
bus/usb/xhci.c:1107: XHCI OP CONFIG: 00000050
bus/usb/xhci.c:1109: XHCI IR ERSTSZ: 00000001
bus/usb/xhci.c:1111: XHCI IR ERDP: 75ed0000
bus/usb/xhci.c:1113: XHCI IR ERSTBA: 761eea40
bus/usb/xhci.c:550: xhci_check_status: xHCI halted
bus/usb/xhci.c:2172: root hub ports=8
bus/usb/xhci.c:2260: grub_xhci_detect_dev: dev=0x760fbde0 USB105_116 port 0
bus/usb/xhci.c:2279: grub_xhci_portstatus port #0: 0x000002a0, powered, pls 5
bus/usb/xhci.c:2260: grub_xhci_detect_dev: dev=0x760fbde0 USB2_0 port 1
bus/usb/xhci.c:2279: grub_xhci_portstatus port #1: 0x000202e1, powered, pls 7
bus/usb/xhci.c:2260: grub_xhci_detect_dev: dev=0x760fbde0 USB2_0 port 2
bus/usb/xhci.c:2279: grub_xhci_portstatus port #2: 0x000002a0, powered, pls 5
bus/usb/xhci.c:2260: grub_xhci_detect_dev: dev=0x760fbde0 USB2_0 port 3
bus/usb/xhci.c:2279: grub_xhci_portstatus port #3: 0x000002a0, powered, pls 5
bus/usb/xhci.c:2260: grub_xhci_detect_dev: dev=0x760fbde0 USB2_0 port 4
bus/usb/xhci.c:2279: grub_xhci_portstatus port #4: 0x000002a0, powered, pls 5
bus/usb/xhci.c:2260: grub_xhci_detect_dev: dev=0x760fbde0 USB3_0 port 5
bus/usb/xhci.c:2279: grub_xhci_portstatus port #5: 0x000002a0, powered, pls 5
bus/usb/xhci.c:2260: grub_xhci_detect_dev: dev=0x760fbde0 USB3_0 port 6
bus/usb/xhci.c:2279: grub_xhci_portstatus port #6: 0x000002a0, powered, pls 5
bus/usb/xhci.c:2260: grub_xhci_detect_dev: dev=0x760fbde0 USB3_0 port 7
bus/usb/xhci.c:2279: grub_xhci_portstatus port #7: 0x000002a0, powered, pls 5
grub> bus/usb/xhci.c:2260: grub_xhci_detect_dev: dev=0x760fbde0 USB0_0 port 0
bus/usb/xhci.c:2279: grub_xhci_portstatus port #0: 0x000002a0, powered, pls 5
bus/usb/xhci.c:2260: grub_xhci_detect_dev: dev=0x760fbde0 USB2_0 port 1
bus/usb/xhci.c:2279: grub_xhci_portstatus port #1: 0x000002e1, powered, pls 7
bus/usb/xhci.c:2260: grub_xhci_detect_dev: dev=0x760fbde0 USB2_0 port 2
bus/usb/xhci.c:2279: grub_xhci_portstatus port #2: 0x000002a0, powered, pls 5
bus/usb/xhci.c:2260: grub_xhci_detect_dev: dev=0x760fbde0 USB2_0 port 3
bus/usb/xhci.c:2279: grub_xhci_portstatus port #3: 0x000002a0, powered, pls 5
bus/usb/xhci.c:2260: grub_xhci_detect_dev: dev=0x760fbde0 USB2_0 port 4

lspci:

grub> insmod xhci
grub> lspci
00:00.0 8086:1f0c [0600] Host Bridge
00:01.0 8086:1f10 [0604] PCI-PCI Bridge
00:02.0 8086:1f11 [0604] PCI-PCI Bridge
00:03.0 8086:1f12 [0604] PCI-PCI Bridge
00:04.0 8086:1f13 [0604] PCI-PCI Bridge
00:0e.0 8086:1f14 [0600] Host Bridge
00:0f.0 8086:1f16 [0806] System hardware
00:13.0 8086:1f15 [0880] System hardware
00:14.0 8086:1f41 [0200] Ethernet Controller
00:14.1 8086:1f41 [0200] Ethernet Controller
00:14.2 8086:1f41 [0200] Ethernet Controller
00:14.3 8086:1f41 [0200] Ethernet Controller
00:16.0 8086:1f2c [0c03] USB Controller [PI 20]
00:17.0 8086:1f22 [0106] SATA Controller [PI 01]
00:18.0 8086:1f32 [0106] SATA Controller [PI 01]
00:1f.0 8086:1f38 [0601] ISA Bridge
00:1f.3 8086:1f3c [0c05] Serial Bus Controller
02:00.0 1095:3132 [0106] SATA Controller
04:00.0 1b6f:7052 [0c03] USB Controller [PI 30]
grub> 

Usb list devices: (keyboard and flash driver 3.0 connected into xhci ports:

grub> usb
USB devices:

Class: (0x09) Hub, Subclass: 0x00, Protocol: 0x01
USB version 2.0, VendorID: 0x8087, ProductID: 0x7db, #conf: 1
High speed device
Interface #0: #Endpoints: 1   Class: (0x09) Hub, Subclass: 0x00, Protocol:
0x00
Endpoint #1: IN, max packed size: 1, transfer type: Interrupt, latency: 12

Product: `DiskStation     '
Vendor: `Synology'
Serial: `40001685F7000043'
Class: (0x00) Unknown, Subclass: 0x00, Protocol: 0x00
USB version 2.0, VendorID: 0xf400, ProductID: 0xf400, #conf: 1
High speed device
Interface #0: #Endpoints: 3   Class: (0x08) Mass Storage, Subclass: 0x06,
Protocol: 0x50
Endpoint #1: IN, max packed size: 512, transfer type: Bulk, latency: 0
Endpoint #2: OUT, max packed size: 512, transfer type: Bulk, latency: 0
Endpoint #3: IN, max packed size: 2, transfer type: Interrupt, latency: 1

Product: `Ultra Fit'
Vendor: `SanDisk'
Serial: `4C531001521126120561'
Class: (0x00) Unknown, Subclass: 0x00, Protocol: 0x00
USB version 3.0, VendorID: 0x781, ProductID: 0x5583, #conf: 1
Control speed device
Interface #0: #Endpoints: 2   Class: (0x08) Mass Storage, Subclass: 0x06,
Protocol: 0x50
Endpoint #1: IN, max packed size: 1024, transfer type: Bulk, latency: 0
Endpoint #2: OUT, max packed size: 1024, transfer type: Bulk, latency: 0

lsmod:

grub> lsmod
Name    Ref Count       Dependencies
usbtest 1               usb
xhci    1               usb
lspci   1               extcmd
usbms   0               usb,scsi
scsi    1               
minicmd 1               
lvm     1               diskfilter
ext2    1               fshelp
btrfs   1               gzio,raid6rec,lzopio,zstd
raid6rec        2               diskfilter
diskfilter      5               
zstd    2               
loopback        1               extcmd
part_gpt        1               
ehci    1               boot,usb,cs5536
usb     7               
cs5536  2               
fat     0               fshelp
hfs     0               fshelp
hfsplus 0               fshelp
iso9660 1               fshelp
jfs     0               
minix   0               
minix2  0               
minix2_be       0               
minix3  0               
minix3_be       0               
minix_be        0               
newc    0               archelp
nilfs2  0               fshelp
ntfs    0               fshelp
odc     0               archelp
procfs  0               archelp
reiserfs        0               fshelp
romfs   0               fshelp
sfs     0               fshelp
squash4 0               gzio,xzio,lzopio,fshelp
xzio    1               crypto
lzopio  3               crypto
udf     0               fshelp
ufs1    0               
ufs1_be 0               
ufs2    0               
xfs     0               fshelp
fshelp  15              
zfs     0               gzio
configfile      1               normal
part_msdos      1               
serial  1               terminfo,extcmd
terminfo        2               extcmd
normal  3               gettext,boot,extcmd,datetime,bufio,verifiers,crypto,ter
minal,net
gzio    4               gcry_crc
gcry_crc        5               crypto
gettext 4               
extcmd  13              
verifiers       4               
crypto  16              
terminal        4               
net     4               boot,datetime,bufio,priority_queue
boot    11              
datetime        9               
bufio   9               
priority_queue  5               
tar     1               archelp
archelp 5               
memdisk 1

@PatrickRudolph I did additional tests where I force in grub_xhci_detect_dev function return specific speed at the end of the function for port=1 (where I plug my devices)

For GRUB_USB_SPEED_FULL list of random devices:

Mouse:
Product: `Gaming Mouse'
Vendor: `LXD'
Class: (0x00) Unknown, Subclass: 0x00, Protocol: 0x00
USB version 1.1, VendorID: 0x1d57, ProductID: 0xad03, #conf: 1
Full speed device
Interface #0: #Endpoints: 1   Class: (0x03) HID, Subclass: 0x01, Protocol:
0x01
Endpoint #1: IN, max packed size: 8, transfer type: Interrupt, latency: 1
Interface #1: #Endpoints: 0   Class: (0x00) Unknown, Subclass: 0x00, Protocol:
0x00

Some usb dongle:
Product: `BCM2046B1'
Vendor: `Broadcom'
Class: (0x09) Hub, Subclass: 0x00, Protocol: 0x00
USB version 2.0, VendorID: 0xa5c, ProductID: 0x4500, #conf: 1
Full speed device
Interface #0: #Endpoints: 1   Class: (0x09) Hub, Subclass: 0x00, Protocol:
0x00
Endpoint #1: IN, max packed size: 1, transfer type: Interrupt, latency: 255

Soundcard:
Product: `USB Audio Device'
Vendor: `GeneralPlus'
Class: (0x00) Unknown, Subclass: 0x00, Protocol: 0x00
USB version 1.1, VendorID: 0x1b3f, ProductID: 0x2007, #conf: 1
Full speed device
Interface #0: #Endpoints: 0   Class: (0x01) Audio, Subclass: 0x01, Protocol:
0x00
Interface #1: #Endpoints: 0   Class: (0x00) Unknown, Subclass: 0x00, Protocol:
0x00
Interface #2: #Endpoints: 0   Class: (0x00) Unknown, Subclass: 0x00, Protocol:
0x00
Interface #3: #Endpoints: 0   Class: (0x00) Unknown, Subclass: 0x00, Protocol:
0x00

For GRUB_USB_SPEED_HIGH another sets of devices:

Product: `DataTraveler 2.0'
Vendor: `Kingston'
Serial: `0014780D8CF1BA80C5440153'
Class: (0x00) Unknown, Subclass: 0x00, Protocol: 0x00
USB version 2.0, VendorID: 0x951, ProductID: 0x1607, #conf: 1
High speed device
Interface #0: #Endpoints: 2   Class: (0x08) Mass Storage, Subclass: 0x06,
Protocol: 0x50
Endpoint #1: IN, max packed size: 512, transfer type: Bulk, latency: 0
Endpoint #2: OUT, max packed size: 512, transfer type: Bulk, latency: 0

grub> ls
(usb0) (usb0,msdos1) (usb1) (proc) (memdisk)


DVB-T2 tuner Mygica:
grub> usb
Error 7 retrieving Product
Error 7 retrieving Vendor
Error 7 retrieving Serial
Class: (0x00) Unknown, Subclass: 0x00, Protocol: 0x00
USB version 2.0, VendorID: 0x572, ProductID: 0x689a, #conf: 1
High speed device
Error 7 retrieving Configuration:
Interface #0: #Endpoints: 4   Class: (0xff) Unknown, Subclass: 0x01, Protocol:
0x01
Endpoint #1: IN, max packed size: 512, transfer type: Bulk, latency: 0
Endpoint #1: OUT, max packed size: 512, transfer type: Bulk, latency: 0
Endpoint #2: IN, max packed size: 512, transfer type: Bulk, latency: 0
Endpoint #6: IN, max packed size: 512, transfer type: Bulk, latency: 0


My sandisk flash drive over usb2.0 wire:
grub> ls
(usb0) (usb0,msdos1) (usb3) (usb3,gpt1) (proc) (memdisk) 

Product: `Ultra Fit'
Vendor: `SanDisk'
Serial: `4C531001521126120561'
Class: (0x00) Unknown, Subclass: 0x00, Protocol: 0x00
USB version 2.1, VendorID: 0x781, ProductID: 0x5583, #conf: 1
High speed device
Interface #0: #Endpoints: 2   Class: (0x08) Mass Storage, Subclass: 0x06,
Protocol: 0x50
Endpoint #1: IN, max packed size: 512, transfer type: Bulk, latency: 0
Endpoint #2: OUT, max packed size: 512, transfer type: Bulk, latency: 0

And now for GRUB_USB_SPEED_LOW:

Product: `USB Keyboard'
Vendor: `Logitech'
Class: (0x00) Unknown, Subclass: 0x00, Protocol: 0x00
USB version 1.1, VendorID: 0x46d, ProductID: 0xc31c, #conf: 1
Low speed device
Configuration:: `U64.00_B0001'
Interface #0: #Endpoints: 1   Class: (0x03) HID, Subclass: 0x01, Protocol:
0x01
Interface: `USB Keyboard'
Endpoint #1: IN, max packed size: 8, transfer type: Interrupt, latency: 10
Interface #1: #Endpoints: 0   Class: (0x00) Unknown, Subclass: 0x00, Protocol:
0x00

In above you can notice some Unknown, Subclass error

More detailed log:

grub> insmod xhci
grub> set debug=xhci
grub> bus/usb/xhci.c:2187: grub_xhci_portstatus port #1: 0x000002e1, powered,
pls 7 enable 1
bus/usb/xhci.c:2205: portstatus: XHCI STATUS: 00000010
bus/usb/xhci.c:2207: portstatus: begin, iobase=0x80000000, port=1,
status=0x000002e1
bus/usb/xhci.c:2335: grub_xhci_attach_dev: dev=0x761e8300
bus/usb/xhci.c:1584: grub_xhci_prepare_endpoint: epid 1
bus/usb/xhci.c:615: grub_xhci_alloc_inctx: speed=1 root_port=1
bus/usb/xhci.c:1629: grub_xhci_prepare_endpoint: ring 0x75eb0000, epid 1, max
8
bus/usb/xhci.c:919: xhci_cmd_enable_slot:
bus/usb/xhci.c:810: xhci_trb_queue: ring 0x75ef0000 data 0 len 0 flags 0x2400
remain 0x0
bus/usb/xhci.c:831: xhci_trb_queue: ring 0x75ef0000 [nidx 1, len 0]
bus/usb/xhci.c:722: xhci_doorbell: slotid 0, epid 0
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:679: xhci_process_events: ring 0x75ef0000 [trb 0x75ef0000, evt
0x75ef0800, type 33, eidx 1, cc 1]
bus/usb/xhci.c:909: xhci_cmd_submit: xhci_event_wait = 1
bus/usb/xhci.c:923: xhci_cmd_enable_slot: 0x75ef080c
bus/usb/xhci.c:924: xhci_cmd_enable_slot: 1008401
bus/usb/xhci.c:1641: grub_xhci_prepare_endpoint: get slot 1 assigned
bus/usb/xhci.c:1657: grub_xhci_prepare_endpoint: enable slot: got slotid 1
bus/usb/xhci.c:990: xhci_cmd_address_device: slotid 1
bus/usb/xhci.c:810: xhci_trb_queue: ring 0x75ef0000 data 761e7000 len 0 flags
0x1002c00 remain 0x0
bus/usb/xhci.c:831: xhci_trb_queue: ring 0x75ef0000 [nidx 2, len 0]
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:722: xhci_doorbell: slotid 0, epid 0
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:679: xhci_process_events: ring 0x75ef0000 [trb 0x75ef0010, evt
0x75ef0800, type 33, eidx 2, cc 1]
bus/usb/xhci.c:909: xhci_cmd_submit: xhci_event_wait = 1
bus/usb/xhci.c:1704: grub_xhci_prepare_endpoint: done
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:1584: grub_xhci_prepare_endpoint: epid 1
bus/usb/xhci.c:1919: grub_xhci_setup_transfer: CONTROLL TRANS req 6
bus/usb/xhci.c:1920: grub_xhci_setup_transfer: CONTROLL TRANS length 8
bus/usb/xhci.c:1938: grub_xhci_setup_transfer: SETUP PKG
bus/usb/xhci.c:1939: grub_xhci_setup_transfer: transfer->size 8
bus/usb/xhci.c:1940: grub_xhci_setup_transfer: tr->size 8 SETUP PKG
bus/usb/xhci.c:810: xhci_trb_queue: ring 0x75eb0000 data 8000001000680 len 8
flags 0x30840 remain 0x0
bus/usb/xhci.c:831: xhci_trb_queue: ring 0x75eb0000 [nidx 1, len 8]
bus/usb/xhci.c:1962: grub_xhci_setup_transfer: IN PKG
bus/usb/xhci.c:810: xhci_trb_queue: ring 0x75eb0000 data 761e8000 len 8 flags
0x10c00 remain 0x0
bus/usb/xhci.c:831: xhci_trb_queue: ring 0x75eb0000 [nidx 2, len 8]
bus/usb/xhci.c:1956: grub_xhci_setup_transfer: OUT PKG
bus/usb/xhci.c:810: xhci_trb_queue: ring 0x75eb0000 data 0 len 0 flags 0x1020
remain 0x0
bus/usb/xhci.c:831: xhci_trb_queue: ring 0x75eb0000 [nidx 3, len 0]
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:722: xhci_doorbell: slotid 1, epid 1
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:679: xhci_process_events: ring 0x75eb0000 [trb 0x75eb0020, evt
0x75eb0800, type 32, eidx 3, cc 1]
bus/usb/xhci.c:2080: grub_xhci_check_transfer: xfer done
bus/usb/xhci.c:1721: grub_xhci_usb_to_grub_err: xfer done   (cc 1)
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:1584: grub_xhci_prepare_endpoint: epid 1
bus/usb/xhci.c:1523: grub_xhci_update_max_paket_size: updating max packet size
to 0x8
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:615: grub_xhci_alloc_inctx: speed=1 root_port=1
bus/usb/xhci.c:1012: xhci_cmd_evaluate_context: slotid 1
bus/usb/xhci.c:810: xhci_trb_queue: ring 0x75ef0000 data 7611d000 len 0 flags
0x1003400 remain 0x0
bus/usb/xhci.c:831: xhci_trb_queue: ring 0x75ef0000 [nidx 3, len 0]
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:722: xhci_doorbell: slotid 0, epid 0
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:679: xhci_process_events: ring 0x75ef0000 [trb 0x75ef0020, evt
0x75ef0800, type 33, eidx 3, cc 1]
bus/usb/xhci.c:909: xhci_cmd_submit: xhci_event_wait = 1
bus/usb/xhci.c:1919: grub_xhci_setup_transfer: CONTROLL TRANS req 6
bus/usb/xhci.c:1920: grub_xhci_setup_transfer: CONTROLL TRANS length 18
bus/usb/xhci.c:1938: grub_xhci_setup_transfer: SETUP PKG
bus/usb/xhci.c:1939: grub_xhci_setup_transfer: transfer->size 18
bus/usb/xhci.c:1940: grub_xhci_setup_transfer: tr->size 8 SETUP PKG
bus/usb/xhci.c:810: xhci_trb_queue: ring 0x75eb0000 data 12000001000680 len 8
flags 0x30840 remain 0x0
bus/usb/xhci.c:831: xhci_trb_queue: ring 0x75eb0000 [nidx 4, len 8]
bus/usb/xhci.c:1962: grub_xhci_setup_transfer: IN PKG
bus/usb/xhci.c:810: xhci_trb_queue: ring 0x75eb0000 data 761e8000 len 8 flags
0x10c10 remain 0x0
bus/usb/xhci.c:831: xhci_trb_queue: ring 0x75eb0000 [nidx 5, len 8]
bus/usb/xhci.c:1962: grub_xhci_setup_transfer: IN PKG
bus/usb/xhci.c:810: xhci_trb_queue: ring 0x75eb0000 data 761e8008 len 8 flags
0x10410 remain 0x0
bus/usb/xhci.c:831: xhci_trb_queue: ring 0x75eb0000 [nidx 6, len 8]
bus/usb/xhci.c:1962: grub_xhci_setup_transfer: IN PKG
bus/usb/xhci.c:810: xhci_trb_queue: ring 0x75eb0000 data 761e8010 len 2 flags
0x10400 remain 0x0
bus/usb/xhci.c:831: xhci_trb_queue: ring 0x75eb0000 [nidx 7, len 2]
bus/usb/xhci.c:1956: grub_xhci_setup_transfer: OUT PKG
bus/usb/xhci.c:810: xhci_trb_queue: ring 0x75eb0000 data 0 len 0 flags 0x1020
remain 0x0
bus/usb/xhci.c:831: xhci_trb_queue: ring 0x75eb0000 [nidx 8, len 0]
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:722: xhci_doorbell: slotid 1, epid 1
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:679: xhci_process_events: ring 0x75eb0000 [trb 0x75eb0070, evt
0x75eb0800, type 32, eidx 8, cc 1]
bus/usb/xhci.c:2080: grub_xhci_check_transfer: xfer done
bus/usb/xhci.c:1721: grub_xhci_usb_to_grub_err: xfer done   (cc 1)
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:1584: grub_xhci_prepare_endpoint: epid 1
bus/usb/xhci.c:1919: grub_xhci_setup_transfer: CONTROLL TRANS req 6
bus/usb/xhci.c:1920: grub_xhci_setup_transfer: CONTROLL TRANS length 4
bus/usb/xhci.c:1938: grub_xhci_setup_transfer: SETUP PKG
bus/usb/xhci.c:1939: grub_xhci_setup_transfer: transfer->size 4
bus/usb/xhci.c:1940: grub_xhci_setup_transfer: tr->size 8 SETUP PKG
bus/usb/xhci.c:810: xhci_trb_queue: ring 0x75eb0000 data 4000002000680 len 8
flags 0x30840 remain 0x0
bus/usb/xhci.c:831: xhci_trb_queue: ring 0x75eb0000 [nidx 9, len 8]
bus/usb/xhci.c:1962: grub_xhci_setup_transfer: IN PKG
bus/usb/xhci.c:810: xhci_trb_queue: ring 0x75eb0000 data 761e8000 len 4 flags
0x10c00 remain 0x0
bus/usb/xhci.c:831: xhci_trb_queue: ring 0x75eb0000 [nidx 10, len 4]
bus/usb/xhci.c:1956: grub_xhci_setup_transfer: OUT PKG
bus/usb/xhci.c:810: xhci_trb_queue: ring 0x75eb0000 data 0 len 0 flags 0x1020
remain 0x0
bus/usb/xhci.c:831: xhci_trb_queue: ring 0x75eb0000 [nidx 11, len 0]
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:722: xhci_doorbell: slotid 1, epid 1
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:679: xhci_process_events: ring 0x75eb0000 [trb 0x75eb00a0, evt
0x75eb0800, type 32, eidx 11, cc 1]
bus/usb/xhci.c:2080: grub_xhci_check_transfer: xfer done
bus/usb/xhci.c:1721: grub_xhci_usb_to_grub_err: xfer done   (cc 1)
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:1584: grub_xhci_prepare_endpoint: epid 1
bus/usb/xhci.c:1919: grub_xhci_setup_transfer: CONTROLL TRANS req 6
bus/usb/xhci.c:1920: grub_xhci_setup_transfer: CONTROLL TRANS length 59
bus/usb/xhci.c:1938: grub_xhci_setup_transfer: SETUP PKG
bus/usb/xhci.c:1939: grub_xhci_setup_transfer: transfer->size 59
bus/usb/xhci.c:1940: grub_xhci_setup_transfer: tr->size 8 SETUP PKG
bus/usb/xhci.c:810: xhci_trb_queue: ring 0x75eb0000 data 3b000002000680 len 8
flags 0x30840 remain 0x0
bus/usb/xhci.c:831: xhci_trb_queue: ring 0x75eb0000 [nidx 12, len 8]
bus/usb/xhci.c:1962: grub_xhci_setup_transfer: IN PKG
bus/usb/xhci.c:810: xhci_trb_queue: ring 0x75eb0000 data 761e7f80 len 8 flags
0x10c10 remain 0x0
bus/usb/xhci.c:831: xhci_trb_queue: ring 0x75eb0000 [nidx 13, len 8]
bus/usb/xhci.c:1962: grub_xhci_setup_transfer: IN PKG
bus/usb/xhci.c:810: xhci_trb_queue: ring 0x75eb0000 data 761e7f88 len 8 flags
0x10410 remain 0x0
bus/usb/xhci.c:831: xhci_trb_queue: ring 0x75eb0000 [nidx 14, len 8]
bus/usb/xhci.c:1962: grub_xhci_setup_transfer: IN PKG
bus/usb/xhci.c:810: xhci_trb_queue: ring 0x75eb0000 data 761e7f90 len 8 flags
0x10410 remain 0x0
bus/usb/xhci.c:831: xhci_trb_queue: ring 0x75eb0000 [nidx 15, len 8]
bus/usb/xhci.c:1962: grub_xhci_setup_transfer: IN PKG
bus/usb/xhci.c:810: xhci_trb_queue: ring 0x75eb0000 data 761e7f98 len 8 flags
0x10410 remain 0x0
bus/usb/xhci.c:831: xhci_trb_queue: ring 0x75eb0000 [nidx 16, len 8]
bus/usb/xhci.c:1962: grub_xhci_setup_transfer: IN PKG
bus/usb/xhci.c:810: xhci_trb_queue: ring 0x75eb0000 data 761e7fa0 len 8 flags
0x10410 remain 0x0
bus/usb/xhci.c:831: xhci_trb_queue: ring 0x75eb0000 [nidx 17, len 8]
bus/usb/xhci.c:1962: grub_xhci_setup_transfer: IN PKG
bus/usb/xhci.c:810: xhci_trb_queue: ring 0x75eb0000 data 761e7fa8 len 8 flags
0x10410 remain 0x0
bus/usb/xhci.c:831: xhci_trb_queue: ring 0x75eb0000 [nidx 18, len 8]
bus/usb/xhci.c:1962: grub_xhci_setup_transfer: IN PKG
bus/usb/xhci.c:810: xhci_trb_queue: ring 0x75eb0000 data 761e7fb0 len 8 flags
0x10410 remain 0x0
bus/usb/xhci.c:831: xhci_trb_queue: ring 0x75eb0000 [nidx 19, len 8]
bus/usb/xhci.c:1962: grub_xhci_setup_transfer: IN PKG
bus/usb/xhci.c:810: xhci_trb_queue: ring 0x75eb0000 data 761e7fb8 len 3 flags
0x10400 remain 0x0
bus/usb/xhci.c:831: xhci_trb_queue: ring 0x75eb0000 [nidx 20, len 3]
bus/usb/xhci.c:1956: grub_xhci_setup_transfer: OUT PKG
bus/usb/xhci.c:810: xhci_trb_queue: ring 0x75eb0000 data 0 len 0 flags 0x1020
remain 0x0
bus/usb/xhci.c:831: xhci_trb_queue: ring 0x75eb0000 [nidx 21, len 0]
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:722: xhci_doorbell: slotid 1, epid 1
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:679: xhci_process_events: ring 0x75eb0000 [trb 0x75eb0140, evt
0x75eb0800, type 32, eidx 21, cc 1]
bus/usb/xhci.c:2080: grub_xhci_check_transfer: xfer done
bus/usb/xhci.c:1721: grub_xhci_usb_to_grub_err: xfer done   (cc 1)
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:1584: grub_xhci_prepare_endpoint: epid 1
bus/usb/xhci.c:1919: grub_xhci_setup_transfer: CONTROLL TRANS req 5
bus/usb/xhci.c:1920: grub_xhci_setup_transfer: CONTROLL TRANS length 0
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:2080: grub_xhci_check_transfer: xfer done
bus/usb/xhci.c:1721: grub_xhci_usb_to_grub_err: xfer done   (cc 1)
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:1584: grub_xhci_prepare_endpoint: epid 1
bus/usb/xhci.c:1919: grub_xhci_setup_transfer: CONTROLL TRANS req 9
bus/usb/xhci.c:1920: grub_xhci_setup_transfer: CONTROLL TRANS length 0
bus/usb/xhci.c:1938: grub_xhci_setup_transfer: SETUP PKG
bus/usb/xhci.c:1939: grub_xhci_setup_transfer: transfer->size 0
bus/usb/xhci.c:1940: grub_xhci_setup_transfer: tr->size 8 SETUP PKG
bus/usb/xhci.c:810: xhci_trb_queue: ring 0x75eb0000 data 10900 len 8 flags
0x840 remain 0x0
bus/usb/xhci.c:831: xhci_trb_queue: ring 0x75eb0000 [nidx 22, len 8]
bus/usb/xhci.c:1962: grub_xhci_setup_transfer: IN PKG
bus/usb/xhci.c:810: xhci_trb_queue: ring 0x75eb0000 data 0 len 0 flags 0x11020
remain 0x0
bus/usb/xhci.c:831: xhci_trb_queue: ring 0x75eb0000 [nidx 23, len 0]
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:722: xhci_doorbell: slotid 1, epid 1
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:679: xhci_process_events: ring 0x75eb0000 [trb 0x75eb0160, evt
0x75eb0800, type 32, eidx 23, cc 1]
bus/usb/xhci.c:2080: grub_xhci_check_transfer: xfer done
bus/usb/xhci.c:1721: grub_xhci_usb_to_grub_err: xfer done   (cc 1)
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:1584: grub_xhci_prepare_endpoint: epid 1
bus/usb/xhci.c:1919: grub_xhci_setup_transfer: CONTROLL TRANS req 11
bus/usb/xhci.c:1920: grub_xhci_setup_transfer: CONTROLL TRANS length 0
bus/usb/xhci.c:1938: grub_xhci_setup_transfer: SETUP PKG
bus/usb/xhci.c:1939: grub_xhci_setup_transfer: transfer->size 0
bus/usb/xhci.c:1940: grub_xhci_setup_transfer: tr->size 8 SETUP PKG
bus/usb/xhci.c:810: xhci_trb_queue: ring 0x75eb0000 data b21 len 8 flags 0x840
remain 0x0
bus/usb/xhci.c:831: xhci_trb_queue: ring 0x75eb0000 [nidx 24, len 8]
bus/usb/xhci.c:1962: grub_xhci_setup_transfer: IN PKG
bus/usb/xhci.c:810: xhci_trb_queue: ring 0x75eb0000 data 0 len 0 flags 0x11020
remain 0x0
bus/usb/xhci.c:831: xhci_trb_queue: ring 0x75eb0000 [nidx 25, len 0]
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:722: xhci_doorbell: slotid 1, epid 1
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:679: xhci_process_events: ring 0x75eb0000 [trb 0x75eb0180, evt
0x75eb0800, type 32, eidx 25, cc 1]
bus/usb/xhci.c:2080: grub_xhci_check_transfer: xfer done
bus/usb/xhci.c:1721: grub_xhci_usb_to_grub_err: xfer done   (cc 1)
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:1584: grub_xhci_prepare_endpoint: epid 1
bus/usb/xhci.c:1919: grub_xhci_setup_transfer: CONTROLL TRANS req 10
bus/usb/xhci.c:1920: grub_xhci_setup_transfer: CONTROLL TRANS length 0
bus/usb/xhci.c:1938: grub_xhci_setup_transfer: SETUP PKG
bus/usb/xhci.c:1939: grub_xhci_setup_transfer: transfer->size 0
bus/usb/xhci.c:1940: grub_xhci_setup_transfer: tr->size 8 SETUP PKG
bus/usb/xhci.c:810: xhci_trb_queue: ring 0x75eb0000 data a21 len 8 flags 0x840
remain 0x0
bus/usb/xhci.c:831: xhci_trb_queue: ring 0x75eb0000 [nidx 26, len 8]
bus/usb/xhci.c:1962: grub_xhci_setup_transfer: IN PKG
bus/usb/xhci.c:810: xhci_trb_queue: ring 0x75eb0000 data 0 len 0 flags 0x11020
remain 0x0
bus/usb/xhci.c:831: xhci_trb_queue: ring 0x75eb0000 [nidx 27, len 0]
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:722: xhci_doorbell: slotid 1, epid 1
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:679: xhci_process_events: ring 0x75eb0000 [trb 0x75eb01a0, evt
0x75eb0800, type 32, eidx 27, cc 1]
bus/usb/xhci.c:2080: grub_xhci_check_transfer: xfer done
bus/usb/xhci.c:1721: grub_xhci_usb_to_grub_err: xfer done   (cc 1)
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:1584: grub_xhci_prepare_endpoint: epid 3
bus/usb/xhci.c:615: grub_xhci_alloc_inctx: speed=1 root_port=1
bus/usb/xhci.c:1629: grub_xhci_prepare_endpoint: ring 0x75f40000, epid 3, max
8
bus/usb/xhci.c:1001: xhci_cmd_configure_endpoint: slotid 1
bus/usb/xhci.c:810: xhci_trb_queue: ring 0x75ef0000 data 761e1000 len 0 flags
0x1003000 remain 0x0
bus/usb/xhci.c:831: xhci_trb_queue: ring 0x75ef0000 [nidx 4, len 0]
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:722: xhci_doorbell: slotid 0, epid 0
bus/usb/xhci.c:557: xhci_check_status: Command ring running
bus/usb/xhci.c:679: xhci_process_events: ring 0x75ef0000 [trb 0x75ef0030, evt
0x75ef0800, type 33, eidx 4, cc 17]
bus/usb/xhci.c:909: xhci_cmd_submit: xhci_event_wait = 17
bus/usb/xhci.c:1694: grub_xhci_prepare_endpoint: configure endpoint: failed (cc
17)
bus/usb/xhci.c:2309: grub_xhci_detect_dev: Xhetii grub_usb_speed = 1
...
bus/usb/xhci.c:2309: grub_xhci_detect_dev: Xhetii grub_usb_speed = 1

In summary, by forcing the return of a certain speed in the function grub_xhci_detect_dev I am able to detect my devices like flash drive or others, but for example for the keyboard it looks like not all endpoints are configured correctly.

I also don't understand why in the grub_xhci_detect_dev function we have port-1 and id >0.
eg: for (grub_uint8_t i = 0; i < 16 && x->psids[port-1].psids[i].id > 0; i++) as it seams, at least in my case the port variable can be equal to 0 for first usb socket on my board.

Best regards.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions