From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75AFBC432BE for ; Fri, 20 Aug 2021 13:45:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 57C30610CC for ; Fri, 20 Aug 2021 13:45:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240780AbhHTNqH (ORCPT ); Fri, 20 Aug 2021 09:46:07 -0400 Received: from thoth.sbs.de ([192.35.17.2]:42417 "EHLO thoth.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232209AbhHTNqF (ORCPT ); Fri, 20 Aug 2021 09:46:05 -0400 Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id 17KDj7Ds007907 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 Aug 2021 15:45:07 +0200 Received: from [167.87.0.29] ([167.87.0.29]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 17KDj6ZU022537; Fri, 20 Aug 2021 15:45:06 +0200 Subject: Re: [PATCH] watchdog: iTCO_wdt: Fix detection of SMI-off case From: Jan Kiszka To: Wim Van Sebroeck , Guenter Roeck Cc: linux-watchdog@vger.kernel.org, Linux Kernel Mailing List , Paolo Bonzini , Christian Storm , Andy Shevchenko , =?UTF-8?Q?Mantas_Mikul=c4=97nas?= References: Message-ID: <1444efd5-b778-949b-34e8-99d2541350e9@siemens.com> Date: Fri, 20 Aug 2021 15:45:06 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 26.07.21 13:46, Jan Kiszka wrote: > From: Jan Kiszka > > Obviously, the test needs to run against the register content, not its > address. > > Fixes: cb011044e34c ("watchdog: iTCO_wdt: Account for rebooting on second timeout") > Reported-by: Mantas Mikulėnas > Signed-off-by: Jan Kiszka > --- > drivers/watchdog/iTCO_wdt.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/watchdog/iTCO_wdt.c b/drivers/watchdog/iTCO_wdt.c > index b3f604669e2c..643c6c2d0b72 100644 > --- a/drivers/watchdog/iTCO_wdt.c > +++ b/drivers/watchdog/iTCO_wdt.c > @@ -362,7 +362,7 @@ static int iTCO_wdt_set_timeout(struct watchdog_device *wd_dev, unsigned int t) > * Otherwise, the BIOS generally reboots when the SMI triggers. > */ > if (p->smi_res && > - (SMI_EN(p) & (TCO_EN | GBL_SMI_EN)) != (TCO_EN | GBL_SMI_EN)) > + (inl(SMI_EN(p)) & (TCO_EN | GBL_SMI_EN)) != (TCO_EN | GBL_SMI_EN)) > tmrval /= 2; > > /* from the specs: */ > Ping, this is still missing in master. Stable kernels had the revert, but 5.14 will need this. Jan -- Siemens AG, T RDA IOT Corporate Competence Center Embedded Linux