Skip to main content
Topic: [Solved] USB Speeds: Issues with Flash Drives Read and Write Performance (Read 983 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[Solved] USB Speeds: Issues with Flash Drives Read and Write Performance

I purchased a new Flash drive which can write @ 900MB/sec Read @ 1300MB/sec.
My old flash drive was 10-12mb/sec transfer, moving large files would take an hour.

I thought this newer drive would be the solution, it wasn't.
The speed was 4x faster 50mb/sec, but very far from the promised speeds.

Code: [Select]
[tsedek1]:~% sudo lsusb -v
.......
Bus 001 is an internal root_hub for Wifi and Graphics and is USB 2.0
.............
This root_hub is for the external USB ports.
....................
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Negotiated speed: SuperSpeed+ (10Gbps)

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Couldn't open device, some information will be missing
Negotiated speed: SuperSpeed+ (10Gbps)
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               3.10
  bDeviceClass            9 Hub
  bDeviceSubClass         0 [unknown]
  bDeviceProtocol         3
  bMaxPacketSize0         9
  idVendor           0x1d6b Linux Foundation
  idProduct          0x0003 3.0 root hub
  bcdDevice            6.15
  iManufacturer           3 Linux 6.15.6-artix1-1 xhci-hcd
  iProduct                2 xHCI Host Controller
  iSerial                 1 0000:03:00.3

Bus 001 Device 006: ID 0951:177f Kingston Technology DataTraveler Max
Negotiated speed: High Speed (480Mbps)
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.10

It looks like the External USB ports aren't being seen as USB 3.1, but USB 2.1.
Clearly the Kernel sees the USB Bus 2 and identifies it as USB 3.1.
I've checked my Bios to see if there were any settings in there that might affect this but there is nothing present that is user adjustable.

The specifications for my Computer state that 2 of the external ports are USB 3.0 ports.
But according to the connection information in 'lsusb' that doesn't appear to be the case.

Is there any way to get the external ports to be recognized as USB 3.0 so I can have access to the SuperSpeed+?

Code: [Select]
Bus 001 Device 006: ID 0951:177f Kingston Technology DataTraveler Max
Negotiated speed: High Speed (480Mbps)
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.10
  bDeviceClass            0 [unknown]
  bDeviceSubClass         0 [unknown]
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x0951 Kingston Technology
  idProduct          0x177f DataTraveler Max
  bcdDevice            1.00
  iManufacturer           1 Kingston
  iProduct                2 DataTraveler Max
  iSerial                 xxxxxxxxxxxxxxxxxxxxxx
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0020
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk-Only
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
Binary Object Store Descriptor:
  bLength                 5
  bDescriptorType        15
  wTotalLength       0x002a
  bNumDeviceCaps          3
  USB 2.0 Extension Device Capability:
    bLength                 7
    bDescriptorType        16
    bDevCapabilityType      2
    bmAttributes   0x00000006
      BESL Link Power Management (LPM) Supported
  SuperSpeed USB Device Capability:
    bLength                10
    bDescriptorType        16
    bDevCapabilityType      3
    bmAttributes         0x00
    wSpeedsSupported   0x000e
      Device can operate at Full Speed (12Mbps)
      Device can operate at High Speed (480Mbps)
      Device can operate at SuperSpeed (5Gbps)
    bFunctionalitySupport   2
      Lowest fully-functional device speed is High Speed (480Mbps)
    bU1DevExitLat          10 micro seconds
    bU2DevExitLat        2047 micro seconds
  SuperSpeedPlus USB Device Capability:
    bLength                20
    bDescriptorType        16
    bDevCapabilityType     10
    bmAttributes         0x00000001
      Sublink Speed Attribute count 2
      Sublink Speed ID count 1
    wFunctionalitySupport   0x1100
      Min functional Speed Attribute ID: 0
      Min functional RX lanes: 1
      Min functional TX lanes: 1
    bmSublinkSpeedAttr[0]   0x000a4030
      Speed Attribute ID: 0 10Gb/s Symmetric RX SuperSpeedPlus
    bmSublinkSpeedAttr[1]   0x000a40b0
      Speed Attribute ID: 0 10Gb/s Symmetric TX SuperSpeedPlus
Device Status:     0x0000
  (Bus Powered)

Re: USB Speeds: Issues with Flash Drives Read and Write Performance

Reply #1
Reading this article to see if I can discover what the USB is going on, while learning some commands to poke around.

Quote
Testing entry and wakeup from low-power states is crucial when developing a SuperSpeed USB device. However forcing a device into these states in a controlled manner can be somewhat tricky, as the operating system is designed to do so automatically, based upon a variety of parameters and system settings. On this page, the methods for testing low-power states on Linux are discussed, with the assumption that no driver has been loaded on behalf of the device under test.
https://xillybus.com/tutorials/usb-superspeed-lpm-control-testing-with-linux

Dmesg:

Code: [Select]
leheyot_zanot:[tsedek1]:~$ sudo dmesg | grep usb
[ 3282.182506] usb 1-3: new high-speed USB device number 5 using xhci_hcd
[ 3282.311825] usb 1-3: New USB device found, idVendor=0951, idProduct=177f, bcdDevice= 1.00
[ 3282.311842] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 3282.311849] usb 1-3: Product: DataTraveler Max
[ 3282.311855] usb 1-3: Manufacturer: Kingston
[ 3282.311861] usb 1-3: SerialNumber: xxxxxxxxxxxxxxxxxxxxxxx
[ 3282.344493] usb-storage 1-3:1.0: USB Mass Storage device detected
[ 3282.344784] scsi host0: usb-storage 1-3:1.0
[ 3282.344899] usbcore: registered new interface driver usb-storage
[ 3282.353245] usbcore: registered new interface driver uas

Code: [Select]
leheyot_zanot:[tsedek1]:/sys/bus/usb/devices$ for i in * ; do [ -e $i/idVendor ] && echo $(cat $i/{busnum,devnum,idVendor,idProduct}) ' ===> ' $i ; done
1 2 046d c077  ===>  1-2
1 5 0951 177f  ===>  1-3
1 3 174f 1176  ===>  1-5
1 4 0cf3 e300  ===>  1-6
1 1 1d6b 0002  ===>  usb1
2 1 1d6b 0003  ===>  usb2

Code: [Select]
leheyot_zanot:[tsedek1]:/sys/bus/usb/devices/usb2$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 046d:c077 Logitech, Inc. Mouse
Bus 001 Device 003: ID 174f:1176 Syntek Integrated Camera
Bus 001 Device 004: ID 0cf3:e300 Qualcomm Atheros Communications QCA61x4 Bluetooth 4.0
Bus 001 Device 005: ID 0951:177f Kingston Technology DataTraveler Max
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

Code: [Select]
leheyot_zanot:[tsedek1]:/sys/bus/usb/devices/usb2$ ls -al
total 0
drwxr-xr-x 5 root root     0 Jul 23 09:19 .
drwxr-xr-x 8 root root     0 Jul 23 09:19 ..
drwxr-xr-x 8 root root     0 Jul 23 09:19 2-0:1.0
-rw-r--r-- 1 root root  4096 Jul 23 10:31 authorized
-rw-r--r-- 1 root root  4096 Jul 23 10:31 authorized_default
-rw-r--r-- 1 root root  4096 Jul 23 10:31 avoid_reset_quirk
-r--r--r-- 1 root root  4096 Jul 23 09:19 bcdDevice
-rw-r--r-- 1 root root  4096 Jul 23 10:31 bConfigurationValue
-r--r--r-- 1 root root  4096 Jul 23 09:19 bDeviceClass
-r--r--r-- 1 root root  4096 Jul 23 09:19 bDeviceProtocol
-r--r--r-- 1 root root  4096 Jul 23 10:31 bDeviceSubClass
-r--r--r-- 1 root root  4096 Jul 23 10:31 bmAttributes
-r--r--r-- 1 root root  4096 Jul 23 10:31 bMaxPacketSize0
-r--r--r-- 1 root root  4096 Jul 23 10:31 bMaxPower
-r--r--r-- 1 root root  4096 Jul 23 10:31 bNumConfigurations
-r--r--r-- 1 root root  4096 Jul 23 10:31 bNumInterfaces
-r--r--r-- 1 root root 65535 Jul 23 10:31 bos_descriptors
-r--r--r-- 1 root root  4096 Jul 23 10:25 busnum
-r--r--r-- 1 root root  4096 Jul 23 10:31 configuration
-r--r--r-- 1 root root 65553 Jul 23 09:19 descriptors
-r--r--r-- 1 root root  4096 Jul 23 10:31 dev
-r--r--r-- 1 root root  4096 Jul 23 10:25 devnum
-r--r--r-- 1 root root  4096 Jul 23 10:31 devpath
lrwxrwxrwx 1 root root     0 Jul 23 10:31 driver -> ../../../../../bus/usb/drivers/usb
drwxr-xr-x 3 root root     0 Jul 23 10:31 ep_00
lrwxrwxrwx 1 root root     0 Jul 23 10:31 firmware_node -> ../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:07/device:0e/device:0f
-r--r--r-- 1 root root  4096 Jul 23 09:19 idProduct
-r--r--r-- 1 root root  4096 Jul 23 09:19 idVendor
-rw-r--r-- 1 root root  4096 Jul 23 10:31 interface_authorized_default
-r--r--r-- 1 root root  4096 Jul 23 10:31 ltm_capable
-r--r--r-- 1 root root  4096 Jul 23 09:19 manufacturer
-r--r--r-- 1 root root  4096 Jul 23 10:31 maxchild
drwxr-xr-x 2 root root     0 Jul 23 09:19 power
-r--r--r-- 1 root root  4096 Jul 23 09:19 product
-r--r--r-- 1 root root  4096 Jul 23 10:31 quirks
-r--r--r-- 1 root root  4096 Jul 23 10:31 removable
--w------- 1 root root  4096 Jul 23 10:31 remove
-r--r--r-- 1 root root  4096 Jul 23 10:31 rx_lanes
-r--r--r-- 1 root root  4096 Jul 23 09:19 serial
-r--r--r-- 1 root root  4096 Jul 23 10:31 speed
lrwxrwxrwx 1 root root     0 Jul 23 10:31 subsystem -> ../../../../../bus/usb
-r--r--r-- 1 root root  4096 Jul 23 10:31 tx_lanes
-rw-r--r-- 1 root root  4096 Jul 23 10:31 uevent
-r--r--r-- 1 root root  4096 Jul 23 10:31 urbnum
-r--r--r-- 1 root root  4096 Jul 23 10:31 version

Code: [Select]
leheyot_zanot:[tsedek1]:/sys/bus/usb/devices/usb2$ cat speed
10000

Quote
10000M indicates a 10 Gbps (USB 3.2 Gen 2) root hub
https://www.binarytides.com/check-usb-connection-speed-in-linux/

Code: [Select]
leheyot_zanot:[tsedek1]:/sys/bus/usb/devices/usb2$ lsusb -tvv
/:  Bus 001.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/6p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    /sys/bus/usb/devices/usb1  /dev/bus/usb/001/001
    |__ Port 002: Dev 002, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
        ID 046d:c077 Logitech, Inc. Mouse
        /sys/bus/usb/devices/1-2  /dev/bus/usb/001/002
    |__ Port 003: Dev 005, If 0, Class=Mass Storage, Driver=usb-storage, 480M
        ID 0951:177f Kingston Technology DataTraveler Max
        /sys/bus/usb/devices/1-3  /dev/bus/usb/001/005
    |__ Port 005: Dev 003, If 0, Class=Video, Driver=uvcvideo, 480M
        ID 174f:1176 Syntek
        /sys/bus/usb/devices/1-5  /dev/bus/usb/001/003
    |__ Port 005: Dev 003, If 1, Class=Video, Driver=uvcvideo, 480M
        ID 174f:1176 Syntek
        /sys/bus/usb/devices/1-5  /dev/bus/usb/001/003
    |__ Port 006: Dev 004, If 0, Class=Wireless, Driver=btusb, 12M
        ID 0cf3:e300 Qualcomm Atheros Communications QCA61x4 Bluetooth 4.0
        /sys/bus/usb/devices/1-6  /dev/bus/usb/001/004
    |__ Port 006: Dev 004, If 1, Class=Wireless, Driver=btusb, 12M
        ID 0cf3:e300 Qualcomm Atheros Communications QCA61x4 Bluetooth 4.0
        /sys/bus/usb/devices/1-6  /dev/bus/usb/001/004
/:  Bus 002.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/4p, 10000M
    ID 1d6b:0003 Linux Foundation 3.0 root hub
    /sys/bus/usb/devices/usb2  /dev/bus/usb/002/001

Code: [Select]
leheyot_zanot:[tsedek1]:/sys/bus/usb/devices/usb2$ sudo lspci -vv | grep -i usb -A 43
03:00.3 USB controller: Advanced Micro Devices, Inc. [AMD] Raven2 USB 3.1 (prog-if 30 [XHCI])
Subsystem: Lenovo Device 3803
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 32 bytes
Interrupt: pin D routed to IRQ 29
IOMMU group: 11
Region 0: Memory at d0400000 (64-bit, non-prefetchable) [size=1M]
Capabilities: [48] Vendor Specific Information: Len=08 <?>
Capabilities: [50] Power Management version 3
Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold+)
Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [64] Express (v2) Endpoint, IntMsgNum 0
DevCap: MaxPayload 256 bytes, PhantFunc 0, Latency L0s <4us, L1 unlimited
ExtTag+ AttnBtn- AttnInd- PwrInd- RBE+ FLReset- SlotPowerLimit 0W TEE-IO-
DevCtl: CorrErr- NonFatalErr- FatalErr- UnsupReq-
RlxdOrd+ ExtTag+ PhantFunc- AuxPwr- NoSnoop+
MaxPayload 128 bytes, MaxReadReq 512 bytes
DevSta: CorrErr- NonFatalErr- FatalErr- UnsupReq- AuxPwr- TransPend-
LnkCap: Port #0, Speed 8GT/s, Width x16, ASPM L0s L1, Exit Latency L0s <64ns, L1 <1us
ClockPM- Surprise- LLActRep- BwNot- ASPMOptComp+
LnkCtl: ASPM Disabled; RCB 64 bytes, LnkDisable- CommClk+
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt- FltModeDis-
LnkSta: Speed 8GT/s, Width x16
TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
DevCap2: Completion Timeout: Not Supported, TimeoutDis- NROPrPrP- LTR+
10BitTagComp- 10BitTagReq- OBFF Not Supported, ExtFmt+ EETLPPrefix+, MaxEETLPPrefixes 1
EmergencyPowerReduction Not Supported, EmergencyPowerReductionInit-
FRS- TPHComp- ExtTPHComp-
AtomicOpsCap: 32bit- 64bit- 128bitCAS-
DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-
AtomicOpsCtl: ReqEn-
IDOReq- IDOCompl- LTR- EmergencyPowerReductionReq-
10BitTagReq- OBFF Disabled, EETLPPrefixBlk-
LnkSta2: Current De-emphasis Level: -3.5dB, EqualizationComplete- EqualizationPhase1-
EqualizationPhase2- EqualizationPhase3- LinkEqualizationRequest-
Retimer- 2Retimers- CrosslinkRes: unsupported, FltMode-
Capabilities: [a0] MSI: Enable- Count=1/8 Maskable- 64bit+
Address: 0000000000000000  Data: 0000
Capabilities: [c0] MSI-X: Enable+ Count=8 Masked-
Vector table: BAR=0 offset=000fe000
PBA: BAR=0 offset=000ff000
Capabilities: [100 v1] Vendor Specific Information: ID=0001 Rev=1 Len=010 <?>
Kernel driver in use: xhci_hcd

Code: [Select]
leheyot_zanot:[tsedek1]:/sys/bus/usb/devices/usb2$ ls -la /sys/bus/usb/devices/usb*
lrwxrwxrwx 1 root root 0 Jul 23 10:13 /sys/bus/usb/devices/usb1 -> ../../../devices/pci0000:00/0000:00:08.1/0000:03:00.3/usb1
lrwxrwxrwx 1 root root 0 Jul 23 10:13 /sys/bus/usb/devices/usb2 -> ../../../devices/pci0000:00/0000:00:08.1/0000:03:00.3/usb2

Code: [Select]
leheyot_zanot:[tsedek1]:/sys/bus/usb/devices/usb2$ sudo lsusb -D /dev/bus/usb/001/005 | grep -i 'bcdusb\|vendor\|product\|protocol\|power'
[sudo] password for tsedek1:
  bcdUSB               2.10
  bDeviceProtocol         0
  idVendor           0x0951 Kingston Technology
  idProduct          0x177f DataTraveler Max
  iProduct                2 DataTraveler Max
      (Bus Powered)
    MaxPower              500mA
      bInterfaceProtocol     80 Bulk-Only
      BESL Link Power Management (LPM) Supported
  (Bus Powered)

Code: [Select]
leheyot_zanot:[tsedek1]:/sys/bus/usb/devices/usb2$ grep "" $(find /sys/bus/usb/devices/1-3/ -type f | grep -i 'version\|manufacturer\|product\|vendor\|speed\|maxpower')
/sys/bus/usb/devices/1-3/manufacturer:Kingston
/sys/bus/usb/devices/1-3/speed:480
/sys/bus/usb/devices/1-3/idProduct:177f
/sys/bus/usb/devices/1-3/product:DataTraveler Max
/sys/bus/usb/devices/1-3/1-3:1.0/host0/target0:0:0/0:0:0:0/vendor:Kingston
/sys/bus/usb/devices/1-3/bMaxPower:500mA
/sys/bus/usb/devices/1-3/idVendor:0951
/sys/bus/usb/devices/1-3/version: 2.10

Code: [Select]
leheyot_zanot:[tsedek1]:/sys/bus/usb/devices/usb2$ ls -D /dev/bus/usb/*/*
  crw-rw-r-- 1 root root 189,   0 Jul 23 09:19 /dev/bus/usb/001/001
  crw-rw-r-- 1 root root 189,   1 Jul 23 09:19 /dev/bus/usb/001/002
  crw-rw-r-- 1 root root 189,   2 Jul 23 09:19 /dev/bus/usb/001/003
  crw-rw-r-- 1 root root 189,   3 Jul 23 09:19 /dev/bus/usb/001/004
  crw-rw-r-- 1 root root 189,   4 Jul 23 10:50 /dev/bus/usb/001/005
  crw-rw-r-- 1 root root 189, 128 Jul 23 09:19 /dev/bus/usb/002/001
//DIRED// 47 67 115 135 183 203 251 271 319 339 387 407
//DIRED-OPTIONS// --quoting-style=shell-escape

What is causing the USB 3.2 gen 2 device to not be linked to the USB 3.1 host controller?
The only thing I can see is a symlink issue.
Is the symlink incorrectly configuring the adapter and assigning it to the wrong controller?

Re: USB Speeds: Issues with Flash Drives Read and Write Performance

Reply #2
I have no idea, but already MaxPower:500mA is USB2
USB3 has afaik 900 mA.

I would try it on a different PC or at least a different Distribution (Livesystem) - and of cause on different USB-Ports.

Re: USB Speeds: Issues with Flash Drives Read and Write Performance

Reply #3
Thank you for the identification of where to look.
Checking the MaxPower ratings of the different standards:
Quote
USB 1.0 and 2.0 have 4 pins and 4 wires, while USB 3.0 has 9 pins and 9 wires
www.etechnophiles.com/usb-port-power-output/

All I had to do was count the number of pins. They're all 4 pin USB.
I wish I had known this before I bought the laptop. I trusted the specs.