DietPi icon indicating copy to clipboard operation
DietPi copied to clipboard

ROCK64 | No LED device nodes with Linux 6.12

Open sanlupkim opened this issue 6 months ago • 12 comments

Creating a bug report/issue

  • [ x] I have searched the existing open and closed issues

Required Information

  • DietPi version | cat /boot/dietpi/.version G_DIETPI_VERSION_CORE=9 G_DIETPI_VERSION_SUB=14 G_DIETPI_VERSION_RC=2 G_GITBRANCH='master' G_GITOWNER='MichaIng' G_LIVE_PATCH_STATUS[0]='applied'
  • Distro version | echo $G_DISTRO_NAME $G_RASPBIAN bookworm
  • Kernel version | uname -a Linux rock64-60 6.12.35-current-rockchip64 #1 SMP PREEMPT Fri Jun 27 10:11:46 UTC 2025 aarch64 GNU/Linux
  • SBC model | echo $G_HW_MODEL_NAME or (EG: RPi3) ROCK64 (aarch64)
  • Power supply used | (EG: 5V 1A RAVpower) Any
  • SD card used | (EG: SanDisk ultra) SanDisk 32G

Additional Information (if applicable)

  • Software title | (EG: Nextcloud) headless
  • Was the software title installed freshly or updated/migrated? upgrade from 9.12 to 9.14.2
  • Can this issue be replicated on a fresh installation of DietPi? Yes, it's kernel related (?)
  • Bug report ID | echo $G_HW_UUID

Steps to reproduce

Run kernel 6.12. On 6.6.5 leds (red and white) working. krernel 6.6.5:

ls -l /sys/class/leds/
total 0
lrwxrwxrwx 1 root root 0 Jan 21  2016 led-0 -> ../../devices/platform/leds/leds/led-0
lrwxrwxrwx 1 root root 0 Jan 21  2016 led-1 -> ../../devices/platform/leds/leds/led-1

krernel 6.12.35: directory empty. No dir /sys/devices/platform/leds/leds/

Expected behaviour

during kernel boot red blinking (heartbeat), white led - blinking when read/write on SD card.

Actual behaviour

red and white led constantly on. directory /sys/class/leds/ is empty No directory /sys/devices/platform/leds/leds/

Extra details

dmesg error: [ 20.703474] platform leds: deferred probe pending: leds-gpio: Failed to get GPIO '/leds/led-0'

sanlupkim avatar Jul 09 '25 08:07 sanlupkim

Many thanks for your reports. I will have a look next dev cycle. Sources to look at:

  • Mainline Linux 6.12 device tree: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/arch/arm64/boot/dts/rockchip/rk3328-rock64.dts?h=linux-6.12.y (the LEDs are defined there)
  • Mainline Linux 6.6 device tree: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/arch/arm64/boot/dts/rockchip/rk3328-rock64.dts?h=linux-6.6.y
  • Armbian patches for Linux 6.12: https://github.com/armbian/build/tree/main/patch/kernel/archive/rockchip64-6.12
  • Armbian patches for Linux 6.6: https://github.com/armbian/build/tree/main/patch/kernel/archive/rockchip64-6.6

MichaIng avatar Jul 28 '25 12:07 MichaIng

I've check latest armbian distro (trixie) with edge-kernels. The conclusion is that bug appeared in 6.12 kernel:

  • Linux rock64 6.11.0-edge-rockchip64 #1 SMP PREEMPT Sun Sep 15 14:57:56 UTC 2024 aarch64 GNU/Linux - leds OK
  • Linux rock64 6.12.11-current-rockchip64 #1 SMP PREEMPT Thu Jan 23 16:23:05 UTC 2025 - leds NOT working
  • latest edge kernel - 6.16.4-edge-rockchip64 - sitll NOT working with message kernel: platform leds: deferred probe pending: leds-gpio: Failed to get GPIO '/leds/led-0' HTH

sanlupkim avatar Sep 13 '25 09:09 sanlupkim

Since I expect LED nodes at a different path, is this empty as well?

ls -l /sys/class/leds/

And do the device tree nodes exist?

ls -l /proc/device-tree/leds/

MichaIng avatar Sep 13 '25 12:09 MichaIng

On kernel > 6.11 /sys/class/leds/ is empty. /proc/device-tree/leds/ exist and looks like no difference between 6.11 and 6.12, i.e.:

 cat /proc/device-tree/leds/led-1/linux,default-trigger
 heartbeat

sanlupkim avatar Sep 13 '25 14:09 sanlupkim

So the device tree nodes exist, associated with a driver via compatible = "gpio-leds"; the same way like on most other SBCs, but the driver fails to set up the sysfs nodes. You pasted a related kernel error:

[ 20.703474] platform leds: deferred probe pending: leds-gpio: Failed to get GPIO '/leds/led-0'

It menions led-0 while you showed the device tree node led-1 only. Does /proc/device-tree/leds/led-0 exist as well and have the expected mmc0 default trigger?

MichaIng avatar Sep 13 '25 15:09 MichaIng

Oh ,sorry led-1 was a example. led-0 also exist and has mmc0 trigger.

# ls -l /proc/device-tree/leds/
total 0
-r--r--r-- 1 root root 10 Sep 13 16:14 compatible
drwxr-xr-x 2 root root  0 Sep 13 16:14 led-0
drwxr-xr-x 2 root root  0 Sep 13 16:14 led-1
-r--r--r-- 1 root root  5 Sep 13 16:14 name

sanlupkim avatar Sep 13 '25 16:09 sanlupkim

Let's see what happens if we disable led-0, since there was no error for led-1:

sudo apt install device-tree-compiler
sudo mkdir -p /boot/overlay-user
cat << '_EOF_' | sudo tee /boot/overlay-user/disable-led-1.dtso > /dev/null
/dts-v1/;
/plugin/;
/ {
	fragment@0 {
		target = <&power_led>;
		__overlay__ {
			status = "disabled";
		};
	};
};
_EOF_
sudo dtc -I dts -O dtb -o /boot/overlay-user/disable-led-1.dtbo /boot/overlay-user/disable-led-1.dtso
G_SUDO G_CONFIG_INJECT 'user_overlays=' 'user_overlays=disable-led-1' /boot/dietpiEnv.txt

MichaIng avatar Sep 13 '25 17:09 MichaIng

(You mean apt install device-tree-compiler.)

Now error is about led-1: [ 22.756108] platform leds: deferred probe pending: leds-gpio: Failed to get GPIO '/leds/led-1'

sanlupkim avatar Sep 13 '25 18:09 sanlupkim

Now error is about led-1:

:( okay, "failed to get GPIO" sounds like something with the gpios properties is wrong.

leds {
	compatible = "gpio-leds";

	power_led: led-0 {
		gpios = <&rk805 1 GPIO_ACTIVE_LOW>;
		linux,default-trigger = "mmc0";
	};

	standby_led: led-1 {
		gpios = <&rk805 0 GPIO_ACTIVE_LOW>;
		linux,default-trigger = "heartbeat";
	};
};

Many other RK3328 SBCs use other GPIO nodes/banks (one of these: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/arch/arm64/boot/dts/rockchip/rk3328.dtsi?h=linux-6.12.y#n1109) and define pinctrl-0 as well. But some do the same: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts?h=linux-6.12.y#n92

The rk805 node has the gpio-controller property as well, so formally all correct, and a question about it is actually wired. But nothing in all these regards changed within the last years in the device tree, also not the parent SoC one.

MichaIng avatar Sep 13 '25 19:09 MichaIng

Does the rk805 node exist, actually?

ls -l /proc/device-tree/i2c@ff160000/pmic@18

MichaIng avatar Sep 13 '25 19:09 MichaIng

Yes, it is

# ls -l /proc/device-tree/i2c@ff160000/pmic@18
total 0
-r--r--r-- 1 root root  4 Sep 13 21:44 '#clock-cells'
-r--r--r-- 1 root root  4 Sep 13 21:44 '#gpio-cells'
-r--r--r-- 1 root root 21 Sep 13 21:44  clock-output-names
-r--r--r-- 1 root root 15 Sep 13 21:44  compatible
-r--r--r-- 1 root root  0 Sep 13 21:44  gpio-controller
-r--r--r-- 1 root root  4 Sep 13 21:44  interrupt-parent
-r--r--r-- 1 root root  8 Sep 13 21:44  interrupts
-r--r--r-- 1 root root  5 Sep 13 21:44  name
-r--r--r-- 1 root root  4 Sep 13 21:44  phandle
-r--r--r-- 1 root root  4 Sep 13 21:44  pinctrl-0
-r--r--r-- 1 root root  8 Sep 13 21:44  pinctrl-names
-r--r--r-- 1 root root  4 Sep 13 21:44  reg
drwxr-xr-x 9 root root  0 Sep 13 21:44  regulators
-r--r--r-- 1 root root  0 Sep 13 21:44  rockchip,system-power-controller
-r--r--r-- 1 root root  4 Sep 13 21:44  vcc1-supply
-r--r--r-- 1 root root  4 Sep 13 21:44  vcc2-supply
-r--r--r-- 1 root root  4 Sep 13 21:44  vcc3-supply
-r--r--r-- 1 root root  4 Sep 13 21:44  vcc4-supply
-r--r--r-- 1 root root  4 Sep 13 21:44  vcc5-supply
-r--r--r-- 1 root root  4 Sep 13 21:44  vcc6-supply
-r--r--r-- 1 root root  0 Sep 13 21:44  wakeup-source

sanlupkim avatar Sep 13 '25 19:09 sanlupkim

Problem could be related to rk80x I found some differences. On 6.12 (led NOT working) there IS directory /sys/devices/virtual/devlink/i2c:1-0018--platform:leds:

ls -1 /sys/devices/virtual/devlink/
i2c:1-0018--platform:ff100000.syscon:io-domains
i2c:1-0018--platform:ff300000.gpu
i2c:1-0018--platform:ff3c0000.hdmi
i2c:1-0018--platform:ff520000.mmc
i2c:1-0018--platform:ff540000.ethernet
i2c:1-0018--platform:leds
i2c:1-0018--platform:sdmmc-regulator

On kernel 6.11 there are lines in dmesg:

[    2.549651] rk808-regulator rk808-regulator.2.auto: there is no dvs0 gpio
[    2.550368] rk808-regulator rk808-regulator.2.auto: there is no dvs1 gpio
[    2.551003] rk808-regulator rk808-regulator.2.auto: max buck steps per change: 8

sanlupkim avatar Oct 09 '25 13:10 sanlupkim