System: Haiku shredder 1 hrev57937+129 Dec 10 2024 21:49 x86_64 x86_64 Haiku
Hi everyone,
I ran into a very interesting USB 3 / xHCI issue with an external Crucial X9 SSD on my ThinkPad P53.
The device is:
Crucial X9 1TB
Micron CT1000X9SSD9
The laptop is a ThinkPad P53. It has one side USB-C port with USB 3.1 Gen 1 and two rear USB-C / Thunderbolt 3 ports with USB 3.1 Gen 2.
At first I had the SSD connected to the side USB-C port. Under Linux this negotiated as 5 Gbit/s, which made sense for that port.
Then I moved the same SSD, same cable, to one of the rear USB-C / Thunderbolt 3 ports.
Under Ubuntu Linux the device is detected correctly:
Mass Storage, Driver=uas, 10000M
Raw read test under Linux:
sudo sh -c 'echo 3 > /proc/sys/vm/drop_caches'
sudo dd if=/dev/sda of=/dev/null bs=64M count=32 status=progress
Result:
2147483648 bytes (2.1 GB, 2.0 GiB) copied, 2.07586 s, 1.0 GB/s
So the SSD, cable and rear USB-C / Thunderbolt port are clearly capable of USB 3.1 Gen 2 speed.
Under Haiku R1/beta5, on the same laptop, same SSD, same cable and same rear port, the SSD is detected and usable, but extremely slow.
Haiku syslog shows:
KERN: usb xhci -1: successfully started the controller
KERN: usb error xhci 1: ConfigureEndpoint() failed invalid max_burst_payload
KERN: usb error xhci 1: unable to configure endpoint: Invalid Argument
KERN: usb error xhci 1: ConfigureEndpoint() failed invalid max_burst_payload
KERN: usb error xhci 1: unable to configure endpoint: Invalid Argument
KERN: usb xhci -1: interface version: 0x0110
The device itself is detected as:
KERN: usb_disk: vendor_identification "Micron "
KERN: usb_disk: product_identification "CT1000X9SSD9 "
KERN: usb_disk: product_revision_level "1000"
I also checked with listdev. Haiku sees the xHCI controllers and the Crucial X9 appears as USB Attached SCSI mass storage.
Raw read test under Haiku, directly from the block device:
time dd if=/dev/disk/usb/1/0/raw of=/dev/null bs=1048576 count=2048
Result:
2048+0 records in
2048+0 records out
2147483648 bytes (2.1 GB, 2.0 GiB) copied, 68.5258 s, 31.3 MB/s
real 1m11.385s
I also tested both exFAT and BFS on the SSD. The file system does not seem to be the main issue:
Haiku exFAT read: about 43.6 MB/s
Haiku BFS read: about 43.9 MB/s
Haiku raw read: about 31.3 MB/s
So this does not look like an exFAT or BFS problem. The bottleneck seems to be below the file system layer.
For comparison:
Ubuntu Linux, same rear port, same SSD, same cable:
UAS, 10000M, raw read about 1.0 GB/s
Haiku Build, same rear port, same SSD, same cable:
xHCI detects the controller and the SSD, but raw read is only about 31 MB/s
The suspicious part seems to be:
ConfigureEndpoint() failed invalid max_burst_payload
unable to configure endpoint: Invalid Argument
I found a similar error in an older discussion about external USB SSD boot problems, although the effect there was different. In my case the SSD is detected and usable, but the speed is USB-2-like despite using a USB 3.1 Gen 2 capable port.
Is this a known xHCI / USB mass storage / UAS issue in Haiku?
Is there anything else I should test or collect for a useful bug report?
I can provide full listdev and syslog output if needed.
Greetz & Thanks
Juergen