Getting UAS working on HK 4.9

Test and fix the Kernel 4.14 features

Moderators: odroid, mdrjr

Re: Getting UAS working on HK 4.9

Unread postby tkaiser » Fri Feb 02, 2018 8:45 pm

tpoechtrager wrote:The UGREEN one uses a VIA chip... that's not my output, it's a quote.

Code: Select all
Bus 004 Device 004: ID 2109:0715 VIA Labs, Inc.


You posted dmesg output showing that you use one of the shitty Norelsys chipsets (see above in your own post). You have been asked to provide lsusb output but you don't. This contributes to this stupid mess with so many people confused about the state of USB3 storage support with single board computers (not just XU4 affected)

With your UGREEN thingie using a crappy Norelsys chipset everything as expected: broken with UAS enabled kernels prior to most recent 4.14. No problems with older 3.x kernels that don't have UAS capabilities.
tkaiser
 
Posts: 354
Joined: Mon Nov 09, 2015 12:30 am
languages_spoken: english
ODROIDs: C1+, C2, XU4, HC1

Re: Getting UAS working on HK 4.9

Unread postby tpoechtrager » Fri Feb 02, 2018 9:11 pm

Seriously? I think you should learn to read -it's A QUOTE. The UGREEN one uses a VIA chipset. I also have one with a JMicron chipset - exact the same phenomena.

search.php?author_id=27403&sr=posts

JFYI: I tested 4.9.x and 4.14.x on my PC. Not a single problem. It's the board that's causing the problems, but believe what you want to believe. Having 130 posts and being unable to read properly doesn't grant you to call me stupid.

odroid wrote:@tpoechtrager & @joaofl,
Can you tell me the chipset name/number information?
Note that Kernel 3.10 had no UAS capability.


Code: Select all
[root@odroid ~]# lsusb   
Bus 006 Device 002: ID 0bda:8153 Realtek Semiconductor Corp. RTL8153 Gigabit Ethernet Adapter
Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 007: ID 1199:9091 Sierra Wireless, Inc.
Bus 004 Device 006: ID 0bda:0411 Realtek Semiconductor Corp.
Bus 004 Device 005: ID 05e3:0616 Genesys Logic, Inc. hub
Bus 004 Device 004: ID 2109:0715 VIA Labs, Inc.  <-- UGREEN Bridge
Bus 004 Device 003: ID 0bda:0411 Realtek Semiconductor Corp.
Bus 004 Device 002: ID 05e3:0616 Genesys Logic, Inc. hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 006: ID 0bda:5411 Realtek Semiconductor Corp.
Bus 003 Device 005: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 003 Device 004: ID 1546:01a7 U-Blox AG [u-blox 7]
Bus 003 Device 003: ID 0bda:5411 Realtek Semiconductor Corp.
Bus 003 Device 002: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


Code: Select all
Bus 004 Device 004: ID 2109:0715 VIA Labs, Inc.
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               3.10
  bDeviceClass            0
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         9
  idVendor           0x2109 VIA Labs, Inc.
  idProduct          0x0715
  bcdDevice            3.36
  iManufacturer           1 Ugreen
  iProduct                2 20231
  iSerial                 3 000000126F97
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          121
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xc0
      Self Powered
    MaxPower                8mA
    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              15
      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              15
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       1
      bNumEndpoints           4
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     98
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x04  EP 4 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst               0
        Command pipe (0x01)
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x85  EP 5 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst              15
        MaxStreams             32
        Data-in pipe (0x03)
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x06  EP 6 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst              15
        MaxStreams             32
        Data-out pipe (0x04)
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x87  EP 7 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst               0
        MaxStreams             32
        Status pipe (0x02)
Binary Object Store Descriptor:
  bLength                 5
  bDescriptorType        15
  wTotalLength           42
  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   1
      Lowest fully-functional device speed is Full Speed (12Mbps)
    bU1DevExitLat          10 micro seconds
    bU2DevExitLat        2047 micro seconds
  Container ID Device Capability:
    bLength                20
    bDescriptorType        16
    bDevCapabilityType      4
    bReserved               0
    ContainerID             {1c1fd9db-6db8-b248-aa1e-df6c25dc8a29}
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0001
  Self Powered


Same issue with a JMS561U (JMicron).
tpoechtrager
 
Posts: 12
Joined: Thu Jan 25, 2018 5:02 am
languages_spoken: german, english
ODROIDs: XU 4

Re: Getting UAS working on HK 4.9

Unread postby rooted » Fri Feb 02, 2018 11:05 pm

He didn't call you stupid and is trying to help.
User avatar
rooted
 
Posts: 4907
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: Getting UAS working on HK 4.9

Unread postby tpoechtrager » Fri Feb 02, 2018 11:33 pm

He got me three times wrong in a row. Two times about the dmesg output and hasn't seen I already posted a link to the UGREEN SATA bridge. Clearly says he isn't reading my posts thoroughly.

BTW: My UAS SANDISK USB 3.0 stick showed the same issue in 4.9.x.

Code: Select all
[ 8069.257981] usbcore: registered new interface driver usb-storage
[ 8069.258710] usbcore: registered new interface driver uas
[ 8070.313801] scsi 8:0:0:0: Direct-Access     SanDisk  Extreme          0001 PQ: 0 ANSI: 6
[ 8070.315153] sd 8:0:0:0: [sdd] 125045424 512-byte logical blocks: (64.0 GB/59.6 GiB)


Code: Select all
Bus 001 Device 002: ID 0781:5580 SanDisk Corp. SDCZ80 Flash Drive


There is something wrong this board or its drivers.
tpoechtrager
 
Posts: 12
Joined: Thu Jan 25, 2018 5:02 am
languages_spoken: german, english
ODROIDs: XU 4

Re: Getting UAS working on HK 4.9

Unread postby odroid » Fri Feb 02, 2018 11:49 pm

Since I've been answering against over 100 questions everyday, I could be confused. Sorry about that.
I requested the VIA part number. But it seems not to be accessible on your side.
JMS561 series has many different firmware versions.
https://wiki.odroid.com/accessory/add-o ... re_upgrade

Anyway, I will buy the same Sandisk 64GB SDCZ80 flash early next week and try to reproduce the issue.
Is your device is Extreme Pro or Extreme Go?
Can you give me a link in Amazon.com?
User avatar
odroid
Site Admin
 
Posts: 27947
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Getting UAS working on HK 4.9

Unread postby tpoechtrager » Sat Feb 03, 2018 1:48 am

Wasn't directed to you.

SanDisk Extreme USB 3.0 64 GB (old but faster than the new versions)

https://www.amazon.com/SanDisk-Extreme- ... B00DZPUOUI
tpoechtrager
 
Posts: 12
Joined: Thu Jan 25, 2018 5:02 am
languages_spoken: german, english
ODROIDs: XU 4

Re: Getting UAS working on HK 4.9

Unread postby odroid » Sat Feb 03, 2018 10:13 am

I have the same one(but 32GB) what I bought a few years ago.
But it didn't support the UAS mode as far as I remember.
Can you check "lsusb -t" output on your x86 PC?
User avatar
odroid
Site Admin
 
Posts: 27947
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Getting UAS working on HK 4.9

Unread postby tpoechtrager » Sun Feb 04, 2018 1:44 am

Ok, I take it back. The SDCZ80 does not support UAS. I was confused by the Kernel output which I posted yesterday. No idea why the UAS driver gets loaded when the stick is attached. Anyway, with or without UAS doesn't matter for 4.9.x. I got lots of crashes with said USB stick ("usb reset ...") and haven't seen a single one on 4.14.x. I will let you know next week how exactly to trigger this issue on 4.9.x. The 32 GB version is slower btw. not sure if it matters though.


Is there any way to move the LITTLE cores on the back and the BIG cores on the front, so new processes and interrupts run automatically on the BIG cores instead of the LITTLE cores? The LITTLE cores seem to be a performance killer. I know we can change the CPU affinity of processes and interrupts, but I also think it'd we great if we wouldn't have to rely on such "hacks".

What I mean is:

CPU 0-3 => BIG Cluster
CPU 4-7 => LITTLE Cluster
tpoechtrager
 
Posts: 12
Joined: Thu Jan 25, 2018 5:02 am
languages_spoken: german, english
ODROIDs: XU 4

Re: Getting UAS working on HK 4.9

Unread postby rooted » Sun Feb 04, 2018 5:57 am

tpoechtrager wrote:Is there any way to move the LITTLE cores on the back and the BIG cores on the front, so new processes and interrupts run automatically on the BIG cores instead of the LITTLE cores?


You can do what you want with cpusets. Or you can just disable the little cores.

Or you can run processes manually like this:

Code: Select all
alias little='taskset -c 0-3 $f'
alias big='taskset -c 4-7 $f'


I have these in my ~/.bash_aliases so I can run things how I like.


tpoechtrager wrote:but I also think it'd we great if we wouldn't have to rely on such "hacks".


The kernel intelligently switches tasks between big.LITTLE, it isn't a hack to specify otherwise.
User avatar
rooted
 
Posts: 4907
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: Getting UAS working on HK 4.9

Unread postby DarkBahamut » Sun Feb 04, 2018 7:38 am

If you use 4.9 or 4.14 then hperf-hmp is already designed to schedule to the big cluster first, then the little cluster second. It doesn't always work though because it's fairly buggy at times. For most use cases it will be a good enough job as it is, but if you want to guarantee the performance then you basically have to disable the small cores so they can't be used - or manually taskset your processes.

On 3.10 you can achieve a similar aim by using fork migration which works pretty well. Unfortunately that b.L-mp update isn't present in the stock XU4 3.10 kernel, but it is possible to merge in.
DarkBahamut
 
Posts: 305
Joined: Tue Jan 19, 2016 10:19 am
languages_spoken: english
ODROIDs: XU4

Re: Getting UAS working on HK 4.9

Unread postby tpoechtrager » Sun Feb 04, 2018 8:10 am

rooted wrote:
tpoechtrager wrote:Is there any way to move the LITTLE cores on the back and the BIG cores on the front, so new processes and interrupts run automatically on the BIG cores instead of the LITTLE cores?


You can do what you want with cpusets. Or you can just disable the little cores.

Or you can run processes manually like this:

Code: Select all
alias little='taskset -c 0-3 $f'
alias big='taskset -c 4-7 $f'


I have these in my ~/.bash_aliases so I can run things how I like.


Yes, I know. Thank you for the hint though.

rooted wrote:The kernel intelligently switches tasks between big.LITTLE, it isn't a hack to specify otherwise.


What I mean with hacks are things like this:

Code: Select all
echo 4 > /proc/irq/80/smp_affinity_list
echo 5 > /proc/irq/150/smp_affinity_list
echo 6 > /proc/irq/151/smp_affinity_list


By default the USB and network interrupts are run on the LITTLE cluster which slows down the network. See: https://obihoernchen.net/1416/odroid-xu ... usb-speed/.

Well... and ... "switches tasks between big.LITTLE"

I had speed drops with Apache2 and when I forced the httpd processes to CPU 7 all speeds drops were gone. I would really like to swap the LITTLE cluster with the BIG cluster.

DarkBahamut wrote:If you use 4.9 or 4.14 then hperf-hmp is already designed to schedule to the big cluster first, then the little cluster second. It doesn't always work though because it's fairly buggy at times. For most use cases it will be a good enough job as it is, but if you want to guarantee the performance then you basically have to disable the small cores so they can't be used - or manually taskset your processes.


Is it even possible to disable CPU 0?
tpoechtrager
 
Posts: 12
Joined: Thu Jan 25, 2018 5:02 am
languages_spoken: german, english
ODROIDs: XU 4

Re: Getting UAS working on HK 4.9

Unread postby DarkBahamut » Sun Feb 04, 2018 9:27 am

tpoechtrager wrote:Is it even possible to disable CPU 0?


Yes.

Not really that I'd recommend it though.
DarkBahamut
 
Posts: 305
Joined: Tue Jan 19, 2016 10:19 am
languages_spoken: english
ODROIDs: XU4

Re: Getting UAS working on HK 4.9

Unread postby tpoechtrager » Mon Feb 05, 2018 2:18 am

@odroid:

Ok, reproducing is quite simple.

Code: Select all
[root@odroid ~]# uname -a
Linux odroid 4.9.61-1-ARCH #1 SMP PREEMPT Fri Nov 10 02:34:52 UTC 2017 armv7l GNU/Linux


Code: Select all
[   17.207646] usb 4-1.1.3: new SuperSpeed USB device number 8 using xhci-hcd
[   17.233794] usb 4-1.1.3: New USB device found, idVendor=0781, idProduct=5580
[   17.239395] usb 4-1.1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   17.246847] usb 4-1.1.3: Product: Extreme
[   17.250834] usb 4-1.1.3: Manufacturer: SanDisk
[   17.255272] usb 4-1.1.3: SerialNumber: AA010225132325292603
[   17.262071] usb-storage 4-1.1.3:1.0: USB Mass Storage device detected
[   17.268238] scsi host1: usb-storage 4-1.1.3:1.0
[   18.278538] scsi 1:0:0:0: Direct-Access     SanDisk  Extreme          0001 PQ: 0 ANSI: 6
[   18.285989] sd 1:0:0:0: Attached scsi generic sg1 type 0
[   18.290619] sd 1:0:0:0: [sdb] 125045424 512-byte logical blocks: (64.0 GB/59.6 GiB)
[   18.298664] sd 1:0:0:0: [sdb] Write Protect is off
[   18.302932] sd 1:0:0:0: [sdb] Mode Sense: 33 00 00 08
[   18.303435] sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[   18.316839] sd 1:0:0:0: [sdb] Attached SCSI disk


Attach the stick and run:

Code: Select all
dd if=/dev/<USB Stick> of=/dev/null bs=1MB


On a different Linux PC utilize a lot of network traffic, for example by using ping:

Code: Select all
ping <IP of XU4> -s 65500 -i 0 &>/dev/null &
ping <IP of XU4> -s 65500 -i 0 &>/dev/null &
ping <IP of XU4> -s 65500 -i 0 &>/dev/null &
ping <IP of XU4> -s 65500 -i 0 &>/dev/null &
ping <IP of XU4> -s 65500 -i 0 &>/dev/null &
ping <IP of XU4> -s 65500 -i 0 &>/dev/null &
ping <IP of XU4> -s 65500 -i 0 &>/dev/null &


Result:

Code: Select all
[  422.247688] usb 4-1.1.3: reset SuperSpeed USB device number 8 using xhci-hcd
[  422.377684] usb 4-1.1.3: reset SuperSpeed USB device number 8 using xhci-hcd
[  462.508170] sd 1:0:0:0: [sdb] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=0x08
[  462.514894] sd 1:0:0:0: [sdb] tag#0 Sense Key : 0x4 [current]
[  462.520696] sd 1:0:0:0: [sdb] tag#0 ASC=0x0 ASCQ=0x0
[  462.525718] sd 1:0:0:0: [sdb] tag#0 CDB: opcode=0x28 28 00 00 60 ae 50 00 01 00 00
[  462.533261] blk_update_request: I/O error, dev sdb, sector 6336080
[  510.643177] sd 1:0:0:0: [sdb] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=0x08
[  510.649905] sd 1:0:0:0: [sdb] tag#0 Sense Key : 0x4 [current]
[  510.655710] sd 1:0:0:0: [sdb] tag#0 ASC=0x0 ASCQ=0x0
[  510.660730] sd 1:0:0:0: [sdb] tag#0 CDB: opcode=0x28 28 00 00 60 af 50 00 01 00 00
[  510.668275] blk_update_request: I/O error, dev sdb, sector 6336336
[  558.778219] sd 1:0:0:0: [sdb] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=0x08
[  558.784942] sd 1:0:0:0: [sdb] tag#0 Sense Key : 0x4 [current]
[  558.790746] sd 1:0:0:0: [sdb] tag#0 ASC=0x0 ASCQ=0x0
[  558.795769] sd 1:0:0:0: [sdb] tag#0 CDB: opcode=0x2a 2a 00 00 40 51 28 00 08 00 00
[  558.803311] blk_update_request: I/O error, dev sdb, sector 4215080
[  606.913158] sd 1:0:0:0: [sdb] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=0x08
[  606.919885] sd 1:0:0:0: [sdb] tag#0 Sense Key : 0x4 [current]
[  606.925687] sd 1:0:0:0: [sdb] tag#0 ASC=0x0 ASCQ=0x0
[  606.930710] sd 1:0:0:0: [sdb] tag#0 CDB: opcode=0x2a 2a 00 00 40 61 28 00 00 08 00
[  606.938252] blk_update_request: I/O error, dev sdb, sector 4219176
[  655.053137] sd 1:0:0:0: [sdb] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=0x08
[  655.059861] sd 1:0:0:0: [sdb] tag#0 Sense Key : 0x4 [current]
[  655.065669] sd 1:0:0:0: [sdb] tag#0 ASC=0x0 ASCQ=0x0
[  655.070687] sd 1:0:0:0: [sdb] tag#0 CDB: opcode=0x28 28 00 00 60 ae 50 00 00 08 00
[  655.078229] blk_update_request: I/O error, dev sdb, sector 6336080
[  655.084379] Buffer I/O error on dev sdb, logical block 792010, async page read
[  703.203318] sd 1:0:0:0: [sdb] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=0x08
[  703.210047] sd 1:0:0:0: [sdb] tag#0 Sense Key : 0x4 [current]
[  703.215853] sd 1:0:0:0: [sdb] tag#0 ASC=0x0 ASCQ=0x0
[  703.220873] sd 1:0:0:0: [sdb] tag#0 CDB: opcode=0x2a 2a 00 00 40 59 28 00 08 00 00
[  703.228417] blk_update_request: I/O error, dev sdb, sector 4217128


Cannot reproduce this on 4.14.16.

Code: Select all
[root@odroid ~]# uname -a
Linux odroid 4.14.16-1-ARCH #1 SMP PREEMPT Thu Feb 1 11:55:35 CET 2018 armv7l GNU/Linux


The UAS one is a different issue.

DarkBahamut wrote:
tpoechtrager wrote:Is it even possible to disable CPU 0?


Yes.

Not really that I'd recommend it though.


Doesn't work for me. I can disable CPU 0 but then my ODROID gets quite unstable and I cannot reactivate CPU 0 anymore.

Tried:

Code: Select all
echo 0 > /sys/devices/system/cpu/cpu0/online
tpoechtrager
 
Posts: 12
Joined: Thu Jan 25, 2018 5:02 am
languages_spoken: german, english
ODROIDs: XU 4

Re: Getting UAS working on HK 4.9

Unread postby rooted » Mon Feb 05, 2018 8:57 am

tpoechtrager wrote:
Doesn't work for me. I can disable CPU 0 but then my ODROID gets quite unstable and I cannot reactivate CPU 0 anymore.

Tried:

Code: Select all
echo 0 > /sys/devices/system/cpu/cpu0/online


Have you checked that your power supply is good, seems like it may be a power issue.
User avatar
rooted
 
Posts: 4907
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: Getting UAS working on HK 4.9

Unread postby odroid » Mon Feb 05, 2018 11:48 am

Right, "reactivating cores" is not working properly.
But, I could run some heavy tasks on four big cores after disabling little cores.
Code: Select all
root@odroid:/home/odroid# cat /sys/devices/system/cpu/cpu*/online
0
0
0
0
1
1
1
1

aaa.png
aaa.png (101.72 KiB) Viewed 1565 times


BTW, our stock configuration in Ubuntu image assigns the Gbit Ethernet and USB 3.0 related IRQs to big cores by default.
Code: Select all
odroid@odroid:~$ cat /bin/odroid-tweaks
#!/bin/bash
USB3_IRQ=`cat /proc/interrupts | grep "xhci-hcd:usb3" | awk -F : '{print $1}'`
USB5_IRQ=`cat /proc/interrupts | grep "xhci-hcd:usb5" | awk -F : '{print $1}'`
echo 5 > /proc/irq/${USB3_IRQ}/smp_affinity_list
echo 6 > /proc/irq/${USB5_IRQ}/smp_affinity_list

if [ -f /sys/class/net/eth0/queues/rx-0/rps_cpus ]; then
   echo f > /sys/class/net/eth0/queues/rx-0/rps_cpus
fi
User avatar
odroid
Site Admin
 
Posts: 27947
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Getting UAS working on HK 4.9

Unread postby mad_ady » Mon Feb 05, 2018 2:18 pm

In addition to moving interrupts to the big cores via odroid-tweaks you can also move all userspace processes to the big cores by editing /etc/systemd/systemd.conf and setting CPUAffinity to 4 5 6 7. You can still run processes on the little cores with tasksel afterwards.
User avatar
mad_ady
 
Posts: 3805
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: Getting UAS working on HK 4.9

Unread postby tpoechtrager » Mon Feb 05, 2018 9:03 pm

rooted wrote:
tpoechtrager wrote:
Doesn't work for me. I can disable CPU 0 but then my ODROID gets quite unstable and I cannot reactivate CPU 0 anymore.

Tried:

Code: Select all
echo 0 > /sys/devices/system/cpu/cpu0/online


Have you checked that your power supply is good, seems like it may be a power issue.


I am using a 5V 4A PSU. I ran nice -n +20 stress -c 256 once for 24 hours with absolutely no issues. I have a 40 mm Noctua fan on top of the passive heatsink though (max temp ~63°c).

mad_ady wrote:In addition to moving interrupts to the big cores via odroid-tweaks you can also move all userspace processes to the big cores by editing /etc/systemd/systemd.conf and setting CPUAffinity to 4 5 6 7. You can still run processes on the little cores with tasksel afterwards.


Awesome. Thank you!
tpoechtrager
 
Posts: 12
Joined: Thu Jan 25, 2018 5:02 am
languages_spoken: german, english
ODROIDs: XU 4

Re: Getting UAS working on HK 4.9

Unread postby mad_ady » Mon Feb 05, 2018 10:27 pm

For details check out the General Purpose NAS article here: https://magazine.odroid.com/wp-content/ ... 201702.pdf
User avatar
mad_ady
 
Posts: 3805
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: Getting UAS working on HK 4.9

Unread postby rooted » Tue Feb 06, 2018 4:27 am

tpoechtrager wrote:
rooted wrote:
tpoechtrager wrote:
Doesn't work for me. I can disable CPU 0 but then my ODROID gets quite unstable and I cannot reactivate CPU 0 anymore.

Tried:

Code: Select all
echo 0 > /sys/devices/system/cpu/cpu0/online


Have you checked that your power supply is good, seems like it may be a power issue.


I am using a 5V 4A PSU. I ran nice -n +20 stress -c 256 once for 24 hours with absolutely no issues. I have a 40 mm Noctua fan on top of the passive heatsink though (max temp ~63°c).


Not likely a power problem then.
User avatar
rooted
 
Posts: 4907
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: Getting UAS working on HK 4.9

Unread postby tkaiser » Wed Feb 07, 2018 2:22 am

tpoechtrager wrote:I tested 4.9.x and 4.14.x on my PC. Not a single problem.


Nice. When I re-entered this thread you were reporting you were dealing with a Norelsys chipset. These things are known to cause UAS problems with 4.x kernel that were fixed just recently in 4.14. So you're saying that you have no problems with your Norelsys disk enclosure and kernel 4.9 on a PC (no UAS blacklisting)?

Anyway: if it's only occuring at the XU4 with chipsets that are known to be not broken wrt UAS you still can choose between two alternatives: USB3-A receptacle crappiness (very common with XU4, symptoms like yours) or undervoltage (amperage ratings 100% irrelevant, it's about voltage drops happening under load, symptoms like yours).

Just google for 'usb 4-1.1.3: reset SuperSpeed USB device number 8 using xhci-hcd'. You will find the usual stupid 'UAS is evil' reports (since people think if 'uas' appears in dmesg due to this driver reporting problems layers below it must be the fault of UAS --> shooting the messenger is always fun) and you will find especially XU4 reports related to insufficient powering (example, taking care that symptoms with old 3.x kernel also look identical: https://github.com/Fourdee/DietPi/issues/487 ) and cable/receptacles problems.
tkaiser
 
Posts: 354
Joined: Mon Nov 09, 2015 12:30 am
languages_spoken: english
ODROIDs: C1+, C2, XU4, HC1

Re: Getting UAS working on HK 4.9

Unread postby tpoechtrager » Thu Feb 08, 2018 4:51 am

I am telling you now one last time: I DO NOT OWN A NORELSYS SATA bridge. Learn to read. I am using an external powered VIA SATA bridge.

Image

This ignorancy is unbelievable.
tpoechtrager
 
Posts: 12
Joined: Thu Jan 25, 2018 5:02 am
languages_spoken: german, english
ODROIDs: XU 4

Re: Getting UAS working on HK 4.9

Unread postby tkaiser » Thu Feb 08, 2018 6:09 am

tpoechtrager wrote:I am telling you now one last time: I DO NOT OWN A NORELSYS SATA bridge. Learn to read. I am using an external powered VIA SATA bridge.


Ah, yes. You quoted someone else for whatever reasons and there in the dmesg output the Norelsys was referenced. Sorry, I really don't read those 'UAS is broken' reports closely since it's way too boring in the meantime reading about the same problems (unrelated to UAS and drivers) again and again :)
tkaiser
 
Posts: 354
Joined: Mon Nov 09, 2015 12:30 am
languages_spoken: english
ODROIDs: C1+, C2, XU4, HC1

Re: Getting UAS working on HK 4.9

Unread postby joaofl » Sat May 19, 2018 1:33 am

Bringing up again this annoying usb-reset issues. I found out something. Also posted this issue on the dietpi github.

Few weeks ago I finally tried to migrate to kernel 4.14 (from my actual setup running kernel 3.xxx) using the exact same hardware setup, with the latest dietpi. The setup Is:

SD card with the boot
SSD USB3 powered adapter with the filesystem, for better performance than the SD card.
HD on USB3, externally powered (where all the junk is)

So it started well. First stress tests were all ok. That is, some intense IO on the HD simultaneously with some network transfer. Something like copying a big file from and to the HD from another computer via gigabit network.

Then, first thing, before installing apps, I moved the filesystems to my USB3 External SSD uing the dietpi scrip, as I had done before. Then I run the same "stress test" again, and this is when the problem arise:
usb 4-1.2: reset SuperSpeed USB device number 3 using xhci-hcd

The exact same issue.. The needle ticking and this restart issue. Then I downgrade to the 3.x kernel, and the exact same tests, and the setup works just fine.

One way of avoiding the problem is to not migrate the filesystem to the USB. But in case you do, You may have the same issue. I tested It on my two Odroid XU4. It is definitely not related to power issue.

It does not seem to happen to many people here, as most of them have their filysystem at the SD card or EMMC, and are not necessarily using these means provided by the dietpi to transfer the filesystem to USB storage. I believe it is reproducible with any couple of USB3 devices.

Do you guys say something on that? Sorry to bother with this issue again, but now I'm really feeling behing without the latest updates.
Cheers
joaofl
 
Posts: 39
Joined: Sat Feb 27, 2016 2:29 am
Location: Portugal, Brasil
languages_spoken: english, portuguese, spanish
ODROIDs: XU4

Re: Getting UAS working on HK 4.9

Unread postby joaofl » Sat May 19, 2018 1:52 am

Just to reinforce: I really believe it is not power related, as I have tested every cable/power supply combination possible. Believe me, I have loads of them. Even with a computer power supply, with some 10A+ available.

Moreover, if the filesystem is at the SD, and I run the stress test with kernel 4.14, and IO all SSD , HD and network intensively simultaneously, I get no errors. The issue only arises after the filesystem gets copied to the SSD. Reason why I believe it is some kernel issue. Hard to tell.
joaofl
 
Posts: 39
Joined: Sat Feb 27, 2016 2:29 am
Location: Portugal, Brasil
languages_spoken: english, portuguese, spanish
ODROIDs: XU4

Re: Getting UAS working on HK 4.9

Unread postby crashoverride » Sat May 19, 2018 9:48 pm

joaofl wrote:Then I downgrade to the 3.x kernel, and the exact same tests, and the setup works just fine.

Kernel 3.x did not have UAS enabled. Linux UAS is only confirmed to work on 1 chipset (JMicron) and rumored to work on select variants of others. This is not a power issue or XU4 issue. It is reproducible on PC (x86) hardware. As the kernel version increases, more drivers are blacklisted - this is entirely the opposite from UAS compatibility improving. If you do not have the exact JMicron USB3-to-SATA chipset used in Cloudshell 2, you should disable UAS no matter what platform you are using.

I am completely aware there will be a post following this one claiming otherwise. Feel free to disregard it.
crashoverride
 
Posts: 3518
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: Getting UAS working on HK 4.9

Unread postby joaofl » Mon May 21, 2018 11:22 pm

crashoverride wrote:
joaofl wrote:Then I downgrade to the 3.x kernel, and the exact same tests, and the setup works just fine.

Kernel 3.x did not have UAS enabled. Linux UAS is only confirmed to work on 1 chipset (JMicron) and rumored to work on select variants of others. This is not a power issue or XU4 issue. It is reproducible on PC (x86) hardware. As the kernel version increases, more drivers are blacklisted - this is entirely the opposite from UAS compatibility improving. If you do not have the exact JMicron USB3-to-SATA chipset used in Cloudshell 2, you should disable UAS no matter what platform you are using.

I am completely aware there will be a post following this one claiming otherwise. Feel free to disregard it.


:D thanks for the acknowledgment. Thing is... I'm not using UAS drivers. This issue happens on the device as a mass storage device as well. I know this post is not exactly about that, but this have been discussed here as well, so I it made sense to comment it here, as it may be related.
joaofl
 
Posts: 39
Joined: Sat Feb 27, 2016 2:29 am
Location: Portugal, Brasil
languages_spoken: english, portuguese, spanish
ODROIDs: XU4

Re: Getting UAS working on HK 4.9

Unread postby mad_ady » Mon May 21, 2018 11:34 pm

You can try to limit the number of sectors being written at a time with something like this:
Code: Select all
#get WDC drive
device=`readlink /dev/disk/by-id/ata-WDC_WD30EZRX-00AZ6B0_WD-WCC070344331 | cut -d '/' -f 3`

if [ -f "/sys/class/block/$device/queue/max_sectors_kb" ]; then
    logger -s -t $0 "Setting HDD $device speed limit"
        echo 100 > /sys/class/block/$device/queue/max_sectors_kb

fi


Start with 10 and increase the value between tests. With Kernel 4.9 I could use my disk with 10. With 4.14 (older) it was still 10. But some kernel update improved the USB reset behavior and I can get away with 100. Default is 1024 I think. There is little performance penalty when using 100. With 10 you mostly downgrade the disk to USB2 speeds.
User avatar
mad_ady
 
Posts: 3805
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: Getting UAS working on HK 4.9

Unread postby joaofl » Tue May 22, 2018 12:02 am

mad_ady wrote:You can try to limit the number of sectors being written at a time with something like this:
Code: Select all
#get WDC drive
device=`readlink /dev/disk/by-id/ata-WDC_WD30EZRX-00AZ6B0_WD-WCC070344331 | cut -d '/' -f 3`

if [ -f "/sys/class/block/$device/queue/max_sectors_kb" ]; then
    logger -s -t $0 "Setting HDD $device speed limit"
        echo 100 > /sys/class/block/$device/queue/max_sectors_kb

fi


Start with 10 and increase the value between tests. With Kernel 4.9 I could use my disk with 10. With 4.14 (older) it was still 10. But some kernel update improved the USB reset behavior and I can get away with 100. Default is 1024 I think. There is little performance penalty when using 100. With 10 you mostly downgrade the disk to USB2 speeds.


Gonna give it a try. Thanks!
joaofl
 
Posts: 39
Joined: Sat Feb 27, 2016 2:29 am
Location: Portugal, Brasil
languages_spoken: english, portuguese, spanish
ODROIDs: XU4

Re: Getting UAS working on HK 4.9

Unread postby CoBrA2168 » Fri May 25, 2018 6:58 am

Is anyone here able to confirm if the ASM1156 chipset would work with the ODROID XU-4? I'm thinking about picking up an XU-4 for a home NAS / surveillance system along with a dual 3.5" HDD enclosure. The enclosures I'm looking at have the ASM1156 chipset.

If it does not work (or it is unconfirmed) I will buy a single-drive enclosure which uses the ASM1153 chipset (confirmed working in this thread).

Thanks!
CoBrA2168
 
Posts: 12
Joined: Fri May 25, 2018 6:55 am
languages_spoken: english

Re: Getting UAS working on HK 4.9

Unread postby odroid » Fri May 25, 2018 8:07 am

ASM1156 seems to be compatible with XU4 Kernel 4.14 UAS driver.
It doesn't exist in the blacklist either.
https://github.com/hardkernel/linux/blo ... sual_uas.h
But I can't guarantee since we have no real sample.
User avatar
odroid
Site Admin
 
Posts: 27947
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Getting UAS working on HK 4.9

Unread postby CoBrA2168 » Fri May 25, 2018 8:23 am

odroid wrote:ASM1156 seems to be compatible with XU4 Kernel 4.14 UAS driver.
It doesn't exist in the blacklist either.
https://github.com/hardkernel/linux/blo ... sual_uas.h
But I can't guarantee since we have no real sample.

Wow, thank you for the very, very quick reply.

With that in mind, I might take a shot with it and see how it works. I'll report back here once I have all of the necessary hardware to do a test (this could be a while, right now I have nothing). I plan on ordering my XU4 first and getting that up and running. From there, I'll look into expanding with a USB 3.0 enclosure.

In the meantime, if anyone else has experience with the XU4 and ASM1156 chipset, please reply to this post. Thanks in advance!
CoBrA2168
 
Posts: 12
Joined: Fri May 25, 2018 6:55 am
languages_spoken: english

Re: Getting UAS working on HK 4.9

Unread postby CoBrA2168 » Thu Jun 14, 2018 7:28 pm

odroid wrote:ASM1156 seems to be compatible with XU4 Kernel 4.14 UAS driver.
It doesn't exist in the blacklist either.
https://github.com/hardkernel/linux/blo ... sual_uas.h
But I can't guarantee since we have no real sample.

I finally got all of the hardware for the XU4, including the USB 3.0 Dual SATA Dock. I'm using a 4TB Seagate 3.5" HDD inside. Upon plugging it in (using the latest 16.04 minimal image and latest updates/kernel), it was automatically recognized. Even though the product page reports it as having an "ASM1156" chipset, Ubuntu was reporting it as an ASM1153 variety. Regardless, it appears to work just fine. I was able to successfully format it and mount it with fstab.

However, I need to do a longer read/write test to ensure that it will continue to work under a load. I also need to confirm if UASP is enabled. I'm sure it was discussed in this thread, but without going through and re-reading the entire thing, could someone tell me an easy way to confirm that?

For those wondering, here is the dock I purchased. Hardware wise, it feels very solid/premium.
https://www.amazon.com/Inateck-Aluminum ... B01KWQ8WFG
CoBrA2168
 
Posts: 12
Joined: Fri May 25, 2018 6:55 am
languages_spoken: english

Re: Getting UAS working on HK 4.9

Unread postby mad_ady » Thu Jun 14, 2018 9:26 pm

lsusb -t | grep uas
User avatar
mad_ady
 
Posts: 3805
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: Getting UAS working on HK 4.9

Unread postby CoBrA2168 » Fri Jun 15, 2018 6:47 am

mad_ady wrote:lsusb -t | grep uas

Duh...sorry for asking such a dumb question!

Great news...the dock is working OOB with UAS! Now the last thing to test is if continuous reads/writes will prove to be stable. I haven't done much with it just yet, but once I get the appropriate software installed, that will change.

FYI, for anyone curious, here's what
Code: Select all
lsusb
reports for the dual dock (linked above):
Code: Select all
Bus 004 Device 003: ID 174c:55aa ASMedia Technology Inc. ASM1051E SATA 6Gb/s bridge, ASM1053E SATA 6Gb/s bridge, ASM1153 SATA 3Gb/s bridge


Thanks again to @mad_ady and @odroid for the help.
CoBrA2168
 
Posts: 12
Joined: Fri May 25, 2018 6:55 am
languages_spoken: english

Previous

Return to Linux Kernel 4.14 Debugging Party

Who is online

Users browsing this forum: No registered users and 2 guests