forked from raspberrypi/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
firmware/raspberrypi: Add a get_throttled sysfs file
Under-voltage due to inadequate power supplies is a recurring problem for new Raspberry Pi users. There are visual indications that an under-voltage situation is occuring like blinking power led and a lightning icon on the desktop (not shown when using the vc4 driver), but for new users it's not obvious that this signifies a critical situation. This patch provides a twofold improvement to the situation: Firstly it logs under-voltage events to the kernel log. This provides information also for headless installations. Secondly it provides a sysfs file to read the value. This improves on 'vcgencmd' by providing change notification. Userspace can poll on the file and be notified of changes to the value. A script can poll the file and use dbus notification to put a windows on the desktop with information about the severity with a recommendation to change the power supply. A link to more information can also be provided. Only changes to the sticky bits are reported (cleared between readings). Signed-off-by: Noralf Trønnes <noralf@tronnes.org> Prevent voltage low warnings from filling log Although the correct fix for low voltage warnings is to improve the power supply, the current implementation of the detection can fill the log if the warning happens freqently. This replaces the logging with slightly custom ratelimited logging. Signed-off-by: James Hughes <james.hughes@raspberrypi.org> Reduce log spam when mailbox call not implemented This changes the logging message when a mailbox call fails to the dev_dbg level. In addition, it fixes the low voltage detection logging code so that if the mailbox call doies fails, it logs at error level and flags so the call is no longer attempted. Signed-off-by: James Hughes <james.hughes@raspberrypi.org>
- Loading branch information
1 parent
fb710b6
commit e460b56
Showing
1 changed file
with
160 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters