Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2832341pxb; Mon, 1 Nov 2021 02:47:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUwX/Z1eW5QhRXlIw7BJ/aMLVYATiyvFzzIoOuNbO5rhoVteoFaaHnrWeBQYJ6fCG0wO8D X-Received: by 2002:a05:6602:2d0a:: with SMTP id c10mr6942768iow.186.1635760022565; Mon, 01 Nov 2021 02:47:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635760022; cv=none; d=google.com; s=arc-20160816; b=hLux3dLIia0Ualp++lGqHrjpl1IoxfknB9GEZ5ak0tuGw5LcMt5qow+WPK5oSxHkba 5lIdMKgVrhi9Br9qcsggPDz4uNPniIK4py4M22FMdKt3MAtxshY6zxHfpKv09J3vEVoM 8ZuB3KYyLhxgBsVPxOH9308d+sLe0TKmLbXCNRN0AMUkMhZ/d4HzB/zxTdAhb/+IUhre TW9ePW8fjC0CEVk7mxW2e1j1A4YZ8rWjU+R9IlEC33cD7iVVAxy8pRLqHKJN1/jQkf71 aiqReqUF7CfAYoS0pFwEwFyWzAj9IWXdoA0l47qhZaSFuFTbul4UuyVqHS2/S1CfdqTA O0cQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=HP4rqQxWw/4JYmwe0YbWfm6rzfM6qkA6lI8DG+mVzns=; b=rKPukym8Z0mQ15AfxYPdBsjXKRC0RHPoe5x0CPyFWWRVVoX+Q4qj9j87QqRiTGZ+Lp C4U7L7Al+ZthdOVRdwcrw0ZyGlh4UoeyLkApbuBXspNl56LbOOUmN3IBLiw8u76GFzXi uJx6JzoyLpj3NBHaaiH5+5JWrjY6leHbj6DFbqgAWH0Ycx81zJSUZMMTOTfcox8D1q/Y TpViyJkqjWUt8PeQsEQlC7yg1DaYl0i99878SzpM2MF1Da9mnIUrrU5flMX6tzAkfN0Z pn06/wPbIfzA8xQQ9HT4lLOCIQw+F0ReECrvyWrvDUNQFj9V86VjYbVW1rqKg2JAnEwL Fi7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="WRWpA/n5"; 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=pass (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 u15si17450160iot.89.2021.11.01.02.46.51; Mon, 01 Nov 2021 02:47:02 -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=@linuxfoundation.org header.s=korg header.b="WRWpA/n5"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233919AbhKAJrs (ORCPT + 99 others); Mon, 1 Nov 2021 05:47:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:48026 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234071AbhKAJoD (ORCPT ); Mon, 1 Nov 2021 05:44:03 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 98ACB613A4; Mon, 1 Nov 2021 09:29:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1635758966; bh=lupnL6TaCmkoQPb3WZhdGjlX6X2St7+f5b1FvgLxB1M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WRWpA/n5v4lS4hEqXKFKU5TdilRzPZsYPnQaIlWPTVA1FknbBkquE/gWnMivIOsrW TbxeypDKpeOJy+H61sE9NU/w12qFZZm6vFdRzSYbQUZ3mZeUDtreZyJx6ygMf5MDDe wTZFrFeMr+e33uHk5OPmX+/rWbU+y1TmvBz1fZUI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jan Kiszka , =?UTF-8?q?Mantas=20Mikul=C4=97nas?= , "Javier S. Pedro" , Guenter Roeck , Wim Van Sebroeck Subject: [PATCH 5.14 057/125] Revert "watchdog: iTCO_wdt: Account for rebooting on second timeout" Date: Mon, 1 Nov 2021 10:17:10 +0100 Message-Id: <20211101082543.957189543@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211101082533.618411490@linuxfoundation.org> References: <20211101082533.618411490@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Guenter Roeck commit 6e7733ef0bb9372d5491168635f6ecba8ac3cb8a upstream. This reverts commit cb011044e34c ("watchdog: iTCO_wdt: Account for rebooting on second timeout") and commit aec42642d91f ("watchdog: iTCO_wdt: Fix detection of SMI-off case") since those patches cause a regression on certain boards (https://bugzilla.kernel.org/show_bug.cgi?id=213809). While this revert may result in some boards to only reset after twice the configured timeout value, that is still better than a watchdog reset after half the configured value. Fixes: cb011044e34c ("watchdog: iTCO_wdt: Account for rebooting on second timeout") Fixes: aec42642d91f ("watchdog: iTCO_wdt: Fix detection of SMI-off case") Cc: Jan Kiszka Cc: Mantas Mikulėnas Reported-by: Javier S. Pedro Signed-off-by: Guenter Roeck Link: https://lore.kernel.org/r/20211008003302.1461733-1-linux@roeck-us.net Signed-off-by: Wim Van Sebroeck Signed-off-by: Greg Kroah-Hartman --- drivers/watchdog/iTCO_wdt.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) --- a/drivers/watchdog/iTCO_wdt.c +++ b/drivers/watchdog/iTCO_wdt.c @@ -71,8 +71,6 @@ #define TCOBASE(p) ((p)->tco_res->start) /* SMI Control and Enable Register */ #define SMI_EN(p) ((p)->smi_res->start) -#define TCO_EN (1 << 13) -#define GBL_SMI_EN (1 << 0) #define TCO_RLD(p) (TCOBASE(p) + 0x00) /* TCO Timer Reload/Curr. Value */ #define TCOv1_TMR(p) (TCOBASE(p) + 0x01) /* TCOv1 Timer Initial Value*/ @@ -357,12 +355,8 @@ static int iTCO_wdt_set_timeout(struct w tmrval = seconds_to_ticks(p, t); - /* - * If TCO SMIs are off, the timer counts down twice before rebooting. - * Otherwise, the BIOS generally reboots when the SMI triggers. - */ - if (p->smi_res && - (inl(SMI_EN(p)) & (TCO_EN | GBL_SMI_EN)) != (TCO_EN | GBL_SMI_EN)) + /* For TCO v1 the timer counts down twice before rebooting */ + if (p->iTCO_version == 1) tmrval /= 2; /* from the specs: */ @@ -527,7 +521,7 @@ static int iTCO_wdt_probe(struct platfor * Disables TCO logic generating an SMI# */ val32 = inl(SMI_EN(p)); - val32 &= ~TCO_EN; /* Turn off SMI clearing watchdog */ + val32 &= 0xffffdfff; /* Turn off SMI clearing watchdog */ outl(val32, SMI_EN(p)); }