-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
led0 brightness file doesn't update after echo/write on kernel 5.10.63-v7+ #4638
Comments
3B is different from most other Pis in that its green LED is controlled by the firmware, with a dedicated kernel driver to manage the communications, so the problem might be due to a firmware change. However, the most useful information is the version of the last-known-good firmware+kernel. On this page (https://github.com/raspberrypi/rpi-firmware/commits/master) is a list of software releases that can be installed using the |
Hi - thanks for the quick reply. As in the report above, I think my 3B was fully updated and working properly before the newest release, so the last known good marker should be the latest official release right before the new kernel update. And, there is no trouble controlling the green LED/led0 at the hardware level - that part seems to work OK when I write new values to brightness. The problem seems like it is that the brightness file is not being updated when writing the new value - so OS bug? (unless that value comes from the firmware in real time every time a user opens the brightness file, in which case it would be a firmware/hardware state read-back issue, since the LED is physicially turning on and off immediately when I issue the echo statment). When I issue... echo 0/1 > /sys/class/leds/led0/brightness ...the green LED immediately turns off and on, respectively, on the board (but the brightness file in the OS does not always update). When I issue... echo 0/1 > /sys/class/leds/led1/brightness ...the red LED immediately turns off and on, respectively, and the brightness file always updates/reads back correctly. Anyway, I am happy to try to regress the problem to help. However, before I do that, can someone see if it is reproducible on the dev side on a 3B so that I don't chase my tail for hours with multiple kernel reinstalls in the event that I screwed something else up and didn't realize it? It might be an easy/obvious fix and it should just take a couple of echos and cats on a current system with the 3B plugged in. Thank you for your help! |
I can confirm that I see the same behaviour on a 3B using the latest rpi-update kernel and firmware. 4B is not affected, and neither are 2B and B+, making me think it is due to some interaction with that virtual GPIO driver. |
Having read the driver, I don't see how reading back the brightness can ever have given the expected results consistently. The protocol between the driver and the firmware is designed to guarantee that any "on", however brief, results in the LED being lit for that period (roughly 100ms), but for it then to switched off unless there has been more activity. The |
Note that there is no back channel from the firmware to the driver, making it impossible for the driver to know the actual state of the LED now, but it should be able to return the eventual value assuming there are no more changes. |
The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: #4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Should be fixed by 03ab887, which will be in future kernel builds. |
The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: #4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: #4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Wow! Thanks for the quick response and help! I really appreciate you taking a look at it and doing the fix! Good job! From your review, did you happen to see why this issue didn't affect the red/led1 led? Thanks! |
Both of the LEDs on a 3B are driven by a GPIO expander that is controlled by the firmware from I2C0. The kernel SD/MMC drivers expect to be able drive the green activity LED frequently and rapidly, and we didn't like the idea of a kernel -> firmware -> kernel round trip each time, hence the creation of this special mechanism that decouples the two sides. The red power LED is also controlled remotely by the firmware on behalf of the kernel, but because we didn't think it would be accessed so frequently (and because it is also used to read the low-power detector) it uses the normal synchronous remote GPIO driver, which didn't have the same bug. |
The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: #4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: #4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Ah - very interesting - thanks for the explanation and great job! This fix is extremely helpful for me as a 3B user. And, you just convinced me to buy RPi4 for my home automation system! In case it helps anyone in the future, below is my updated led test code. Sorry for not posting it yesterday - was on my main computer. (If needed on Python 3.7 or earlier, convert match to if/else. And, am very new to Python, so sorry if there are any style issues. I want a semi-colon :'''( ^_^ ) |
Hmm...pasting the python code didn't work very well -- surprising -- here is the file: |
Use three backticks (```) in a row on lines of their own to begin and end chunks of code, like this:
|
Hmm...OK - I originally hit the code tag from the TinyMCE and it just gave me single backticks. So...using the manual backticks...yep...that works. So, the code tag button in the TinyMCE (greater/less than brackets icon) doesn't do the right thing - only generates single backticks.
|
The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: #4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
kernel: ARM: dts: vc4-kms-v3d: Always disable firmware HDMI See: raspberrypi/linux#4652 kernel: media: bcm2835-codec: Limit video callbacks See: raspberrypi/linux#4646 kernel: staging/bcm2835-camera: Add support for H264_MIN_QP, H264_MAX_QP, MPEG_VIDEO_FORCE_KEY_FRAME See: raspberrypi/linux#4647 kernel: bcm2835-isp: Colorspace fixes See: raspberrypi/linux#4643 kernel: Unicam Media Controller support See: raspberrypi/linux#4641 kernel: config: Enable FSFS_FS_SECURITY See: raspberrypi/linux#4637 kernel: gpio: bcm-virt: Fix the get() method See: raspberrypi/linux#4638 firmware: userland: Reduce debug_sym error messages See: https://forums.raspberrypi.com/viewtopic.php?f=98&t=322238 firmware: arm_dt: Increase maximum line length to 98 See: raspberrypi/linux#4638
kernel: ARM: dts: vc4-kms-v3d: Always disable firmware HDMI See: raspberrypi/linux#4652 kernel: media: bcm2835-codec: Limit video callbacks See: raspberrypi/linux#4646 kernel: staging/bcm2835-camera: Add support for H264_MIN_QP, H264_MAX_QP, MPEG_VIDEO_FORCE_KEY_FRAME See: raspberrypi/linux#4647 kernel: bcm2835-isp: Colorspace fixes See: raspberrypi/linux#4643 kernel: Unicam Media Controller support See: raspberrypi/linux#4641 kernel: config: Enable FSFS_FS_SECURITY See: raspberrypi/linux#4637 kernel: gpio: bcm-virt: Fix the get() method See: raspberrypi/linux#4638 firmware: userland: Reduce debug_sym error messages See: https://forums.raspberrypi.com/viewtopic.php?f=98&t=322238 firmware: arm_dt: Increase maximum line length to 98 See: raspberrypi/linux#4638
The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: #4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Thanks for moving this fix forward and congrats on the PiZero 2W! Very cool/sleek! Is there an imminent kernel update on deck, especially considering the new 2W, or is 5.10.76(+) a month or 2 away along the lines of the usual RPi release heartbeat? If still off in the future, I might try kernel building, assuming I can get the sphinx path to work. When there is gravel in your socks, it hurts your feet. ^_^ Also, my 8gb Pi4 B shows up in a few days, so that should distract me for a while (and won't have this bug). I am standing on a giant, flying SoC package singing "A Whole New World" from Aladdin. |
commit 053cdc5dc70c04d3a7ce4849dfd91ee12ee147f4 from https://github.com/raspberrypi/linux.git rpi-5.15.y The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: raspberrypi/linux#4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com> Signed-off-by: Meng Li <Meng.Li@windriver.com>
The stable firmware branch was updated today, and that should be in apt very soon (if it isn't there already). |
Thanks, pelwell! I don't see it yet, but I will look out for it and post the regression verification as soon as the new kernel is available. And, the Pi4 arrives today! w00t! |
Confirmed that the RPi4B does not have this issue on 5.10.63-v7l+ (expected outcome). |
The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: #4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Works great in kernel 5.15.0-v7+ on RPi3B/a02082 and RPi4B! My test program above returns no errors. Thx! It's so helpful to be able to use the system/internal LEDs for debugging! Resolved! |
The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: #4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
commit fc4ca18200d0a884f75c132c9cd3bf9ab9db781e from https://github.com/raspberrypi/linux.git rpi-6.6.y Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. gpio: bcm-virt: Fix the get() method The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: raspberrypi/linux#4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com> Signed-off-by: Rajeshkumar Ramasamy <rajeshkumar.ramasamy@windriver.com>
Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. gpio: bcm-virt: Fix the get() method The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: #4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com> bcm2835-virtgpio: Update for Linux 6.6 The gpio subsystem is happier if the gpiochip is given a parent, and if it doesn't have a fixed base gpio number. While we're in here, use the fact that the firmware node is the parent to locate it, and use the devm_ version of rpi_firmware_get. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. gpio: bcm-virt: Fix the get() method The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: #4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com> bcm2835-virtgpio: Update for Linux 6.6 The gpio subsystem is happier if the gpiochip is given a parent, and if it doesn't have a fixed base gpio number. While we're in here, use the fact that the firmware node is the parent to locate it, and use the devm_ version of rpi_firmware_get. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. gpio: bcm-virt: Fix the get() method The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: #4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com> bcm2835-virtgpio: Update for Linux 6.6 The gpio subsystem is happier if the gpiochip is given a parent, and if it doesn't have a fixed base gpio number. While we're in here, use the fact that the firmware node is the parent to locate it, and use the devm_ version of rpi_firmware_get. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. gpio: bcm-virt: Fix the get() method The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: #4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com> bcm2835-virtgpio: Update for Linux 6.6 The gpio subsystem is happier if the gpiochip is given a parent, and if it doesn't have a fixed base gpio number. While we're in here, use the fact that the firmware node is the parent to locate it, and use the devm_ version of rpi_firmware_get. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. gpio: bcm-virt: Fix the get() method The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: #4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com> bcm2835-virtgpio: Update for Linux 6.6 The gpio subsystem is happier if the gpiochip is given a parent, and if it doesn't have a fixed base gpio number. While we're in here, use the fact that the firmware node is the parent to locate it, and use the devm_ version of rpi_firmware_get. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. gpio: bcm-virt: Fix the get() method The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: #4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com> bcm2835-virtgpio: Update for Linux 6.6 The gpio subsystem is happier if the gpiochip is given a parent, and if it doesn't have a fixed base gpio number. While we're in here, use the fact that the firmware node is the parent to locate it, and use the devm_ version of rpi_firmware_get. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. gpio: bcm-virt: Fix the get() method The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: #4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com> bcm2835-virtgpio: Update for Linux 6.6 The gpio subsystem is happier if the gpiochip is given a parent, and if it doesn't have a fixed base gpio number. While we're in here, use the fact that the firmware node is the parent to locate it, and use the devm_ version of rpi_firmware_get. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. gpio: bcm-virt: Fix the get() method The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: #4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com> bcm2835-virtgpio: Update for Linux 6.6 The gpio subsystem is happier if the gpiochip is given a parent, and if it doesn't have a fixed base gpio number. While we're in here, use the fact that the firmware node is the parent to locate it, and use the devm_ version of rpi_firmware_get. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. gpio: bcm-virt: Fix the get() method The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: #4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com> bcm2835-virtgpio: Update for Linux 6.6 The gpio subsystem is happier if the gpiochip is given a parent, and if it doesn't have a fixed base gpio number. While we're in here, use the fact that the firmware node is the parent to locate it, and use the devm_ version of rpi_firmware_get. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. gpio: bcm-virt: Fix the get() method The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: #4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com> bcm2835-virtgpio: Update for Linux 6.6 The gpio subsystem is happier if the gpiochip is given a parent, and if it doesn't have a fixed base gpio number. While we're in here, use the fact that the firmware node is the parent to locate it, and use the devm_ version of rpi_firmware_get. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. gpio: bcm-virt: Fix the get() method The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: #4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com> bcm2835-virtgpio: Update for Linux 6.6 The gpio subsystem is happier if the gpiochip is given a parent, and if it doesn't have a fixed base gpio number. While we're in here, use the fact that the firmware node is the parent to locate it, and use the devm_ version of rpi_firmware_get. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. gpio: bcm-virt: Fix the get() method The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: #4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com> bcm2835-virtgpio: Update for Linux 6.6 The gpio subsystem is happier if the gpiochip is given a parent, and if it doesn't have a fixed base gpio number. While we're in here, use the fact that the firmware node is the parent to locate it, and use the devm_ version of rpi_firmware_get. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. gpio: bcm-virt: Fix the get() method The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: #4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com> bcm2835-virtgpio: Update for Linux 6.6 The gpio subsystem is happier if the gpiochip is given a parent, and if it doesn't have a fixed base gpio number. While we're in here, use the fact that the firmware node is the parent to locate it, and use the devm_ version of rpi_firmware_get. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. gpio: bcm-virt: Fix the get() method The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: #4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com> bcm2835-virtgpio: Update for Linux 6.6 The gpio subsystem is happier if the gpiochip is given a parent, and if it doesn't have a fixed base gpio number. While we're in here, use the fact that the firmware node is the parent to locate it, and use the devm_ version of rpi_firmware_get. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. gpio: bcm-virt: Fix the get() method The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: #4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com> bcm2835-virtgpio: Update for Linux 6.6 The gpio subsystem is happier if the gpiochip is given a parent, and if it doesn't have a fixed base gpio number. While we're in here, use the fact that the firmware node is the parent to locate it, and use the devm_ version of rpi_firmware_get. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. gpio: bcm-virt: Fix the get() method The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: #4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com> bcm2835-virtgpio: Update for Linux 6.6 The gpio subsystem is happier if the gpiochip is given a parent, and if it doesn't have a fixed base gpio number. While we're in here, use the fact that the firmware node is the parent to locate it, and use the devm_ version of rpi_firmware_get. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. gpio: bcm-virt: Fix the get() method The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: #4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com> bcm2835-virtgpio: Update for Linux 6.6 The gpio subsystem is happier if the gpiochip is given a parent, and if it doesn't have a fixed base gpio number. While we're in here, use the fact that the firmware node is the parent to locate it, and use the devm_ version of rpi_firmware_get. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. gpio: bcm-virt: Fix the get() method The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: #4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com> bcm2835-virtgpio: Update for Linux 6.6 The gpio subsystem is happier if the gpiochip is given a parent, and if it doesn't have a fixed base gpio number. While we're in here, use the fact that the firmware node is the parent to locate it, and use the devm_ version of rpi_firmware_get. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. gpio: bcm-virt: Fix the get() method The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: #4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com> bcm2835-virtgpio: Update for Linux 6.6 The gpio subsystem is happier if the gpiochip is given a parent, and if it doesn't have a fixed base gpio number. While we're in here, use the fact that the firmware node is the parent to locate it, and use the devm_ version of rpi_firmware_get. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. gpio: bcm-virt: Fix the get() method The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: #4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com> bcm2835-virtgpio: Update for Linux 6.6 The gpio subsystem is happier if the gpiochip is given a parent, and if it doesn't have a fixed base gpio number. While we're in here, use the fact that the firmware node is the parent to locate it, and use the devm_ version of rpi_firmware_get. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. gpio: bcm-virt: Fix the get() method The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: #4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com> bcm2835-virtgpio: Update for Linux 6.6 The gpio subsystem is happier if the gpiochip is given a parent, and if it doesn't have a fixed base gpio number. While we're in here, use the fact that the firmware node is the parent to locate it, and use the devm_ version of rpi_firmware_get. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. gpio: bcm-virt: Fix the get() method The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: #4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com> bcm2835-virtgpio: Update for Linux 6.6 The gpio subsystem is happier if the gpiochip is given a parent, and if it doesn't have a fixed base gpio number. While we're in here, use the fact that the firmware node is the parent to locate it, and use the devm_ version of rpi_firmware_get. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. gpio: bcm-virt: Fix the get() method The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: #4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com> bcm2835-virtgpio: Update for Linux 6.6 The gpio subsystem is happier if the gpiochip is given a parent, and if it doesn't have a fixed base gpio number. While we're in here, use the fact that the firmware node is the parent to locate it, and use the devm_ version of rpi_firmware_get. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. gpio: bcm-virt: Fix the get() method The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: #4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com> bcm2835-virtgpio: Update for Linux 6.6 The gpio subsystem is happier if the gpiochip is given a parent, and if it doesn't have a fixed base gpio number. While we're in here, use the fact that the firmware node is the parent to locate it, and use the devm_ version of rpi_firmware_get. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. gpio: bcm-virt: Fix the get() method The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: #4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com> bcm2835-virtgpio: Update for Linux 6.6 The gpio subsystem is happier if the gpiochip is given a parent, and if it doesn't have a fixed base gpio number. While we're in here, use the fact that the firmware node is the parent to locate it, and use the devm_ version of rpi_firmware_get. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. gpio: bcm-virt: Fix the get() method The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: #4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com> bcm2835-virtgpio: Update for Linux 6.6 The gpio subsystem is happier if the gpiochip is given a parent, and if it doesn't have a fixed base gpio number. While we're in here, use the fact that the firmware node is the parent to locate it, and use the devm_ version of rpi_firmware_get. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. gpio: bcm-virt: Fix the get() method The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: #4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com> bcm2835-virtgpio: Update for Linux 6.6 The gpio subsystem is happier if the gpiochip is given a parent, and if it doesn't have a fixed base gpio number. While we're in here, use the fact that the firmware node is the parent to locate it, and use the devm_ version of rpi_firmware_get. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. gpio: bcm-virt: Fix the get() method The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: #4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com> bcm2835-virtgpio: Update for Linux 6.6 The gpio subsystem is happier if the gpiochip is given a parent, and if it doesn't have a fixed base gpio number. While we're in here, use the fact that the firmware node is the parent to locate it, and use the devm_ version of rpi_firmware_get. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. gpio: bcm-virt: Fix the get() method The get() method does not understand the on-the-wire encoding of the remote GPIO states, thinking they are simple on/off bits when they are really pairs of 16-bit counts. Rewrite the get() handler to return the value last written, which will eventually match the actual GPIO state if there are no other changes. See: #4638 Signed-off-by: Phil Elwell <phil@raspberrypi.com> bcm2835-virtgpio: Update for Linux 6.6 The gpio subsystem is happier if the gpiochip is given a parent, and if it doesn't have a fixed base gpio number. While we're in here, use the fact that the firmware node is the parent to locate it, and use the devm_ version of rpi_firmware_get. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
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
-> turns off LED0 (green)
-> 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
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
The text was updated successfully, but these errors were encountered: