How to disable /deg/watchdog on TX2 after i opened it

I use /dev/watchdog in my demo on TX2 board.i open /dev/watchdog,and use ioctl(wdt_fd,WDIOC_KEEPALIVE,NULL) to keep it alive,in some time i want to use close(wdt_fd) to disable watchdog,but failed, the board restart because of dog can i disable watchdog after it working??

Have a try below command.

echo 1 > /sys/kernel/debug/30c0000.watchdog/disable_dbg_reset
echo 1 > /sys/kernel/debug/30c0000.watchdog/disable_por_reset

does any other ioctl cmd work for disabling watchdog in user space??,like ioctl(wdt_fd,WDIOC_KEEPALIVE,NULL)

30c0000 is the watchdog register ? which user guide tells the register?

there is two watchdog device in /dev/ directory. there name are /dev/watchdog and /dev/watchdog0,30c0000.watchdog refers to which watchdog??

i enter this two cmd ,but tells permission denied ,i add sudo ,permission denied again.

Have a reference to below reference code. [ioctl(fd, WDIOC_SETOPTIONS, &flags);]
The WDIOC_KEEPALIVE need ping it in every 120ms.

i reffered this code 2 days ago,but i failed , and i have tryed WDIOS_DISBALECARD options for ioctl(fd, WDIOC_SETOPTIONS, WDIOS_DISBALECARD) reffered in the source code ;it also tells disabe wdtfailed . so i finally look for help on this forum.
i have no idea.
does any other way work???

Can set the timetimer?

i can use ioctl(fd, WDIOC_SETTIMEOUT, &timeout) and then ioctl(fd, WDIOC_GETTIMEOUT, &timeout) to get the timeout value,and it worked, but the cmd ioctl(fd, WDIOC_SETOPTIONS, WDIOS_DISBALECARD) for disabling wdt failed.
i have no idea .can you help me ??

in a reference document,i get some information below: some of the drivers support the configuration option “Disable watchdog shutdown on close”, CONFIG_WATCHDOG_NOWAYOUT. If it is set to Y when compiling the kernel, there is no way of disabling the watchdog once
it has been started.
so i guess nividia kernel build parameter for watchdog nowayout is Y.

Good catch, have modify the …/kernel/kernel-4.9/arch/arm64/configs/tegra_defconfig to rebuild the kernel Image for it. Otherwise I would suggest to set the timeout as large as possible as WAR.

can you tell me the absolute path of tegra_defconfig on TX2 board,and detailed steps to rebuild kernel image on TX2 board,and how to use the built image? any user guide or documents?

Have a check below doc.

Tip: tegra_defconfig is within the kernel source (explained in the document @ShaneCCC referenced). On a running Jetson this is almost an exact match to “/proc/config.gz”.

1 Like

hi ,in this document, the steps including first obtaining,and buildind and so on,this steps are on TX2 board or on host pc?

On host ubuntu PC.