Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp2109399pxb; Sat, 2 Oct 2021 07:02:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoTQuK7UGSMoleKkw5em43AnLMgGBSK8N/IQCxkYirkZkuioLm/wmVuZcdyI6ZJegGR1Kk X-Received: by 2002:a17:906:3148:: with SMTP id e8mr4311391eje.240.1633183357875; Sat, 02 Oct 2021 07:02:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633183357; cv=none; d=google.com; s=arc-20160816; b=Cuqo4feA56zYwoMYyg6bkUR5c6Fq+QXRi9iaVnryFT2eLy1LocZxR0Of6lRSLYMY4u Kq4P1NJ2Vjt21tfULZxj7ltE8Mk7Xfw+c6ZPIStOualr6UNBdkfJpn5iHd9TRUUfJfne PpEZf3tXeVD2zBOhneKoGCT7eSj8F9+nN/i1uVMYL9yFt9i+06RCpT7Fpl1AbBPVWS4c SOH/IjqIf45zt2UmTVaXYSBoLQekCXf2NInHl7626Yrfhu6HWT+Xraqk52bRl7gIvpOF qWMq9QiB8MSEPSKcQ9+O/WeEuDdh4QL0ofQaF6C3F48JJsvcuzB22IGu12w+DoGsna1m kfrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:dkim-signature:date; bh=bBGbyHFG8tOt4JzEuuPigpH+H10ABy82NxJp9Oa5w7Y=; b=uvoy4cr9UmeJiyX5ChGwaL1imyhOOzvhbIrpCNLQ+eOnUQ16YjwCxHk2bewAV4cLB0 45rgHjshlg9soI8rJAtq4vPML/X3T2vvnpMPtCcmNeQcethZ/1acP6jVLM8HrAAF1dQI AeGL3ZofSNma1xryWDWatvlgSLGic0HBuT0kcvJkzguLJCl3r5luJNqczczKKa0OVGt2 i1KLIhfoAmMwAZqZzJg/Fi0xWsroGac+nYFUV9EulUYAcnuSdZ1FUox8sqL/rzEHCuyj SoP7h00VbpMGSXTbgvdajKIQgvlgez2RWQQ8OHRX6CTjWtIzmCtORJNq+8HbgtBGWN00 Yc4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@weissschuh.net header.s=mail header.b=cXLxS9hU; 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 5si11185700ejj.698.2021.10.02.07.01.38; Sat, 02 Oct 2021 07:02:37 -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=cXLxS9hU; 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 S233340AbhJBNo5 (ORCPT + 99 others); Sat, 2 Oct 2021 09:44:57 -0400 Received: from todd.t-8ch.de ([159.69.126.157]:54327 "EHLO todd.t-8ch.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233303AbhJBNo5 (ORCPT ); Sat, 2 Oct 2021 09:44:57 -0400 Date: Sat, 2 Oct 2021 15:43:08 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=weissschuh.net; s=mail; t=1633182188; bh=jW5plCRI73mha4Eov56nnBtenGpxY9DC383L16WZDM0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cXLxS9hUV0vZkZc9hjGSnPxKZ/fe/tOXaoiB2M+U33pcCh7xl1vY+TzJDLPZS3K8+ gnOTBGxSDgt6RF5bkt1eHE1vMrRBK36lHKu+5kqnmwCr/27CVV7MacppkpzRu80tNa ErVq8CUl6O1xJTIoQmx3DQSkQ0Byq9aKDZ4PHVAI= From: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= To: Guenter Roeck Cc: "Rafael J . Wysocki" , Wim Van Sebroeck , Mark Pearson , linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] watchdog: iTCO_wdt: Full reinitialize on resume Message-ID: References: <20210928165343.23401-1-linux@weissschuh.net> <20211002132303.GB4023280@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20211002132303.GB4023280@roeck-us.net> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-10-02T06:23-0700, Guenter Roeck wrote: > On Tue, Sep 28, 2021 at 06:53:43PM +0200, Thomas Weißschuh wrote: > > 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 > > The Fixes: tag references a SHA, not a bugzilla bug. Thanks, I'll change that for v2. > > 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 Is the current way with the dmi table the correct way to do it? I'm also CC-ing Mark Person from Lenovo who may be able to take a look and ask their firmware team to maybe fix this on their side. Thomas