[PATCH v5 2/2] drivers: sbsa_gwdt: Enable the reset_on_panic feature
From: George Cherian
Date: Wed Apr 09 2025 - 01:35:47 EST
Set the WDIOF_OPS_ATOMIC for sbsa_gwdt driver, since the ops are atomic.
Also set the reset_on_panic timeout, this enables the panic notifier to
be registered by watchdog core and use the reset_on_panic timeout to be
configured in case of kernel panic. reset_on_panic is by default set to
60sec. This can be modified runtime via sysfs.
Signed-off-by: George Cherian <george.cherian@xxxxxxxxxxx>
---
drivers/watchdog/sbsa_gwdt.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/watchdog/sbsa_gwdt.c b/drivers/watchdog/sbsa_gwdt.c
index 5f23913ce3b4..fd5095137712 100644
--- a/drivers/watchdog/sbsa_gwdt.c
+++ b/drivers/watchdog/sbsa_gwdt.c
@@ -92,6 +92,7 @@ struct sbsa_gwdt {
};
#define DEFAULT_TIMEOUT 10 /* seconds */
+#define DEFAULT_RESET_ON_PANIC_TIMEOUT 60 /* seconds */
static unsigned int timeout;
module_param(timeout, uint, 0);
@@ -242,6 +243,7 @@ static const struct watchdog_info sbsa_gwdt_info = {
.options = WDIOF_SETTIMEOUT |
WDIOF_KEEPALIVEPING |
WDIOF_MAGICCLOSE |
+ WDIOF_OPS_ATOMIC |
WDIOF_CARDRESET,
};
@@ -291,6 +293,7 @@ static int sbsa_gwdt_probe(struct platform_device *pdev)
wdd->ops = &sbsa_gwdt_ops;
wdd->min_timeout = 1;
wdd->timeout = DEFAULT_TIMEOUT;
+ wdd->reset_on_panic = DEFAULT_RESET_ON_PANIC_TIMEOUT;
watchdog_set_drvdata(wdd, gwdt);
watchdog_set_nowayout(wdd, nowayout);
sbsa_gwdt_get_version(wdd);
--
2.34.1