Skip to content

led0 brightness file doesn't update after echo/write on kernel 5.10.63-v7+ #4638

@GravelSocks

Description

@GravelSocks

System
Hardware: Raspberry Pi 3B
OS: Raspian 10/Buster
Kernel Version: Linux raspberrypi 5.10.63-v7+ #1459 SMP Wed Oct 6 16:41:10 BST 2021 armv71 GNU/Linux
Firmware: Sep 30 2021 19:22:24
version 51215b4f6e3966401ecd99652a35cf1c25069113
Overlay: default -- not using the led overlay for gpio control

Describe the bug
After the recent kernel update (in the last week or so), /sys/class/leds/led0/brightness (or /sys/devices/platform/leds/leds/led0/brightness) no longer updates properly. I can turn led0 on/off manually with an echo command, but the value in the brightness file doesn't change (or only changes intermittently). The same function on led1 works normally and triggers for both leds are set to none.

To reproduce

  1. set trigger for led0 to none
  2. make /sys/class/leds/led0/brightness writeable. permissions of 666 (or use sudo for echo)
  3. echo 0 > /sys/class/leds/led0/brightness
    -> turns off LED0 (green)
  4. cat /sys/class/leds/led0/brightness
    -> reads back 255 -- brightness value was not updated
    -- or the same thing happens in reverse -- echo 1, light turns on, but value reads back as 0
  5. It seems to update intermittently - maybe every other time I try the command. It is obviously being intercepted because led0 turns on and off. But, the value never gets written to brightness.

Generalized Testing
*The same tests work properly for led1 (red) and brightness is stored and reads properly
*Flushing the output doesn't seem to change the behavior
*Using tee or sudo doesn't seem to change the behavior
*/sys/class/leds/led1/brightness updates properly, as above
*This functionality was working fine on led0 prior to the recent kernel update

Expected behaviour
When echoing 1 to brightness, the led should turn on and brightness should update and cat as 255
When echoing 0 to brightness, the led should turn off and brightness should update and cat as 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions