From: minyard@acm.org
To: Guenter Roeck <linux@roeck-us.net>,
Wim Van Sebroeck <wim@linux-watchdog.org>
Cc: linux-watchdog@vger.kernel.org, Corey Minyard <cminyard@mvista.com>
Subject: [PATCH 08/10] watchdog: Add a way to extend the timeout on a reboot
Date: Sat, 20 Jun 2020 12:49:05 -0500 [thread overview]
Message-ID: <20200620174907.20229-9-minyard@acm.org> (raw)
In-Reply-To: <20200620174907.20229-1-minyard@acm.org>
From: Corey Minyard <cminyard@mvista.com>
If reboot_timeout is set in the watchdog device struct, set the timeout
to that value on a reboot. This way more time can be given for a reboot
to complete.
Signed-off-by: Corey Minyard <cminyard@mvista.com>
---
drivers/watchdog/watchdog_core.c | 2 ++
include/linux/watchdog.h | 4 ++++
2 files changed, 6 insertions(+)
diff --git a/drivers/watchdog/watchdog_core.c b/drivers/watchdog/watchdog_core.c
index 03943a34e9fb..5792f9bca645 100644
--- a/drivers/watchdog/watchdog_core.c
+++ b/drivers/watchdog/watchdog_core.c
@@ -165,6 +165,8 @@ static int watchdog_reboot_notifier(struct notifier_block *nb,
if (ret)
return NOTIFY_BAD;
}
+ } else if (wdd->reboot_timeout) {
+ watchdog_set_timeout(wdd, wdd->reboot_timeout);
}
return NOTIFY_DONE;
diff --git a/include/linux/watchdog.h b/include/linux/watchdog.h
index 1eefae61215d..0fb57f29346c 100644
--- a/include/linux/watchdog.h
+++ b/include/linux/watchdog.h
@@ -92,6 +92,9 @@ struct watchdog_ops {
* @status: Field that contains the devices internal status bits.
* @deferred: Entry in wtd_deferred_reg_list which is used to
* register early initialized watchdogs.
+ * @reboot_timeout:
+ * If non-zero, the timeout will be set to this value
+ * on a reboot. This lets a reboot be given more time.
*
* The watchdog_device structure contains all information about a
* watchdog timer device.
@@ -125,6 +128,7 @@ struct watchdog_device {
#define WDOG_HW_RUNNING 3 /* True if HW watchdog running */
#define WDOG_STOP_ON_UNREGISTER 4 /* Should be stopped on unregister */
struct list_head deferred;
+ unsigned int reboot_timeout;
};
#define WATCHDOG_NOWAYOUT IS_BUILTIN(CONFIG_WATCHDOG_NOWAYOUT)
--
2.17.1
next prev parent reply other threads:[~2020-06-20 17:50 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-20 17:48 [PATCH 00/10] Convert the IPMI watchdog to use the watchdog minyard
2020-06-20 17:48 ` [PATCH 01/10] watchdog: Ignore stop_on_reboot if no stop function minyard
2020-07-19 14:11 ` Guenter Roeck
2020-06-20 17:48 ` [PATCH 02/10] watchdog: Add read capability minyard
2020-06-20 17:49 ` [PATCH 03/10] watchdog: Add documentation for " minyard
2020-07-01 2:49 ` Guenter Roeck
2020-06-20 17:49 ` [PATCH 04/10] watchdog: Add functions to set the timeout and pretimeout minyard
2020-07-01 2:45 ` Guenter Roeck
2020-06-20 17:49 ` [PATCH 05/10] watchdog: Export an interface to start the watchdog minyard
2020-07-01 2:46 ` Guenter Roeck
2020-06-20 17:49 ` [PATCH 06/10] ipmi:watchdog: Convert over to the watchdog framework minyard
2020-06-20 17:49 ` [PATCH 07/10] ipmi:watchdog: Allow the reboot timeout to be specified minyard
2020-06-20 17:49 ` minyard [this message]
2020-07-19 14:25 ` [PATCH 08/10] watchdog: Add a way to extend the timeout on a reboot Guenter Roeck
2020-06-20 17:49 ` [PATCH 09/10] ipmi:watchdog: Convert over to watchdog framework reboot handling minyard
2020-06-20 17:49 ` [PATCH 10/10] ipmi:watchdog: Add the op to get the current timeout minyard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200620174907.20229-9-minyard@acm.org \
--to=minyard@acm.org \
--cc=cminyard@mvista.com \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=wim@linux-watchdog.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.