Open svpcom opened 11 months ago
How are Ubuntu and the WRTs working? Different DTBs?
I have the r5s booting with both Samsung and Crucial NVMe using the upstream debian kernel, v 6.1.0-23 in this case:
stock debian:
$ uname -a
Linux deb-nanopi-r5s 6.1.0-23-arm64 #1 SMP Debian 6.1.99-1 (2024-07-15) aarch64 GNU/Linux
OpenWRT is not available in a release, just overnight builds which are based off of the 6.6.43 kernel:
nightly OpenWRT:
# uname -a
Linux owrt-nanopi-r5s 6.6.43 #0 SMP PREEMPT Sun Jul 28 17:51:47 2024 aarch64 GNU/Linux
My guess is that your Sandisk NVMe works better with a more recent kernel?
To test this theory, you could try a later debian kernel: https://packages.debian.org/sid/kernel/linux-image-arm64
wget http://ftp.us.debian.org/debian/pool/main/l/linux-signed-arm64/linux-image-6.9.12-arm64_6.9.12-1_arm64.deb
sudo dpkg -i linux-image-6.9.12-arm64_6.9.12-1_arm64.deb
So just to clarify, boot with your latest image from SD and wget that sid kernel? After dpkg installs it, will the SD boot that kernel automatically?
(I booted from the MMC to Ubuntu just to see, but there is nothing in /boot)
My guess is that your Sandisk NVMe works better with a more recent kernel?
Surely FriendlyWrt and Ubuntu Focal aren't using such a recent kernel though?
Yes, my assumption is that you are booting from MMC and trying to access your installed Sandisk NVMe.
wget https://github.com/inindev/debian-image/releases/download/v12.6/nanopi-r5s_bookworm-12.6.img.xz
sudo su
xzcat nanopi-r5s_bookworm-12.6.img.xz > /dev/sdX
Then install this MMC and boot from it.
ll /dev/nvme*
crw------- 1 root root 235, 0 Aug 3 03:53 /dev/nvme0
brw-rw---- 1 root disk 259, 0 Aug 3 03:53 /dev/nvme0n1
brw-rw---- 1 root disk 259, 1 Aug 3 03:53 /dev/nvme0n1p1
I am unsure why you are getting this:
pci 0002:01:00.0: calc_l12_pwron: Invalid T_PwrOn scale: 3
pci 0002:01:00.0: BAR0: error updating (0xf0200004 != 0xffffffff)
pci 0002:01:00.0: BAR0: error updating (high 0x00000000 != 0xffffffff)
pci 0002:01:00.0: BAR4: error updating (0xf0204004 != 0xffffffff)
pci 0002:01:00.0: BAR4: error updating (high 0x00000000 != 0xffffffff)
I am booting your Debian image from an SD card, but have Ubuntu (FriendlyCore) on the internal eMMC
I just installed that 6.9 kernel and again, the NVMe was initialised, but when I removed the pcie_aspm=off from the boot flags, it was no longer initialised, even with the 6.9 kernel.
Yeah, Google doesn't have much regarding that T_PwrOn error. Again strange how those other two OSes can initialise it OK
EDIT: just FYI, my NVMe is actually WD Blue SN570 500GB with firmware 234110WD, shown by cat /sys/class/nvme/nvme0/model and cat /sys/class/nvme/nvme0/firmware_rev, which I see is the same as the SSD you ordered in September :)
I see my post: inindev commented on Sep 24, 2023
I can test the WD Blue again but I wont get a chance to do so for a few days.
Fair enough. I'm curious whether you have the same dmesg output with your WD Blue. I ran a SMART check with nvme-cli which said the drive was OK. The T_PwrOn scale error makes sense given that disabling power management results in a working configuration, but the BAR errors I'm not sure about. Can they be related to power management?
In the mean time, it works; albeit without power management on the PCIe bus.
Thanks for this project too, by the way. Great to have vanilla Debian on this device!
I found my WD Blue NVMe and am now seeing the same thing you are with the stock debian 6.1.0-22-arm64
kernel.
[ 6.192192] pci_bus 0002:00: root bus resource [bus 00-0f]
[ 6.192700] pci_bus 0002:00: root bus resource [io 0x200000-0x2fffff] (bus address [0xf0100000-0xf01fffff])
[ 6.193582] pci_bus 0002:00: root bus resource [mem 0xf0200000-0xf1ffffff]
[ 6.194205] pci_bus 0002:00: root bus resource [mem 0x380000000-0x3bfffffff] (bus address [0x40000000-0x7fffffff])
[ 6.195223] pci 0002:00:00.0: [1d87:3566] type 01 class 0x060400
[ 6.195790] pci 0002:00:00.0: reg 0x10: [mem 0x00000000-0x3fffffff]
[ 6.196366] pci 0002:00:00.0: reg 0x14: [mem 0x00000000-0x3fffffff]
[ 6.196939] pci 0002:00:00.0: reg 0x38: [mem 0x00000000-0x0000ffff pref]
[ 6.197620] pci 0002:00:00.0: supports D1 D2
[ 6.198015] pci 0002:00:00.0: PME# supported from D0 D1 D3hot
[ 6.203456] pci_bus 0002:01: busn_res: can not insert [bus 01-ff] under [bus 00-0f] (conflicts with (null) [bus 00-0f])
[ 6.204719] pci 0002:00:00.0: BAR 0: assigned [mem 0x380000000-0x3bfffffff]
[ 6.205379] pci 0002:00:00.0: BAR 1: no space for [mem size 0x40000000]
[ 6.205982] pci 0002:00:00.0: BAR 1: failed to assign [mem size 0x40000000]
[ 6.206666] pci 0002:00:00.0: BAR 6: assigned [mem 0xf0200000-0xf020ffff pref]
[ 6.207334] pci 0002:00:00.0: PCI bridge to [bus 01-ff]
[ 6.210255] pcieport 0002:00:00.0: PME: Signaling with IRQ 46
[ 6.211405] pcieport 0002:00:00.0: AER: enabled with IRQ 46
I also see that u-boot is initializing this device just fine:
=> nvme info
Device 0: Vendor: 0x15b7 Rev: 234110WD Prod: 23185D807137
Type: Hard Disk
Capacity: 476940.0 MB = 465.7 GB (976773168 x 512)
It looks timing related because a rescan is able to detect it:
# echo 1 > /sys/bus/pci/rescan
[ 561.031428] nvme nvme0: pci function 0002:01:00.0
[ 561.031946] nvme 0002:01:00.0: enabling device (0000 -> 0002)
# ls -al /dev/nvme0
crw------- 1 root root 510, 0 Jun 16 10:18 /dev/nvme0
followed by a failure a short time later:
[ 621.553113] nvme nvme0: I/O 8 QID 0 timeout, disable controller
[ 621.569577] nvme nvme0: Identify Controller failed (-4)
[ 621.570116] nvme nvme0: Removing after probe failure status: -5
I did find this procedure successfully initializes the WD Blue NVMe with the 6.1.0-22-arm64
kernel:
# echo 1 > /sys/bus/pci/devices/0002\:00\:00.0/remove
# echo 1 > /sys/bus/pci/rescan
Though it is not a solution, it does point to an initialization issue during boot.
After boot no NVME devices found. If I trigger pci rescan via
echo 1 > /sys/bus/pci/rescan
NVMe device is found but non-functional:NVME device is WD Red SN700