USB3 Writing Speed problem on LS1046ARDB

cancel
Showing results for 
Search instead for 
Did you mean: 

USB3 Writing Speed problem on LS1046ARDB

696 Views
marco3181
Contributor III

Hello,

I have a LS1046 RDB card with the Linux from the SDK 2.0 1703.

When I test the USB3 writing speed with a dd on a raw device, the speed is way lower than the speed I can achieve on a x86_64 PC. On a PC, I have a speed of 130MB/s and on the 1046a the speed is only 40MB/s.

With a real lsusb, the result is:

lsusb -t

/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
|__ Port 1: Dev 3, If 0, Class=Mass Storage, Driver=usb-storage, 5000M

lsusb -v

Bus 002 Device 003: ID 0951:1696 Kingston Technology
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 3.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 9
idVendor 0x0951 Kingston Technology
idProduct 0x1696
bcdDevice 1.10
iManufacturer 1 Kingston
iProduct 2 DTHX Predator
iSerial 3 20CF30E118F8EE20520E0F7F
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 44
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 224mA
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 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0400 1x 1024 bytes
bInterval 0
bMaxBurst 14
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0400 1x 1024 bytes
bInterval 0
bMaxBurst 14
Binary Object Store Descriptor:
bLength 5
bDescriptorType 15
wTotalLength 22
bNumDeviceCaps 2
USB 2.0 Extension Device Capability:
bLength 7
bDescriptorType 16
bDevCapabilityType 2
bmAttributes 0x00000002
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
Device Status: 0x0000
(Bus Powered)

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 3.00
bDeviceClass 9 Hub
bDeviceSubClass 0 Unused
bDeviceProtocol 3
bMaxPacketSize0 9
idVendor 0x1d6b Linux Foundation
idProduct 0x0003 3.0 root hub
bcdDevice 4.01
iManufacturer 3 Linux 4.1.35-rt41 xhci-hcd
iProduct 2 xHCI Host Controller
iSerial 1 xhci-hcd.0.auto
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 31
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xe0
Self Powered
Remote Wakeup
MaxPower 0mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 9 Hub
bInterfaceSubClass 0 Unused
bInterfaceProtocol 0 Full speed (or root) hub
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0004 1x 4 bytes
bInterval 12
bMaxBurst 0
Hub Descriptor:
bLength 12
bDescriptorType 42
nNbrPorts 1
wHubCharacteristic 0x0009
Per-port power switching
Per-port overcurrent protection
bPwrOn2PwrGood 10 * 2 milli seconds
bHubContrCurrent 0 milli Ampere
bHubDecLat 0.0 micro seconds
wHubDelay 0 nano seconds
DeviceRemovable 0x00
Hub Port Status:
Port 1: 0000.0203 5Gbps power U0 enable connect
Binary Object Store Descriptor:
bLength 5
bDescriptorType 15
wTotalLength 15
bNumDeviceCaps 1
SuperSpeed USB Device Capability:
bLength 10
bDescriptorType 16
bDevCapabilityType 3
bmAttributes 0x02
Latency Tolerance Messages (LTM) Supported
wSpeedsSupported 0x0008
Device can operate at SuperSpeed (5Gbps)
bFunctionalitySupport 3
Lowest fully-functional device speed is SuperSpeed (5Gbps)
bU1DevExitLat 0 micro seconds
bU2DevExitLat 0 micro seconds
Device Status: 0x0001
Self Powered

And there is an other problem. When I plug an USB key, the port shuts down (5VCC LED turns off) and only a lsusb -v can turn it back on. Doesn't know where to look for.

Is anyone has an idea where to look for these problems?

Thank you

Marc

Labels (1)
0 Kudos
3 Replies

182 Views
Pavel
NXP TechSupport
NXP TechSupport

Do you know what types of file format do you use? We found out the Ext4 can give you a better performance. As far as improving the USB performance, you can change the values of USB_GSBUSCFG0 and USB_GSBUSCFG1 registers. It may help you on your board. What type of performance tools did you use? We use FIO. We got more than 300 MB/s on LS1043, which uses the same controller and PHY. 


Have a great day,
Pavel Chubakov

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

182 Views
tomasc
Contributor I

We actually see same thing, however on ls1043a. The question is how to change these registers, in which files or with which tools?

USB_GSBUSCFG0 and USB_GSBUSCFG1 registers?

I've seen that you got 300MB/s that's with usb bursting enabled on the device under test or without usb bursting, is usb bursting at all working on ls1043a?

0 Kudos

182 Views
marco3181
Contributor III

Hello,

I use no file format to test. I test the raw speed. I use dd to test USB key, like this:

time dd if=/dev/zero of=/dev/sdb oflag=direct conv=fdatasync bs=64k count=100

With a bs=64k, the speed is 200MB/s. With a bs=1M, it drops down to 26MB/s.

The same tests on a PC are always around 200MB/s. Don't know what is the difference here.

With Linux, it seems that LS1046A and LS1043A are not configured the same way. The dts for the two platform on the usb part is not equal and one configuration is useless for a 4.1 kernel:

- usb 1043a

usb0: usb3@2f00000 {
compatible = "snps,dwc3";
reg = <0x0 0x2f00000 0x0 0x10000>;
interrupts = <0 60 0x4>;
dr_mode = "host";
configure-gfladj;
snps,dis_rxdet_inp3_quirk;
};

- usb 1046a

usb0: usb@2f00000 {
compatible = "snps,dwc3";
reg = <0x0 0x2f00000 0x0 0x10000>;
interrupts = <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;
dr_mode = "host";
snps,quirk-frame-length-adjustment = <0x20>;
};

As I said earlier, quirk-frame-length-adjustment is useless in the 4.1 driver dwc3. Only configure-gfladj is used to restrict the frame length to 0x20.

I will try to look for more informations.

Thank you

Marc

0 Kudos