Re: [PATCH] selftests: watchdog: Add optional file argument

From: Eugeniu Rosca
Date: Thu Aug 29 2019 - 11:29:05 EST


On Thu, Aug 29, 2019 at 04:38:14PM +0200, Eugeniu Rosca wrote:
> Hi George,
>
> On Thu, Aug 29, 2019 at 12:39:25AM -0400, George G. Davis wrote:
> > Some systems have multiple watchdog devices where the first device
> > registered is assigned to the /dev/watchdog device file.
>
> Confirmed on R-Car H3-Salvator-X:
>
> root@rcar-gen3:~# ls -al /dev/watchdog*
> crw------- 1 root root 10, 130 Aug 21 09:38 /dev/watchdog
> crw------- 1 root root 247, 0 Aug 21 09:38 /dev/watchdog0

Based on [1], I think this patch is actually helpful when there
is at least a /dev/watchdog1 in the system. Particularly on R-Car3,
this happens when enabling softdog in addition to the standard RWDT:

root@rcar-gen3:~# ls -al /dev/watchdog*
crw------- 1 root root 10, 130 Aug 21 09:38 /dev/watchdog
crw------- 1 root root 247, 0 Aug 21 09:38 /dev/watchdog0
crw------- 1 root root 247, 1 Aug 21 09:38 /dev/watchdog1

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/watchdog/watchdog-kernel-api.rst?h=v5.3-rc6#n71
----8<----
id 0 is special. It has both a
/dev/watchdog0 cdev (dynamic major, minor 0) as well as the old
/dev/watchdog miscdev.
----8<----

--
Best Regards,
Eugeniu.