[PATCH] watchdog: make open-close-open functionality a config knob

deweloper at wp.pl deweloper at wp.pl
Thu Mar 18 09:12:52 UTC 2021


Dnia 2021-03-17, o godz. 16:35:12
Matt Spinler <mspinler at linux.ibm.com> napisał(a):

> On 3/17/2021 3:42 PM, Rasmus Villemoes wrote:
> > On 15/03/2021 23.41, deweloper at wp.pl wrote:  
> >> Dnia 2021-03-15, o godz. 08:26:38
> >> Matt Spinler <mspinler at linux.ibm.com> napisał(a):
> >>  
> >   for not responding sooner.  
> >>> In my case, the code is on a BMC (OpenBMC), and the output of the
> >>> watchdog is wired to a fan watchdog hardware circuit (involving a latch
> >>> and a standalone fan control chip), which the watchdog app is pinging.
> >>> So if the watchdog app dies the fans get set to full speed, however on
> >>> the next main power cycle of the server (the BMC is on a different power
> >>> domain) we want things back to normal, so the watchdog has to work again
> >>> when it is restarted, which it wasn't doing without my change.  
> > Thanks for the explanation. Can you point me at the watchdog driver code
> > which does this "get things back to normal" on a (graceful) shutdown/stop?  
> 
> Our hardware is an ASPEED BMC chip, and here is the driver:
> https://github.com/torvalds/linux/blob/master/drivers/watchdog/aspeed_wdt.c
> 
> >  
> >> I wonder what is the "architecturally correct" way of fixing this kind of
> >> problem, since doing "stop" as a way to "start" seems counter-intuitive.  
> > Indeed.
> >
> > Denys, can you consider applying the up-thread patch. Whether you'll
> > make it default n or y is up to you. Even if it's n, I think one can
> > achieve the same thing with a wrapper
> >
> > #!/bin/sh
> > ( shift $(($# - 1)) && [ -c "$1" ] && printf 'V' > "$1" )
> > exec busybox watchdog "$@"
> >
> > (or in any other number of ways, depending on how one starts the
> > daemon). But there is no way of avoiding the annoying "nowayout"
> > messages from the kernel if busybox is built with this
> > open-write-close-open.
> >
> > Rasmus

Hello again

Now it is clear that the original problem should have been fixed inside the driver aspeed_wdt.c.
Alternatively it can be easily workarounded by "printf V" or "echo -n V" before launching watchdog applet (thanks Rasmus for finding it out).
So there is no need for the watchdog applet to try to stop a watchdog at startup in any case.
And doing it is just wrong especially in case of nowayout watchdogs which can't be stopped.
So the logical conclusion is that commit 31c765081dc41f158786545fbea9294be4685bd2 should be _reverted_.

-- 


More information about the busybox mailing list