From ff84136cb6a4943f489ad037fe93f43be0573c23 Mon Sep 17 00:00:00 2001 From: Vladimir Zapolskiy Date: Fri, 7 Oct 2016 15:39:54 +0300 Subject: watchdog: add watchdog pretimeout governor framework The change adds a simple watchdog pretimeout framework infrastructure, its purpose is to allow users to select a desired handling of watchdog pretimeout events, which may be generated by some watchdog devices. A user selects a default watchdog pretimeout governor during compilation stage. Watchdogs with WDIOF_PRETIMEOUT capability now have one more device attribute in sysfs, pretimeout_governor attribute is intended to display the selected watchdog pretimeout governor. The framework has no impact at runtime on watchdog devices with no WDIOF_PRETIMEOUT capability set. Signed-off-by: Vladimir Zapolskiy Reviewed-by: Guenter Roeck Reviewed-by: Wolfram Sang Tested-by: Wolfram Sang Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck --- drivers/watchdog/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers/watchdog/Makefile') diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile index c22ad3ea3539..990c36ed4716 100644 --- a/drivers/watchdog/Makefile +++ b/drivers/watchdog/Makefile @@ -3,9 +3,12 @@ # # The WatchDog Timer Driver Core. -watchdog-objs += watchdog_core.o watchdog_dev.o obj-$(CONFIG_WATCHDOG_CORE) += watchdog.o +watchdog-objs += watchdog_core.o watchdog_dev.o + +watchdog-$(CONFIG_WATCHDOG_PRETIMEOUT_GOV) += watchdog_pretimeout.o + # Only one watchdog can succeed. We probe the ISA/PCI/USB based # watchdog-cards first, then the architecture specific watchdog # drivers and then the architecture independent "softdog" driver. -- cgit v1.2.3 From f77710c4cda01ad9c3672fb2f97bdea9a94da92a Mon Sep 17 00:00:00 2001 From: Vladimir Zapolskiy Date: Fri, 7 Oct 2016 15:39:55 +0300 Subject: watchdog: pretimeout: add noop pretimeout governor The change adds noop watchdog pretimeout governor, only an informational message is printed to the kernel log buffer when a watchdog triggers a pretimeout event. While introducing the first pretimeout governor the selected design assumes that the default pretimeout governor is selected by its name and it is always built-in, thus the default pretimeout governor can not be unregistered and the correspondent check can be removed from the watchdog_unregister_governor() function. Signed-off-by: Vladimir Zapolskiy Reviewed-by: Guenter Roeck Reviewed-by: Wolfram Sang Tested-by: Wolfram Sang Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck --- drivers/watchdog/Makefile | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/watchdog/Makefile') diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile index 990c36ed4716..0502a21db1db 100644 --- a/drivers/watchdog/Makefile +++ b/drivers/watchdog/Makefile @@ -9,6 +9,8 @@ watchdog-objs += watchdog_core.o watchdog_dev.o watchdog-$(CONFIG_WATCHDOG_PRETIMEOUT_GOV) += watchdog_pretimeout.o +obj-$(CONFIG_WATCHDOG_PRETIMEOUT_GOV_NOOP) += pretimeout_noop.o + # Only one watchdog can succeed. We probe the ISA/PCI/USB based # watchdog-cards first, then the architecture specific watchdog # drivers and then the architecture independent "softdog" driver. -- cgit v1.2.3 From da0d12ff2b829a35e9921918e925d79497b82bef Mon Sep 17 00:00:00 2001 From: Vladimir Zapolskiy Date: Fri, 7 Oct 2016 15:39:56 +0300 Subject: watchdog: pretimeout: add panic pretimeout governor The change adds panic watchdog pretimeout governor, on watchdog pretimeout event the kernel shall panic. In general watchdog pretimeout event means that something essentially bad is going on the system, for example a process scheduler stalls or watchdog feeder is killed due to OOM, so printing out information attendant to panic and before likely unavoidable reboot caused by a watchdog may help to determine a root cause of the issue. Signed-off-by: Vladimir Zapolskiy Reviewed-by: Guenter Roeck Reviewed-by: Wolfram Sang Tested-by: Wolfram Sang Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck --- drivers/watchdog/Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/watchdog/Makefile') diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile index 0502a21db1db..1a34c6a96988 100644 --- a/drivers/watchdog/Makefile +++ b/drivers/watchdog/Makefile @@ -10,6 +10,7 @@ watchdog-objs += watchdog_core.o watchdog_dev.o watchdog-$(CONFIG_WATCHDOG_PRETIMEOUT_GOV) += watchdog_pretimeout.o obj-$(CONFIG_WATCHDOG_PRETIMEOUT_GOV_NOOP) += pretimeout_noop.o +obj-$(CONFIG_WATCHDOG_PRETIMEOUT_GOV_PANIC) += pretimeout_panic.o # Only one watchdog can succeed. We probe the ISA/PCI/USB based # watchdog-cards first, then the architecture specific watchdog -- cgit v1.2.3