Clearification on imx8mp watchdog.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Clearification on imx8mp watchdog.

Jump to solution
1,070 Views
ababatola
Contributor III

Hi,

I would like to test my i.mx8mp hardware watchdog and I need a clarification on this.

The command 

         echo 'V' > /dev/watchdog

disables he watchdog?  Which means that the watchdog is no longer working.

After executing this command and them I enter the below command 

         cat >> /dev/watchdog

The watchdog operates as expected and resets the system.

My understanding is that if the watchdog is disabled, the above command should not lead to a reset unless the watchdog is enabled back.

Also after the 

echo 'V' > /dev/watchdog

command the watchdog daemon is still working.  This is an extract from my shell

~ # echo 'V' > /dev/watchdog
~ # ps -e | grep watchdogd
81 root [watchdogd]
330 root grep watchdogd

Is this behaviour correct?

Thanks

 

 

 

0 Kudos
Reply
1 Solution
1,047 Views
JorgeCas
NXP TechSupport
NXP TechSupport

Hello,

I hope you are doing well.

According to the Kernel documentation that is called the 'Magic Close' feature:

If a driver supports "Magic Close", the driver will not disable the watchdog unless a specific magic character 'V' has been sent to /dev/watchdog just before closing the file. If the userspace daemon closes the file without sending this special character, the driver will assume that the daemon (and userspace in general) died, and will stop pinging the watchdog without disabling it first. This will then cause a reboot if the watchdog is not re-opened in sufficient time.

And according to the i.MX Linux reference manual:

After the WDOG timer is activated, it must be serviced by software on a periodic basis and the watchdog module cannot be deactivated after it is activated.

Best regards.

Jorge.

View solution in original post

0 Kudos
Reply
2 Replies
1,048 Views
JorgeCas
NXP TechSupport
NXP TechSupport

Hello,

I hope you are doing well.

According to the Kernel documentation that is called the 'Magic Close' feature:

If a driver supports "Magic Close", the driver will not disable the watchdog unless a specific magic character 'V' has been sent to /dev/watchdog just before closing the file. If the userspace daemon closes the file without sending this special character, the driver will assume that the daemon (and userspace in general) died, and will stop pinging the watchdog without disabling it first. This will then cause a reboot if the watchdog is not re-opened in sufficient time.

And according to the i.MX Linux reference manual:

After the WDOG timer is activated, it must be serviced by software on a periodic basis and the watchdog module cannot be deactivated after it is activated.

Best regards.

Jorge.

0 Kudos
Reply
991 Views
ababatola
Contributor III

hi,

I exported the watchdog timer to the sysfs, however only watchdog0 was exported to the userspace and not watchdog.  He is the output from my linux terminal

~ # ls /dev/watch*
/dev/watchdog dev/watchdog0
~ # ls /sys/class/watch*
watchdog0

Why is the watchdog not exported to the sysfs so that I can inspect the parameters of the watchdog timer.

Thanks

 

0 Kudos
Reply