Disabling watchdog

Hi, I’ve been reading this thread enable watchdog at boot - Toradex Community thoroughly in order to find out how to disable the watchdog. However, @stefan.tx states that is not possible. Uboot does activate PD bit in order to not activate the watchdog after boot has finishes, and then services it using a kernel level timer which any user space application can use.

This is just a confirmation that it cannot be deactivated. Also, if the Tegra watchdog can be used the same way as the VFXX one. I’m not completely sure if both drivers are the same.

Thanks, Álvaro.

This is just a confirmation that it cannot be deactivated.

I don’t see why you claim that but in the referred to thread @stefan.tx clearly answers any and all such questions. What exactly is it that you are not understanding or is not working for you?

Also, if the Tegra watchdog can be used the same way as the VFXX one. I’m not completely sure if both drivers are the same.

As @stefan.tx pointed out in the referred to thread watchdogs are rather SoC specific and the drivers do not have much in common albeit at the end it will go through the same watchdog subsystem of the Linux kernel serviceable via /dev/watchdog from user space. Assuming you did read the watchdog article on our developer website what exactly is it that you are not understanding or is not working for you?

I don’t see why you claim that but in the referred to thread @stefan.tx clearly answers any and all such questions.

http://www.toradex.com/community/comments/7341/view.html:

It seems that Linux is not actually disabling the Watchdog (since that is not possible) but just service it using a kernel level timer

Anyway, it’s possible that I misunderstood @stefan.tx:slight_smile: I’m just interested in knowing how to disable the watchdog accessed in user space (if possible)

Thanks, Álvaro.

You probably want to have a look at the watchdog-api documentation.

Thanks! I’ve added the answer :slight_smile:

As stated in the watchdog-api is as simple as:

int options = WDIOS_DISABLECARD;
ioctl(watchdog_fd, WDIOC_SETOPTIONS, &options);

I guess you have to differentiate whether you talk about the higher level Linux Watchdog API or the actual watchdog hardware.

So in the NXP watchdog case, the hardware watchdog can not be disabled once enabled… The drivers work around is to setup a timer and let the driver handle the watchdog. This driver work around allows to simulate a higher level Watchdog API which allows to “disable” the watchdog.

So from a user perspective: Yes you can disable the Watchdog (the way you noted in your answer).