How to enable Watchdog

4 10020
How can i enable the watchdog?
Whats the name of the watchdog driver?  (like bcm2708_wdog for the Raspi)

Not really a beginners subject but I think I have succeeded...

The watchdog for A20 is not enabled in the kernel configuration. It is only enabled for sun4i ad sun5i devices although the same code would be working for sun7i (A20). To have the option showing in the kernel's menuconfig you have to modify drivers/watchdog/Kconfig so that the "sunxi" section looks like this:
  1. config SUNXI_WDT
  2.         tristate "Allwinner A10/A13/A20 Watchdog"
  3.         depends on ARCH_SUN4I || ARCH_SUN5I || ARCH_SUN7I
  4.         help
  5.           This is the driver for the hardware watchdog on the Allwinner
  6.           A10/A13/A20 processors.

  7.           If you have one of these processors and wish to have
  8.           watchdog support enabled, say Y, otherwise say N.

  9.           To compile this driver as a module, choose M here: the
  10.           module will be called sunxi_wdt.
Copy the Code
Then in menuconfig's "Device Drivers/Watchdog Timer Support" enable Allwinner A10/A13/A20 Watchdog as a module. You must have "Watchdog Timer Driver core" enabled first

This will compile sunxi_wdt module and create kernel/drivers/watchdog/sunxi_wdt.ko in the modules library.

Now to have it working on your Banana-Pi you have to tell it to load the module by adding "sunxi_wdt" at the bottom of the /etc/modules file

You can load it immediately with sudo modprobe sunxi_wdt. It will create the device /dev/watchdog.

You also need to install the watchdog daemon:
sudo apt-get install sysv-rc <- this one should be already installed
sudo apt-get install watchdog

Then in /etc/watchdog.conf
watchdog-timeout=20 (time in seconds before the watchdog resets the system after unresponsive attempt )

How did I try this:

well unfortunately my system goes into kernel panic whenever the memory is under too much stress (well at least I think so). I use an application called dvblast that is quite good at putting the kernel into panic after a while. Before enabling the watchdog the Banana just stopped waiting for me to hard reset it. Now I could verify that it restarts by itself in the same situation.

Even easier method to cause kernel panic:
echo c | sudo tee /proc/sysrq-trigger
Generally you might have to do "echo 1 | sudo tee /proc/sys/kernel/sysrq" before although it is already set on the Banana-Pi

Thanks for your work, f4exb.

I followed your instructions to modify the kernerl and the watchdog works for me on kernel panic like you described and (after adding max-load-1 = 30 to watchdog.conf) on high CPU load for some time, too.

What I'm just facing is, that the Banana would halt instead of reboot when the watchdog punches in (almost every twice reboots on fork bomb but very rare on kernel panic). I have to disconnect and reconnect the PSU to get it boot again.  Has anybody faced something similar and maybe got a solution?

Thx to f4exb - nice to know it works - but for a newbie.....

Raspberry Pi: It took 1 minute to activate and  test watchdog  

Banana Pi: -> I need to compile a module....??? For me - no idea how to do with Rasbian 3.1.

I only want to replace my Raspi because of the 100Mbit LAN Limit.
If someone can help or send a step by step instructions -> Thx!

You have to log in before you can reply Login | Sign Up

Points Rules