Skip to content

RP64 PCIe bus scan crash workaround for 4.20

Pre-release
Pre-release
Compare
Choose a tag to compare
@nuumio nuumio released this 03 Mar 22:39
· 123 commits to master since this release

Added a little sleep before PCIe bus scan. This made my LSI SAS2008 controller working. At least lspci shows the device:

$ lspci -nn
00:00.0 PCI bridge [0604]: Fuzhou Rockchip Electronics Co., Ltd Device [1d87:0100]
01:00.0 Serial Attached SCSI controller [0107]: LSI Logic / Symbios Logic SAS2008 PCI-Express Fusion-MPT SAS-2 [Falcon] [1000:0072] (rev 03)
$ uname -a
Linux rockpro64 4.20.0-nuumio-pcie-scan-sleep-01 #1 SMP PREEMPT Sun Mar 3 23:44:59 EET 2019 aarch64 aarch64 aarch64 GNU/Linux

NOTE: I'm not currently ably to test the controller with real drives. It's going to take a day or two before I can do that.

By default sleep is 750ms in device tree. It can be adjusted in device tree (bus-scan-delay-ms = <175>;) or in kernel command-line (pcie_rockchip_host.bus_scan_delay=900). Kernel command-line parameter overrides device tree. I adjusted timing so that it's just barely above the stable threshold on my system so it's quite possible that timing needs adjusting on other systems. I have also erased bios from my SAS controller to make it boot faster and that may affect timing!

Example snippet from /boot/extlinux/extlinux.conf for adjusting the delay:

label kernel-4.20.0-nuumio-pcie-scan-sleep-01
    kernel /boot/vmlinuz-4.20.0-nuumio-pcie-scan-sleep-01
    initrd /boot/initrd.img-4.20.0-nuumio-pcie-scan-sleep-01
    devicetreedir /boot/dtbs/4.20.0-nuumio-pcie-scan-sleep-01
    append rw panic=10 init=/sbin/init coherent_pool=1M ethaddr=${ethaddr} eth1addr=${eth1addr} serial=${serial#} cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1 root=LABEL=linux-root rootwait rootfstype=ext4 mmc_cmdqueue=off pcie_rockchip_host.bus_scan_delay=1500

After that dmesg shows:

[    7.574441] rockchip-pcie f8000000.pcie: wait 1500 ms (from command-line) before bus scan