[PATCH] watchdog: make open-close-open functionality a config knob
deweloper at wp.pl
deweloper at wp.pl
Mon Mar 15 11:16:32 UTC 2021
Dnia 2021-03-15, o godz. 09:03:07
Rasmus Villemoes <rasmus.villemoes at prevas.dk> napisał(a):
> On 09/03/2021 13.33, Rasmus Villemoes wrote:
> > On 01/03/2021 16.11, Rasmus Villemoes wrote:
> >> When the nowayout option is used with a watchdog device, busybox'
> >> current behaviour of always doing a open/write magic char/close
> >> sequence before the "real" open causes warning messages in the kernel
> >> log:
> >>
> >> [ 16.212184] watchdog: watchdog0: nowayout prevents watchdog being
> >> stopped! [ 16.212196] watchdog: watchdog0: watchdog did not stop!
> >>
> >> The latter may also appear by itself in case the watchdog is of the
> >> type that cannot be stopped once started.
> >>
> >> These warnings can be somewhat ominous and distracting, so allow
> >> configuring whether to use this open-write-close-open sequence rather
> >> than just open.
> >
> > ping
>
> ping^2
>
> Come to think of it, I actually think the open_twice feature should be
> default n. It seems one might as well start the watchdog daemon with a
> wrapper that does "printf 'V' > /dev/watchdog0; exec watchdog ...". But
> either way, please consider this patch.
>
> Rasmus
It seems that the open-write-close-open sequence has been introduced in busybox 1.28.0 by commit https://git.busybox.net/busybox/commit/?h=31c765081dc41f158786545fbea9294be4685bd2
AFAIU the commit message says that it is a kind of a workaround for some possible implementations of hardware watchdogs, which could enter wrong state when their supervisor in userspace is restarted (confused by close/open? I don't know). But it doesn't name any single example of an existing watchdog like that.
In my case (softdog nowayout=1) that "fix" only adds:
- bloat to busybox, and
- annoying critical error message from kernel (yes, "watchdog: watchdog0: watchdog did not stop!" is at KERN_CRIT level)
So I'm definitely for making the behaviour introduced by commit 31c765081dc41f158786545fbea9294be4685bd2 optional.
--
More information about the busybox
mailing list