From 3f76aef416cb121c23254f2658d5183c617b8855 Mon Sep 17 00:00:00 2001 From: "hajun.sung" Date: Sun, 27 Aug 2017 13:41:37 +0900 Subject: [PATCH] [COMMON] watchdog: s3c2410_wdt: add stutdown disable - When system failure after watchdog driver shutdown, there is no way to reboot, just system hang (with black screen). - To prevent system hang, watchdog must not be disabled after shutdown. - But sometimes watchdog must be disabled to debug reset sequence. So, define with config : S3C2410_SHUTDOWN_REBOOT - This configuration is recommended for user case. Change-Id: I2cfcc6d922f2ccd8cd91d0059fb6f79e9fd40854 Signed-off-by: hajun.sung --- drivers/watchdog/Kconfig | 12 ++++++++++++ drivers/watchdog/s3c2410_wdt.c | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index 3ece1335ba84..e38f6ab20c7b 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -379,6 +379,18 @@ config S3C2410_WATCHDOG The driver can be built as a module by choosing M, and will be called s3c2410_wdt +config S3C2410_SHUTDOWN_REBOOT + bool "Support watchdog reset after watchdog shutdown" + depends on S3C2410_WATCHDOG + default n + help + This config disable the shutdown function of S3C2410 watchdog. + To prevent stuck after watchdog driver shutdown, shutdown + function will not stop or disable watchdog and it will just + kick 30 second. It will prevent being stucked in reset + sequence with some other failure. + This feature is not recommeneded for debugging. + config SA1100_WATCHDOG tristate "SA1100/PXA2xx watchdog" depends on ARCH_SA1100 || ARCH_PXA diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c index 743899772038..a840ff7a1338 100644 --- a/drivers/watchdog/s3c2410_wdt.c +++ b/drivers/watchdog/s3c2410_wdt.c @@ -1212,6 +1212,10 @@ static int s3c2410wdt_remove(struct platform_device *dev) static void s3c2410wdt_shutdown(struct platform_device *dev) { +#ifdef CONFIG_S3C2410_SHUTDOWN_REBOOT + pr_emerg("%s: watchdog is still alive\n", __func__); + s3c2410wdt_keepalive_emergency(true, 0); +#else struct s3c2410_wdt *wdt = platform_get_drvdata(dev); /* Only little cluster watchdog excute mask function */ @@ -1219,6 +1223,7 @@ static void s3c2410wdt_shutdown(struct platform_device *dev) s3c2410wdt_mask_wdt_reset(wdt, true); s3c2410wdt_stop(&wdt->wdt_device); +#endif } static struct platform_driver s3c2410wdt_driver = { -- 2.20.1