Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp5072261pxb; Tue, 28 Sep 2021 09:57:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxitXiqcWU2TlLtjRQo2RQR437pNPreL8FixloCmkLSSgOHzZuyzUf/L2rT7TQl/o5ieWRn X-Received: by 2002:a50:bec8:: with SMTP id e8mr8759372edk.231.1632848255523; Tue, 28 Sep 2021 09:57:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632848255; cv=none; d=google.com; s=arc-20160816; b=cgaAxD1uXnB7Gt57NjgrqnwqbrQWtUvaz6agIcxLgaK1m7wkA1le8o2h3PoVWWUgbw fnAR9ih/rDPQMVGqD2b+t5tsEmyV6gvTb4THNhvwJ2q7aY1HByqT5CO9Px0OKQOQrhQD +KhbIeYRKgGQqvT6vyebN8qN/Mg6DIdaC4mWvBSJtYXtrO7igjj5TDsEUiLrzpQd0qsA qZGRzzRE7b1FYS7Xv8mNw6ezM9lNDw39mEglE7+jv02kMB6HsPmwWfFClwoyVo1oTFda Oil/XI2VIPOVyraBjrijuBWvqy28I8fmbEjp3p640tlz8Rrg9haz5Vf2L7KJA9vVqRUJ B03A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:dkim-signature:from; bh=52aBz4EIAsskXIzsEv6qic1ZxIsI4LLkeZd+6by+QbA=; b=Cq8Tl+1lIBNriN7zmWopmmxzcT5S2oDcDEVHfkT5cJfzsaFauGbdh8Sz43TFUaVfTr ifNv3mMesDmRUP6CssttVhclvimn0oQM9kUYSRxC/Kwd//MHuUcqBl+//k4LJPHWeXCe XMDuE/AJWwVPsEIKot0jvWgCy1qB0QnMyvIjot4dSgoRRl6npehazzTUsOLi5pcD1aLP JqKWWSEogU1UezlV611YwA2bWc2dMrYtccfjGTqnbgB9KebxelqkFat99aHb5+i4dCHQ xBzU3BHvQ1cTUlhbU8xvNaVQ+O7Ke9DgztAAVsVzbPuem1Ui02j+dBiKXgKTjTPTkki6 ie1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@weissschuh.net header.s=mail header.b=CYNoY+Pv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v3si4091056ejq.278.2021.09.28.09.57.10; Tue, 28 Sep 2021 09:57:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@weissschuh.net header.s=mail header.b=CYNoY+Pv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240713AbhI1Qzs (ORCPT + 99 others); Tue, 28 Sep 2021 12:55:48 -0400 Received: from todd.t-8ch.de ([159.69.126.157]:51337 "EHLO todd.t-8ch.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229795AbhI1Qzr (ORCPT ); Tue, 28 Sep 2021 12:55:47 -0400 From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=weissschuh.net; s=mail; t=1632848044; bh=sYjAoky0bQxhkEySQnm7brXya54BLjlKSt2pb2lodvk=; h=From:To:Cc:Subject:Date:From; b=CYNoY+PveeZ0ciq7tmDgVSpblu9G/2Hib2xSA8UaU58CYVpvxgjImOKI/aKWki4uL vciw6i4sjfxubElNvI/KOLowdnJ776PawvfLuMBy1aEpUvxwWGY6U9NmoAYoZQubim YGn6vG6grGAxW0LIWqliATMvBR5Weu6brKrL8IM8= To: "Rafael J . Wysocki" , Wim Van Sebroeck , Guenter Roeck , linux-watchdog@vger.kernel.org Cc: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , linux-kernel@vger.kernel.org Subject: [PATCH] watchdog: iTCO_wdt: Full reinitialize on resume Date: Tue, 28 Sep 2021 18:53:43 +0200 Message-Id: <20210928165343.23401-1-linux@weissschuh.net> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 /* For ACPI support */ #include /* For BIT() */ +#include /* For DMI matching */ #include /* For module specific items */ #include /* For new moduleparam's */ #include /* 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