Skip to content
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

watchdog: bcm2835_wdt: Fix WDIOC_SETTIMEOUT handling #5838

Merged
merged 1 commit into from
Jan 10, 2024

Conversation

popcornmix
Copy link
Collaborator

Users report about the unexpected behavior for setting timeouts above 15 sec on Raspberry Pi. According to watchdog-api.rst the ioctl WDIOC_SETTIMEOUT shouldn't fail because of hardware limitations. But looking at the code shows that max_timeout based on the register value PM_WDOG_TIME_SET, which is the maximum.

Since 664a392 ("watchdog: Introduce hardware maximum heartbeat in watchdog core") the watchdog core is able to handle this problem.

This fix has been tested with watchdog-test from selftests.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=217374
Fixes: 664a392 ("watchdog: Introduce hardware maximum heartbeat in watchdog core")

Users report about the unexpected behavior for setting timeouts above
15 sec on Raspberry Pi. According to watchdog-api.rst the ioctl
WDIOC_SETTIMEOUT shouldn't fail because of hardware limitations.
But looking at the code shows that max_timeout based on the
register value PM_WDOG_TIME_SET, which is the maximum.

Since 664a392 ("watchdog: Introduce hardware maximum heartbeat
in watchdog core") the watchdog core is able to handle this problem.

This fix has been tested with watchdog-test from selftests.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=217374
Fixes: 664a392 ("watchdog: Introduce hardware maximum heartbeat in watchdog core")
Signed-off-by: Stefan Wahren <[email protected]>
@popcornmix
Copy link
Collaborator Author

See: https://lore.kernel.org/linux-watchdog/[email protected]/T/

Ping @lategoodbye

This is a simpler alternative to #5664
to get longer watchdog timeouts.

In testing this works fine, with, say 120s timeout (longer than the single-shot 15s duration of watchdog hardware).

@lategoodbye
Copy link
Contributor

lategoodbye commented Jan 8, 2024

Not sure what's the intension of the ping, but my mainline patch has been applied for watchdog-next. So the patch will be in Linux 6.8 and then hopefully backported. Some subsystems need a lot of time.

@pelwell pelwell merged commit c36d34b into rpi-6.6.y Jan 10, 2024
11 of 12 checks passed
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Jan 10, 2024
kernel: ARM: dts: bcm2712-rpi-5-b: Add eth_ledx parameters
See: raspberrypi/linux#5826

kernel: ARM: dts: bcm2712-rpi-5-b: Add fan speed dtparams
See: raspberrypi/linux#5822

kernel: drm/vc4: don't check if plane->state->fb == state->fb
See: raspberrypi/linux#5832

kernel: spi: bcm2835: Support spi0-0cs and SPI_NO_CS mode
See: raspberrypi/linux#5837

kernel: Add link freq Control for IMX519 and Arducam64MP
See: raspberrypi/linux#5841

kernel: watchdog: bcm2835_wdt: Fix WDIOC_SETTIMEOUT handling
See: raspberrypi/linux#5838
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Jan 10, 2024
kernel: ARM: dts: bcm2712-rpi-5-b: Add eth_ledx parameters
See: raspberrypi/linux#5826

kernel: ARM: dts: bcm2712-rpi-5-b: Add fan speed dtparams
See: raspberrypi/linux#5822

kernel: drm/vc4: don't check if plane->state->fb == state->fb
See: raspberrypi/linux#5832

kernel: spi: bcm2835: Support spi0-0cs and SPI_NO_CS mode
See: raspberrypi/linux#5837

kernel: Add link freq Control for IMX519 and Arducam64MP
See: raspberrypi/linux#5841

kernel: watchdog: bcm2835_wdt: Fix WDIOC_SETTIMEOUT handling
See: raspberrypi/linux#5838
@lategoodbye
Copy link
Contributor

FWIW the original patch is now in Mainline stable: 6.1.75 / 6.6.14

@popcornmix popcornmix deleted the watchdog_longer branch January 26, 2024 17:33
@popcornmix
Copy link
Collaborator Author

Great - I'll drop cherry-picked commit on next update.

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.

3 participants