Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:55810 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752590AbcJENXX (ORCPT ); Wed, 5 Oct 2016 09:23:23 -0400 Subject: Patch "watchdog: core: Clear WDOG_HW_RUNNING before calling the stop function" has been added to the 4.7-stable tree To: linux@roeck-us.net, gregkh@linuxfoundation.org, rasmus.villemoes@prevas.dk, wim@iguana.be Cc: , From: Date: Wed, 05 Oct 2016 15:20:52 +0200 Message-ID: <147567365221880@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: core: Clear WDOG_HW_RUNNING before calling the stop function to the 4.7-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-core-clear-wdog_hw_running-before-calling-the-stop-function.patch and it can be found in the queue-4.7 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From 3c10bbde10fe4dca52726e246cefa6b0a1dfbd3e Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Thu, 21 Jul 2016 14:21:56 -0700 Subject: watchdog: core: Clear WDOG_HW_RUNNING before calling the stop function From: Guenter Roeck commit 3c10bbde10fe4dca52726e246cefa6b0a1dfbd3e upstream. WDOG_HW_RUNNING indicates that the hardware watchdog is running while the watchdog device is closed. The flag may be set by the driver when it is instantiated to indicate that the watchdog is running, and that the watchdog core needs to send heartbeat requests to the driver until the watchdog device is opened. When the watchdog device is closed, the flag can be used by the driver's stop function to indicate to the watchdog core that it was unable to stop the watchdog, and that the watchdog core needs to send heartbeat requests. This only works if the flag is actually cleared when the watchdog is stopped. To avoid having to clear the flag in each driver's stop function, clear it in the watchdog core before calling the stop function. Reported-by: Rasmus Villemoes Fixes: ee142889e32f ("watchdog: Introduce WDOG_HW_RUNNING flag") Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck Signed-off-by: Greg Kroah-Hartman --- drivers/watchdog/watchdog_dev.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/drivers/watchdog/watchdog_dev.c +++ b/drivers/watchdog/watchdog_dev.c @@ -258,10 +258,12 @@ static int watchdog_stop(struct watchdog return -EBUSY; } - if (wdd->ops->stop) + if (wdd->ops->stop) { + clear_bit(WDOG_HW_RUNNING, &wdd->status); err = wdd->ops->stop(wdd); - else + } else { set_bit(WDOG_HW_RUNNING, &wdd->status); + } if (err == 0) { clear_bit(WDOG_ACTIVE, &wdd->status); Patches currently in stable-queue which might be from linux@roeck-us.net are queue-4.7/watchdog-core-clear-wdog_hw_running-before-calling-the-stop-function.patch queue-4.7/hwmon-adt7411-set-bit-3-in-cfg1-register.patch queue-4.7/nvmem-declare-nvmem_cell_read-consistently.patch