aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Valentin <[email protected]>2022-02-11 18:10:33 -0800
committerWim Van Sebroeck <[email protected]>2022-03-27 17:04:08 +0200
commit4ed1a6b6e66dd9ba0a1d56ed23f46c39fe9368c5 (patch)
treed1418a684c06128a16585ca653899ceb722398ef
parentd055ef3a2c6919cff504ae3b710c96318d545fd2 (diff)
watchdog: aspeed: add nowayout support
Add support for not stopping the watchdog when the userspace application quits. At closing of the device, the driver cannot determine if this was a graceful closure or if the app crashed. If the support of nowayout on this driver, the system integrator can select the behaviour by setting the kernel config and enabling it. Cc: Wim Van Sebroeck <[email protected]> (maintainer:WATCHDOG DEVICE DRIVERS) Cc: Guenter Roeck <[email protected]> (maintainer:WATCHDOG DEVICE DRIVERS) Cc: Joel Stanley <[email protected]> (supporter:ARM/ASPEED MACHINE SUPPORT) Cc: Andrew Jeffery <[email protected]> (reviewer:ARM/ASPEED MACHINE SUPPORT) Cc: [email protected] (open list:WATCHDOG DEVICE DRIVERS) Cc: [email protected] (moderated list:ARM/ASPEED MACHINE SUPPORT) Cc: [email protected] (moderated list:ARM/ASPEED MACHINE SUPPORT) Cc: [email protected] (open list) Signed-off-by: Eduardo Valentin <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
-rw-r--r--drivers/watchdog/aspeed_wdt.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/watchdog/aspeed_wdt.c b/drivers/watchdog/aspeed_wdt.c
index 436571b6fc79..bd06622813eb 100644
--- a/drivers/watchdog/aspeed_wdt.c
+++ b/drivers/watchdog/aspeed_wdt.c
@@ -13,6 +13,11 @@
#include <linux/platform_device.h>
#include <linux/watchdog.h>
+static bool nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, bool, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
+ __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
struct aspeed_wdt {
struct watchdog_device wdd;
void __iomem *base;
@@ -266,6 +271,8 @@ static int aspeed_wdt_probe(struct platform_device *pdev)
wdt->wdd.timeout = WDT_DEFAULT_TIMEOUT;
watchdog_init_timeout(&wdt->wdd, 0, dev);
+ watchdog_set_nowayout(&wdt->wdd, nowayout);
+
np = dev->of_node;
ofdid = of_match_node(aspeed_wdt_of_table, np);