RPi - watchdogd not working anymore (since r273154+)

Ian Lepore ian at FreeBSD.org
Wed Dec 10 04:25:01 UTC 2014


On Wed, 2014-12-10 at 03:43 +0100, Andreas Schwarz wrote:
> Hi,
> I run into a problem with the watchdogd, which seems not  to be able to trigger the 
> hardware watchdog (bcmwd0: <BCM2708/2835 Watchdog>). When enabling watchdogd, 
> the system reboot after a few seconds (my last build, where the watchdog working
> correctly, was r273154).
> 
> Any ideas? Something must be changed.
> 
> You can easily check with : 
> 
>   /etc/rc.d/watchdogd onestart
> 
> This will start the watchdogd with default parameters (enabling in /etc/rc.conf is not 
> needed).
> 
> best regards,
> Andreas
> 

This is being caused by a combination of bugs in the rpi watchdog driver
and a recent(ish) change in watchdogd.

watchdogd requests a timeout of approximately 128 seconds.  It used to
pet the dog once per second, and recently it was changed to only do so
once every 10 seconds for efficiency.

The rpi watchdog hardware is unable to set a timeout longer than 15
seconds, but a bug in the driver let the value wrap around then get
bitmasked such that the request for a 128 second timeout was actually
getting handled as a 9 second timeout.  The 9 second thing worked when
we were petting the dog once a second, but now fails at once every 10
seconds.

I've got a fix for the wrapping problem, but all it will do is make the
timer not get set at all if you ask for 128 seconds (that's what the
interface for watchdogs requires, don't set the timer if can't be at
least as long as requested).

To fix your problem you'll need to set watchdogd_flags="-s 4 -t 8" in
your rc.conf.  That will make the timeout 8 seconds and pet the dog
every 4 seconds.  You don't have too many options for the timeout value
(-t) because of the goofy way the timeout is represented in the kernel.
The only choices that work on rpi are 1,2,4,8 seconds.  If you ask for 9
it gets represented as a value that translates to 17.5 seconds and rpi
can't do it.

-- Ian




More information about the freebsd-arm mailing list