busybox/miscutils
Rasmus Villemoes 50a37459ff watchdog: make open-write-close-open functionality a config knob
The behaviour introduced by commit 31c765081d ("watchdog: stop
watchdog first on startup") causes warnings in the kernel log when the
nowayout feature is enabled:

[   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 (e.g. the common
always-running gpio_wdt kind).

These warnings can be somewhat ominous and distracting, so allow
configuring whether to use this open-write-close-open sequence rather
than just open. Also saves a bit of .text when disabled:

function                                             old     new   delta
shutdown_on_signal                                    31      58     +27
watchdog_main                                        339     306     -33
shutdown_watchdog                                     34       -     -34
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 1/1 up/down: 27/-67)            Total: -40 bytes

Make it default n:

- It's a workaround for one specific type of watchdog (and
  that seems to be a defect in the kernel driver)
- Even when not enabled in busybox config, it can easily be
  implemented outside busybox
- Code size
- Commit 31c765081d should be considered a regression for all the
  boards that now end up with KERN_CRIT warnings in dmesg.
- The author of that commit said "This use case is evidently rare, so
  if it is indeed causing problems for other people I'd OK then I
  understand whatever needs to be done." in the v1 thread.

Cc: Matt Spinler <mspinler@linux.vnet.ibm.com>
Cc: deweloper@wp.pl
Cc: tito <farmatito@tiscali.it>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-04-13 16:05:27 +02:00
..
adjtimex.c more --help text tweaks 2020-12-13 19:18:28 +01:00
bbconfig.c libarchive: add a function to unpack embedded data 2018-11-02 14:14:51 +01:00
bc.c bc: typo fix in comment 2021-02-26 21:20:18 +01:00
beep.c libbb: introduce and use msleep() 2020-11-29 12:40:25 +01:00
chat.c use write_str() functions where appropriate 2020-11-29 11:49:37 +01:00
Config.src restore documentation on the build config language 2018-06-06 15:16:48 +02:00
conspy.c libbb: introduce and use fputs_stdout 2021-02-03 20:52:40 +01:00
crond.c help text tweaks 2020-12-13 19:04:19 +01:00
crontab.c crontab: Fix -e with editors saving using renaming strategy 2020-07-11 17:02:37 +02:00
dc.c timeout,top,watch,ping: parse NN.N fractional duration in locales with other separators 2021-03-23 13:50:02 +01:00
devfsd.c randomconfig fixes 2020-12-29 16:53:11 +01:00
devmem.c libbb: add and use infrastructure for fixed page size optimization 2020-12-14 18:54:30 +01:00
fbsplash.c build system: drop PLATFORM_LINUX 2020-08-13 17:12:56 +02:00
fbsplash.cfg
flash_eraseall.c libbb: reduce the overhead of single parameter bb_error_msg() calls 2019-07-02 11:35:03 +02:00
flash_lock_unlock.c whitespace and comment format fixes, no code changes 2017-10-05 15:33:28 +02:00
flashcp.c config: update size information 2018-12-28 03:20:17 +01:00
hdparm.c decrease paddign: gcc-9.3.1 slaps 32-byte alignment on arrays willy-nilly 2020-11-30 13:03:03 +01:00
hexedit.c libbb: add and use infrastructure for fixed page size optimization 2020-12-14 18:54:30 +01:00
i2c_tools.c *: use fopen helpers where appropriate 2020-12-30 00:16:27 +01:00
inotifyd.c libbb: reduce the overhead of single parameter bb_error_msg() calls 2019-07-02 11:35:03 +02:00
Kbuild.src Remove trailing empty lines 2016-11-23 10:43:39 +01:00
less.c config: update size information 2018-12-28 03:20:17 +01:00
lsscsi.c build system: drop PLATFORM_LINUX 2020-08-13 17:12:56 +02:00
makedevs.c config: update size information 2018-12-28 03:20:17 +01:00
man.c man: implement SECTION parameters 2020-12-27 16:02:37 +01:00
microcom.c config: update size information 2018-12-28 03:20:17 +01:00
mim.c mim: run scripts from a specification file 2020-04-30 17:23:08 +02:00
mt.c help text tweaks 2020-12-13 19:04:19 +01:00
nandwrite.c build system: drop PLATFORM_LINUX 2020-08-13 17:12:56 +02:00
partprobe.c build system: drop PLATFORM_LINUX 2020-08-13 17:12:56 +02:00
raidautorun.c build system: drop PLATFORM_LINUX 2020-08-13 17:12:56 +02:00
readahead.c build system: drop PLATFORM_LINUX 2020-08-13 17:12:56 +02:00
rfkill.c build system: drop PLATFORM_LINUX 2020-08-13 17:12:56 +02:00
runlevel.c config: more tweaks 2018-12-28 17:52:43 +01:00
rx.c build system: drop PLATFORM_LINUX 2020-08-13 17:12:56 +02:00
setfattr.c config: update size information 2018-12-28 03:20:17 +01:00
setserial.c decrease paddign: gcc-9.3.1 slaps 32-byte alignment on arrays willy-nilly 2020-11-30 13:03:03 +01:00
strings.c libbb: introduce and use fputs_stdout 2021-02-03 20:52:40 +01:00
time.c libbb: add and use infrastructure for fixed page size optimization 2020-12-14 18:54:30 +01:00
ts.c libbb: introduce and use xgettimeofday(), do not truncate 64-bit time_t in shells 2020-12-30 23:48:01 +01:00
ttysize.c config: update size information 2018-12-28 03:20:17 +01:00
ubi_tools.c decrease paddign: gcc-9.3.1 slaps 32-byte alignment on arrays willy-nilly 2020-11-30 13:03:03 +01:00
ubirename.c build system: drop PLATFORM_LINUX 2020-08-13 17:12:56 +02:00
volname.c config: update size information 2018-12-28 03:20:17 +01:00
watchdog.c watchdog: make open-write-close-open functionality a config knob 2021-04-13 16:05:27 +02:00