-
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
firmware/raspberrypi: Add a get_throttled sysfs file #2397
Conversation
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>
pr_info("Voltage normalised (0x%08x)\n", *value); | ||
} | ||
|
||
sysfs_notify(&fw->cl.dev->kobj, NULL, "get_throttled"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know the polling rate is very low so the answer is largely moot, but is there a reason for waking any waiters regardless of whether the state has changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only reach this if there are changes, see a couple of lines up:
if (new_sticky == old_sticky)
return 0;
No objections. |
kernel: Fix GCC 6.4.0 and 7.3.0 warnings See: raspberrypi/linux#2413 kernel: audioinjector-octo: Add continuous clock feature See: raspberrypi/linux#2409 kernel: overlays: Add 'upstream' overlay See: raspberrypi/linux#2393 kernel: overlays: Add overlay for PiBell soundcard See: https://www.raspberrypi.org/forums/viewtopic.php?f=44&t=99784&p=1279490#p1278971 kernel: Removing (broken) RaspiDac3 support kernel: i2c: bcm2835: Set up the rising/falling edge delays See: raspberrypi/linux#2407 kernel: overlays: Add updated mmc1 alias to sdio overlays kernel: config: Enable CONFIG_GPIO_MOCKUP module See: raspberrypi/linux#2410 kernel: overlays: Rework sdio overlays to allow polling See: raspberrypi/linux#2401 kernel: firmware/raspberrypi: Add a get_throttled sysfs file See: raspberrypi/linux#2397 firmware: dtoverlay: Also allow fragment-<n> in overlays firmware: i2c_gpio: Optimise and run clients faster
kernel: Fix GCC 6.4.0 and 7.3.0 warnings See: raspberrypi/linux#2413 kernel: audioinjector-octo: Add continuous clock feature See: raspberrypi/linux#2409 kernel: overlays: Add 'upstream' overlay See: raspberrypi/linux#2393 kernel: overlays: Add overlay for PiBell soundcard See: https://www.raspberrypi.org/forums/viewtopic.php?f=44&t=99784&p=1279490#p1278971 kernel: Removing (broken) RaspiDac3 support kernel: i2c: bcm2835: Set up the rising/falling edge delays See: raspberrypi/linux#2407 kernel: overlays: Add updated mmc1 alias to sdio overlays kernel: config: Enable CONFIG_GPIO_MOCKUP module See: raspberrypi/linux#2410 kernel: overlays: Rework sdio overlays to allow polling See: raspberrypi/linux#2401 kernel: firmware/raspberrypi: Add a get_throttled sysfs file See: raspberrypi/linux#2397 firmware: dtoverlay: Also allow fragment-<n> in overlays firmware: i2c_gpio: Optimise and run clients faster
I compiled the last kernel 4.14.27 and since then I have the following message in loop in the kern.log vcgencmd measure_temp; vcgencmd get_throttled; vcgencmd measure_temp I have the problem on my Pi Zero and Pi 2 How to stop this message ? |
Answered elsewhere. |
I am using kernel "4.19.122-1-osmc" in a Raspberry Pi 3B+ Rev 1.3. The file "/sys/devices/platform/soc/soc:firmware/get_throttled" exists, but it always returns zero:
More details in https://discourse.osmc.tv/t/sys-devices-platform-soc-soc-firmware-get-throttled-not-working/86639 |
This is a result of the discussion in #2367.
Kernel log:
A simple script that polls on the sysfs file and shows the changes:
A simple proof of concept for desktop notification:
dbus notification daemon (supports cancelling notifications):