Re: USB 3.2 Gen 2x2 "Superspeed+20GBps" support for ASM3242
From: youling 257 <hidden>
Date: 2021-12-31 08:42:47
2021-12-31 15:02 GMT+08:00, Thinh Nguyen [off-list ref]:
youling 257 wrote:quoted
2021-12-31 11:46 GMT+08:00, Thinh Nguyen [off-list ref]:quoted
Hi, youling 257 wrote:quoted
test this patch, cat /sys/bus/usb/devices/4-1/speed, 10000 [ 74.694284] usb 4-1: new SuperSpeed Plus Gen 2x1 USB device number 2 using xhci_hcd [ 74.750329] usb-storage 4-1:1.0: USB Mass Storage device detected but speed, pcie to usb3.2 gen2x2, WRITE: bw=642MiB/s (673MB/s), 642MiB/s-642MiB/s (673MB/s-673MB/s), io=1000MiB (1049MB), run=1557-1557msec READ: bw=467MiB/s (490MB/s), 467MiB/s-467MiB/s (490MB/s-490MB/s), io=1000MiB (1049MB), run=2140-2140msec the mainboard usb3.2 gen2x1, WRITE: bw=838MiB/s (878MB/s), 838MiB/s-838MiB/s (878MB/s-878MB/s), io=1000MiB (1049MB), run=1194-1194msec READ: bw=753MiB/s (790MB/s), 753MiB/s-753MiB/s (790MB/s-790MB/s), io=1000MiB (1049MB), run=1328-1328msecLet's avoid top-post. Some comments: 1) Just because the host is capable of gen2x2, it doesn't mean it will run at gen2x2 speed. Your device can only operate up to gen2x1 speed, so that's the limit. The test speed for gen2x1 above is not unreasonable.quoted
my device can only operate up to gen2x1 10gbps speed on window, only 5gbps on linux kernel 5.16rc7.With the change I provided, you were able to run test at gen2x1, albeit slower than expect. (i.e. write speed at 673MB/s for ASmedia host must be SSP). The issue with device unable to operate at SSP is at least answered. If you're looking to find out why the performance is slow, confirm these items first: 1) Are you using the same application to test on Linux to compare with Windows? (Looks like you're using CrystalDiskMark for your Windows test) 2) If you're using the same application, are you using the same test parameters and version? 3) Is your device operating in BOT or UASP in Linux? UAS Protocol is
my kernel config #CONFIG_USB_UAS is not set.
generally faster. Newer device generally uses UASP, and I assume yours is a newer device (check your enclosure). Make sure there's no quirk preventing the device operating in UASP.
CONFIG_USB_UAS=y
[ 524.630081] usb 4-1: new SuperSpeed Plus Gen 2x1 USB device number
5 using xhci_hcd
[ 524.747496] scsi host9: uas
[ 524.757580] scsi 9:0:0:0: Direct-Access Realtek USB 3.2 Device
1.00 PQ: 0 ANSI: 6
Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 20000M/x2
|__ Port 1: Dev 2, If 0, Class=Mass Storage, Driver=uas, 10000M
windows fat32 speed, https://imgur.com/a/eq9qhKj
linux ext4 speed, https://imgur.com/a/tUAskgV
If all of those are checked out, you can start capturing logs so others may look into it. BR, Thinh (btw, I'll be on vacation for a week, maybe others can help while I'm away.)