From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:40450 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751340AbdJLL5z (ORCPT ); Thu, 12 Oct 2017 07:57:55 -0400 Subject: Patch "watchdog: Revert "iTCO_wdt: all versions count down twice"" has been added to the 4.13-stable tree To: wim@iguana.be, gregkh@linuxfoundation.org, mwilck@suse.com, pbonzini@redhat.com Cc: , From: Date: Thu, 12 Oct 2017 13:58:02 +0200 Message-ID: <150780948212327@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled watchdog: Revert "iTCO_wdt: all versions count down twice" to the 4.13-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: watchdog-revert-itco_wdt-all-versions-count-down-twice.patch and it can be found in the queue-4.13 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From fc61e83a29308601e6e8a0759e24fc8fe2122692 Mon Sep 17 00:00:00 2001 From: Wim Van Sebroeck Date: Sat, 9 Sep 2017 17:41:24 +0200 Subject: watchdog: Revert "iTCO_wdt: all versions count down twice" From: Wim Van Sebroeck commit fc61e83a29308601e6e8a0759e24fc8fe2122692 upstream. This reverts commit 1fccb73011ea8a5fa0c6d357c33fa29c695139ea. Reported as Bug 196509 - iTCO_wdt regression reboot before timeout expire Signed-off-by: Wim Van Sebroeck Cc: Martin Wilck Cc: Paolo Bonzini Signed-off-by: Greg Kroah-Hartman --- Documentation/watchdog/watchdog-parameters.txt | 2 +- drivers/watchdog/iTCO_wdt.c | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) --- a/Documentation/watchdog/watchdog-parameters.txt +++ b/Documentation/watchdog/watchdog-parameters.txt @@ -117,7 +117,7 @@ nowayout: Watchdog cannot be stopped onc ------------------------------------------------- iTCO_wdt: heartbeat: Watchdog heartbeat in seconds. - (5<=heartbeat<=74 (TCO v1) or 1226 (TCO v2), default=30) + (2smi_res, wd_dev->timeout); - /* Reset the timeout status bit so that the timer - * needs to count down twice again before rebooting */ - outw(0x0008, TCO1_STS(p)); /* write 1 to clear bit */ - /* Reload the timer by writing to the TCO Timer Counter register */ - if (p->iTCO_version >= 2) + if (p->iTCO_version >= 2) { outw(0x01, TCO_RLD(p)); - else if (p->iTCO_version == 1) + } else if (p->iTCO_version == 1) { + /* Reset the timeout status bit so that the timer + * needs to count down twice again before rebooting */ + outw(0x0008, TCO1_STS(p)); /* write 1 to clear bit */ + outb(0x01, TCO_RLD(p)); + } spin_unlock(&p->io_lock); return 0; @@ -327,8 +328,11 @@ static int iTCO_wdt_set_timeout(struct w unsigned char val8; unsigned int tmrval; - /* The timer counts down twice before rebooting */ - tmrval = seconds_to_ticks(p, t) / 2; + tmrval = seconds_to_ticks(p, t); + + /* For TCO v1 the timer counts down twice before rebooting */ + if (p->iTCO_version == 1) + tmrval /= 2; /* from the specs: */ /* "Values of 0h-3h are ignored and should not be attempted" */ @@ -381,8 +385,6 @@ static unsigned int iTCO_wdt_get_timelef spin_lock(&p->io_lock); val16 = inw(TCO_RLD(p)); val16 &= 0x3ff; - if (!(inw(TCO1_STS(p)) & 0x0008)) - val16 += (inw(TCOv2_TMR(p)) & 0x3ff); spin_unlock(&p->io_lock); time_left = ticks_to_seconds(p, val16); Patches currently in stable-queue which might be from wim@iguana.be are queue-4.13/watchdog-revert-itco_wdt-all-versions-count-down-twice.patch