Skip to content

watchdog: bcm2835: Clamp timeouts to the h/w max#7432

Merged
pelwell merged 1 commit into
raspberrypi:rpi-6.18.yfrom
pelwell:wdogclamp
Jun 11, 2026
Merged

watchdog: bcm2835: Clamp timeouts to the h/w max#7432
pelwell merged 1 commit into
raspberrypi:rpi-6.18.yfrom
pelwell:wdogclamp

Conversation

@pelwell

@pelwell pelwell commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

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.

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>
@pelwell pelwell merged commit e69f138 into raspberrypi:rpi-6.18.y Jun 11, 2026
12 checks passed
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Jun 16, 2026
See: raspberrypi/linux#7430

kernel: drm/gem-framebuffer: Don't validate buffer size when non-linear
See: raspberrypi/linux#7427

kernel: watchdog: bcm2835: Clamp timeouts to the h/w max
See: raspberrypi/linux#7432

kernel: vc4 hdmi fixes for packet RAM being disabled
See: raspberrypi/linux#7431

kernel: Fixup CFE and Unicam RGB/BGR888 handling
See: raspberrypi/linux#7406

kernel: arm64: errata: Mitigate TLBI errata on various Arm CPUs
See: raspberrypi/linux#7429

kernel: pwm: pio-rp1: don't flag driver as using atomic ops
See: raspberrypi/linux#7439
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Jun 16, 2026
See: raspberrypi/linux#7430

kernel: drm/gem-framebuffer: Don't validate buffer size when non-linear
See: raspberrypi/linux#7427

kernel: watchdog: bcm2835: Clamp timeouts to the h/w max
See: raspberrypi/linux#7432

kernel: vc4 hdmi fixes for packet RAM being disabled
See: raspberrypi/linux#7431

kernel: Fixup CFE and Unicam RGB/BGR888 handling
See: raspberrypi/linux#7406

kernel: arm64: errata: Mitigate TLBI errata on various Arm CPUs
See: raspberrypi/linux#7429

kernel: pwm: pio-rp1: don't flag driver as using atomic ops
See: raspberrypi/linux#7439
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants