Skip to contentSkip to conversation

Patch "watchdog: omap: assert the counter being stopped before reprogramming" has been added to the 3.14-stable tree

PATCH [email protected] 1 participant 1 message Jul 31, 2015

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

watchdog: omap: assert the counter being stopped before reprogramming

to the 3.14-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-omap-assert-the-counter-being-stopped-before-reprogramming.patch
and it can be found in the queue-3.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 530c11d432727c697629ad5f9d00ee8e2864d453 Mon Sep 17 00:00:00 2001

From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <[email protected]>
Date: Wed, 29 Apr 2015 20:38:46 +0200
Subject: watchdog: omap: assert the counter being stopped before reprogramming
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <[email protected]>

commit 530c11d432727c697629ad5f9d00ee8e2864d453 upstream.

The omap watchdog has the annoying behaviour that writes to most registers don't have any effect when the watchdog is already running. Quoting the AM335x reference manual:

To modify the timer counter value (the WDT_WCRR register), prescaler ratio (the WDT_WCLR[4:2] PTV bit field), delay configuration value (the WDT_WDLY[31:0] DLY_VALUE bit field), or the load value (the WDT_WLDR[31:0] TIMER_LOAD bit field), the watchdog timer must be disabled by using the start/stop sequence (the WDT_WSPR register).

Currently the timer is stopped in the .probe callback but still there are possibilities that yield to a situation where omap_wdt_start is entered with the timer running (e.g. when /dev/watchdog is closed without stopping and then reopened). In such a case programming the timeout silently fails!

To circumvent this stop the timer before reprogramming.

Assuming one of the first things the watchdog user does is setting the timeout explicitly nothing too bad should happen because this explicit setting works fine.

Fixes 7768a13c252a ("[PATCH] OMAP: Add Watchdog driver support")
---
 drivers/watchdog/omap_wdt.c |    7 +++++++
 1 file changed, 7 insertions(+)
drivers/watchdog/omap_wdt.c +7 -0
@@ -134,6 +134,13 @@ static int omap_wdt_start(struct watchdo
 
 	pm_runtime_get_sync(wdev->dev);
 
+	/*
+	 * Make sure the watchdog is disabled. This is unfortunately required
+	 * because writing to various registers with the watchdog running has no
+	 * effect.
+	 */
+	omap_wdt_disable(wdev);
+
 	/* initialize prescaler */
 	while (readl_relaxed(base + OMAP_WATCHDOG_WPS) & 0x01)
 		cpu_relax();

Patches currently in stable-queue which might be from [email protected] are

queue-3.14/mtd-nand-don-t-use-read_buf-for-8-bit-onfi-transfers.patch queue-3.14/mtd-dc21285-use-raw-spinlock-functions-for-nw_gpio_lock.patch queue-3.14/watchdog-omap-assert-the-counter-being-stopped-before-reprogramming.patch