watchdog: bcm2835: Clamp timeouts to the h/w max#7432
Merged
Conversation
The kernel watchdog framework permits arbitrarily large timeout values to be requested; if the request exceeds the maximum interval supported by the hardware, the kernel's watchdogd thread automatically pings the hardware to keep it alive until the time remaining until the expected reset fits within the hardware's registers. Although each watchdog driver reports the largest timeout, the onus is on them to limit the value passed in: Drivers implementing max_hw_heartbeat_ms set the hardware watchdog heartbeat to the minimum of timeout and max_hw_heartbeat_ms. bcm2835_wdt instead masks off the high bits of the counter, meaning that the actual time until the device resets is (requested_time % 16). This was spotted when the requested timeout was 1 minute, giving an actual timeout of 12 seconds, but a requested 100 seconds becomes 4 seconds. Correct bcm2835_wdt_start to implement the expected behaviour. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
timg236
approved these changes
Jun 11, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The kernel watchdog framework permits arbitrarily large timeout values to be requested; if the request exceeds the maximum interval supported by the hardware, the kernel's watchdogd thread automatically pings the hardware to keep it alive until the time remaining until the expected reset fits within the hardware's registers. Although each watchdog driver reports the largest timeout, the onus is on them to limit the value passed in:
Drivers implementing max_hw_heartbeat_ms set the hardware watchdog
heartbeat to the minimum of timeout and max_hw_heartbeat_ms.
bcm2835_wdt instead masks off the high bits of the counter, meaning that the actual time until the device resets is (requested_time % 16). This was spotted when the requested timeout was 1 minute, giving an actual timeout of 12 seconds, but a requested 100 seconds becomes 4 seconds.
Correct bcm2835_wdt_start to implement the expected behaviour.