Skip to content

Commit 4ed1a6b

Browse files
Eduardo ValentinWim Van Sebroeck
authored andcommitted
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 <wim@linux-watchdog.org> (maintainer:WATCHDOG DEVICE DRIVERS) Cc: Guenter Roeck <linux@roeck-us.net> (maintainer:WATCHDOG DEVICE DRIVERS) Cc: Joel Stanley <joel@jms.id.au> (supporter:ARM/ASPEED MACHINE SUPPORT) Cc: Andrew Jeffery <andrew@aj.id.au> (reviewer:ARM/ASPEED MACHINE SUPPORT) Cc: linux-watchdog@vger.kernel.org (open list:WATCHDOG DEVICE DRIVERS) Cc: linux-arm-kernel@lists.infradead.org (moderated list:ARM/ASPEED MACHINE SUPPORT) Cc: linux-aspeed@lists.ozlabs.org (moderated list:ARM/ASPEED MACHINE SUPPORT) Cc: linux-kernel@vger.kernel.org (open list) Signed-off-by: Eduardo Valentin <eduval@amazon.com> Signed-off-by: Eduardo Valentin <evalenti@kernel.org> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20220212021033.2344-1-eduval@amazon.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
1 parent d055ef3 commit 4ed1a6b

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

drivers/watchdog/aspeed_wdt.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
#include <linux/platform_device.h>
1414
#include <linux/watchdog.h>
1515

16+
static bool nowayout = WATCHDOG_NOWAYOUT;
17+
module_param(nowayout, bool, 0);
18+
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
19+
__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
20+
1621
struct aspeed_wdt {
1722
struct watchdog_device wdd;
1823
void __iomem *base;
@@ -266,6 +271,8 @@ static int aspeed_wdt_probe(struct platform_device *pdev)
266271
wdt->wdd.timeout = WDT_DEFAULT_TIMEOUT;
267272
watchdog_init_timeout(&wdt->wdd, 0, dev);
268273

274+
watchdog_set_nowayout(&wdt->wdd, nowayout);
275+
269276
np = dev->of_node;
270277

271278
ofdid = of_match_node(aspeed_wdt_of_table, np);

0 commit comments

Comments
 (0)