busybox/miscutils
Rasmus Villemoes 50a37459ff watchdog: make open-write-close-open functionality a config knob
The behaviour introduced by commit 31c765081dc4 ("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 31c765081dc4 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
..
2020-12-13 19:18:28 +01:00
2021-02-26 21:20:18 +01:00
2020-11-29 12:40:25 +01:00
2021-02-03 20:52:40 +01:00
2020-12-13 19:04:19 +01:00
2020-12-29 16:53:11 +01:00
2020-08-13 17:12:56 +02:00
2018-12-28 03:20:17 +01:00
2018-12-28 03:20:17 +01:00
2020-08-13 17:12:56 +02:00
2018-12-28 03:20:17 +01:00
2020-12-27 16:02:37 +01:00
2018-12-28 03:20:17 +01:00
2020-12-13 19:04:19 +01:00
2020-08-13 17:12:56 +02:00
2020-08-13 17:12:56 +02:00
2020-08-13 17:12:56 +02:00
2020-08-13 17:12:56 +02:00
2018-12-28 17:52:43 +01:00
2020-08-13 17:12:56 +02:00
2018-12-28 03:20:17 +01:00
2018-12-28 03:20:17 +01:00
2020-08-13 17:12:56 +02:00
2018-12-28 03:20:17 +01:00