Mass storage USB3
I have a ROC-RK3328-CC and wanted to use a USB3 to SATA adapter on it. I used the Debian 9 image from http://share.loverpi.com/board/libre-computer-project/libre-computer-board-roc-rk3328-cc/image/debian/
First problem: the modules in /lib/modules are built with a different kernel than the running kernel. And this USB3/SATA adapter needs the uas module.
version magic '4.4.114-00003-g78cbf59-dirty SMP mod_unload aarch64' should be '4.4.114-00004-gdfc5669-dirty SMP mod_unload aarch64'
Solution: I built my own kernel. gcc 8 has too many errors about the Rockchip 4.4.114 vendor kernel code, but I was able to make gcc 7 work.
Second problem: the dreaded
dwmmc_rockchip ff500000.dwmmc: Unexpected interrupt latency message. I was trying to create a filesystem on my USB3/SATA disk, and the system would print that message a few times and eventually lose networking.
First workaround: I hooked the drive up via usb2, and that worked at 25MB/s instead of 75MB/s.
Second workaround: I noticed that all the interrupts were on the same core, so I moved some around.
This seems to be the important one, and I moved it to CPU1:
$ head -1 /proc/interrupts; grep "^ 37" /proc/interrupts CPU0 CPU1 CPU2 CPU3 37: 1219910 1494973 0 0 GICv2 44 Level dw-mci $ echo 2 | sudo tee /proc/irq/39/smp_affinity
But I also moved the NIC to CPU2:
$ head -1 /proc/interrupts; grep "^ 39" /proc/interrupts CPU0 CPU1 CPU2 CPU3 39: 17223 0 109241 0 GICv2 56 Level eth0 $ echo 4 | sudo tee /proc/irq/39/smp_affinity
After moving the interrupts, everything worked well.
I wrote 12 GB to the USB3/SATA drive with dd:
12004098048 bytes (12 GB, 11 GiB) copied, 106.639 s, 113 MB/s
And I checked out and built the kernel (including debian packages) on that drive:
dpkg-deb: building package 'linux-headers-4.4.114-g4dd43f33-dirty' in '../linux-headers-4.4.114-g4dd43f33-dirty_4.4.114-g4dd43f33-dirty-1_arm64.deb'.
dpkg-deb: building package 'linux-libc-dev' in '../linux-libc-dev_4.4.114-g4dd43f33-dirty-1_arm64.deb'.
dpkg-deb: building package 'linux-image-4.4.114-g4dd43f33-dirty' in '../linux-image-4.4.114-g4dd43f33-dirty_4.4.114-g4dd43f33-dirty-1_arm64.deb'.
dpkg-deb: building package 'linux-image-4.4.114-g4dd43f33-dirty-dbg' in '../linux-image-4.4.114-g4dd43f33-dirty-dbg_4.4.114-g4dd43f33-dirty-1_arm64.deb'.
dpkg-source: info: using source format '3.0 (custom)'
dpkg-source: info: building linux-4.4.114-g4dd43f33-dirty in linux-4.4.114-g4dd43f33-dirty_4.4.114-g4dd43f33-dirty-1.dsc
I'd be curious to see if moving interrupt 37 works for other people having this problem.