From: "Thomas Weißschuh" <linux@weissschuh.net>
To: "Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
Wim Van Sebroeck <wim@linux-watchdog.org>,
Guenter Roeck <linux@roeck-us.net>,
linux-watchdog@vger.kernel.org
Cc: "Thomas Weißschuh" <linux@weissschuh.net>, linux-kernel@vger.kernel.org
Subject: [PATCH] watchdog: iTCO_wdt: Full reinitialize on resume
Date: Tue, 28 Sep 2021 18:53:43 +0200 [thread overview]
Message-ID: <20210928165343.23401-1-linux@weissschuh.net> (raw)
The Thinkpad T460s always needs driver-side suspend-resume handling.
If the watchdog is not stopped before suspend then the system will hang
on resume.
If the interval is not set before starting the watchdog then the machine
will instantly be reset after resume.
Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=198019
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
drivers/watchdog/iTCO_wdt.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/drivers/watchdog/iTCO_wdt.c b/drivers/watchdog/iTCO_wdt.c
index 643c6c2d0b72..2297a0a1e5fc 100644
--- a/drivers/watchdog/iTCO_wdt.c
+++ b/drivers/watchdog/iTCO_wdt.c
@@ -47,6 +47,7 @@
/* Includes */
#include <linux/acpi.h> /* For ACPI support */
#include <linux/bits.h> /* For BIT() */
+#include <linux/dmi.h> /* For DMI matching */
#include <linux/module.h> /* For module specific items */
#include <linux/moduleparam.h> /* For new moduleparam's */
#include <linux/types.h> /* For standard types (like size_t) */
@@ -605,9 +606,20 @@ static int iTCO_wdt_probe(struct platform_device *pdev)
*/
#ifdef CONFIG_ACPI
+static const struct dmi_system_id iTCO_wdt_force_suspend[] = {
+ {
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+ DMI_MATCH(DMI_PRODUCT_FAMILY, "ThinkPad T460s"),
+ },
+ },
+ { },
+};
+
static inline bool need_suspend(void)
{
- return acpi_target_system_state() == ACPI_STATE_S0;
+ return acpi_target_system_state() == ACPI_STATE_S0 ||
+ dmi_check_system(iTCO_wdt_force_suspend);
}
#else
static inline bool need_suspend(void) { return true; }
@@ -631,8 +643,10 @@ static int iTCO_wdt_resume_noirq(struct device *dev)
{
struct iTCO_wdt_private *p = dev_get_drvdata(dev);
- if (p->suspended)
+ if (p->suspended) {
+ iTCO_wdt_set_timeout(&p->wddev, p->wddev.timeout);
iTCO_wdt_start(&p->wddev);
+ }
return 0;
}
base-commit: 41e73feb1024929e75eaf2f7cd93f35a3feb331b
--
2.33.0
next reply other threads:[~2021-09-28 16:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-28 16:53 Thomas Weißschuh [this message]
2021-10-02 13:23 ` Guenter Roeck
2021-10-02 13:43 ` Thomas Weißschuh
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=20210928165343.23401-1-linux@weissschuh.net \
--to=linux@weissschuh.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=rafael.j.wysocki@intel.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®