Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1103394pxa; Thu, 20 Aug 2020 02:32:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZ88qsci3BOKd0l4YpDTJciIa93Mds/Q/NtyqbvtuC33nmh2n2YD6M7RO/MSFgLnHpMurf X-Received: by 2002:a05:6402:896:: with SMTP id e22mr2088169edy.210.1597915968339; Thu, 20 Aug 2020 02:32:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597915968; cv=none; d=google.com; s=arc-20160816; b=YOYwKaM4uRb9SZR4jNy3XmKE1wYQCvIYa+0nNz2dbmleStVj+wTDqciKIrOb1ED2ko RAlTUkGjddcVgZ5yoIyDwd05va4QMju3G5sWQ2t54MbMYpHqKHtzoWcOnDhSfTlr9NT6 eVdRFx6TrxKDBrtavQGBHQ9Y1uXcSPMmfJlu9YIuC4Q4ZIdlvAfpyh+oQCjfpsC09sYj VzsLw0q2gSiOeTeKto/NuoLQNvEQ4a489EJsJfhLOhNaWXBky46AcUNtdHcaJf8E2YzJ YUW/PDajYub61QcRUbYoI0NsV1Ym/hQuXRfl48fMibBNTIIb2n4F30sDMBKWlvq2d97X hWXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=u9v05Aid+hXuI9WOLOPlyh6AHnSIU8PWhhYSqBN7UUw=; b=SRbtAP58y05OSyd1u0FPiYemTaTAPtD876ok2SfoPH1vKaww9XnrGEryUO3ppxMe11 nVmeNUB+2J7K5gehR0dGJSBZSo4fl20IaA2rA6i5g5l0lk5hkuvHDKE/sPJ1KkAZePwO Ua9kIdLanhUXMuvpkCiwO1XWqJguIO34uMv2ywRf+ZGeLRoTW8dNcwtABF0SzlWzciAM hiB8IIrVXdJxs2GtaJAlGHrl+5R0Q6wYnIYoAdxbXmHswtlScICpXU0+Bu9AzITla0Ct PbRcg3s0LWESUt1Dj9ZvaYjIaAF0GtBDXmh8Za8BFbqdwzLNm8uZSeWrC1UAq81q05Q5 ahzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fc4YBdMT; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t23si993861edc.163.2020.08.20.02.32.24; Thu, 20 Aug 2020 02:32:48 -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=pass header.i=@kernel.org header.s=default header.b=fc4YBdMT; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728122AbgHTJ3w (ORCPT + 99 others); Thu, 20 Aug 2020 05:29:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:39544 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728030AbgHTJ3L (ORCPT ); Thu, 20 Aug 2020 05:29:11 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A14CF21744; Thu, 20 Aug 2020 09:29:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597915751; bh=Jen+qfOZNmYM0kSGwzovdZBTZXKl8VbilUIN2LKYbyg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fc4YBdMT2Fqcelr5PzAAPc0b98nnN9fjXSIY5mckynUfi9gZbMGPD8jg/BkeW+2vy EgyukgnhaLqg0znCllSwORIALjTH51H7eRKWurka4v2IkqpIxoCjmlRCmlpOrgWPYy FfYpsgwFBS1FlEA0rHqt9Do8QfMAEVbm29+eAans= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ahmad Fatoum , Guenter Roeck , Wim Van Sebroeck Subject: [PATCH 5.8 094/232] watchdog: f71808e_wdt: clear watchdog timeout occurred flag Date: Thu, 20 Aug 2020 11:19:05 +0200 Message-Id: <20200820091617.390038716@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091612.692383444@linuxfoundation.org> References: <20200820091612.692383444@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ahmad Fatoum commit 4f39d575844148fbf3081571a1f3b4ae04150958 upstream. The flag indicating a watchdog timeout having occurred normally persists till Power-On Reset of the Fintek Super I/O chip. The user can clear it by writing a `1' to the bit. The driver doesn't offer a restart method, so regular system reboot might not reset the Super I/O and if the watchdog isn't enabled, we won't touch the register containing the bit on the next boot. In this case all subsequent regular reboots will be wrongly flagged by the driver as being caused by the watchdog. Fix this by having the flag cleared after read. This is also done by other drivers like those for the i6300esb and mpc8xxx_wdt. Fixes: b97cb21a4634 ("watchdog: f71808e_wdt: Fix WDTMOUT_STS register read") Cc: stable@vger.kernel.org Signed-off-by: Ahmad Fatoum Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20200611191750.28096-5-a.fatoum@pengutronix.de Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck Signed-off-by: Greg Kroah-Hartman --- drivers/watchdog/f71808e_wdt.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/drivers/watchdog/f71808e_wdt.c +++ b/drivers/watchdog/f71808e_wdt.c @@ -706,6 +706,13 @@ static int __init watchdog_init(int sioa wdt_conf = superio_inb(sioaddr, F71808FG_REG_WDT_CONF); watchdog.caused_reboot = wdt_conf & BIT(F71808FG_FLAG_WDTMOUT_STS); + /* + * We don't want WDTMOUT_STS to stick around till regular reboot. + * Write 1 to the bit to clear it to zero. + */ + superio_outb(sioaddr, F71808FG_REG_WDT_CONF, + wdt_conf | BIT(F71808FG_FLAG_WDTMOUT_STS)); + superio_exit(sioaddr); err = watchdog_set_timeout(timeout);