ubus: update to latest version, includes a small bugfix for object call replies
[openwrt/staging/mkresin.git] / target / linux / lantiq / patches-3.0 / 991-fix-wdt-timeout.patch
1 From 14ea48a5f5702ddc97425cbe520600e187e14e4a Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Thu, 11 Aug 2011 13:58:39 +0200
4 Subject: [PATCH 03/16] MIPS: lantiq: fix watchdogs timeout handling
5
6 The enable function was using the global timeout variable for local operations.
7 This resulted in the value of the global variable being corrupted, thus
8 breaking the code.
9
10 Signed-off-by: John Crispin <blogic@openwrt.org>
11 Signed-off-by: Thomas Langer <thomas.langer@lantiq.com>
12 Cc: linux-watchdog@vger.kernel.org
13 Cc: linux-mips@linux-mips.org
14 ---
15 drivers/watchdog/lantiq_wdt.c | 8 ++++----
16 1 files changed, 4 insertions(+), 4 deletions(-)
17
18 --- a/drivers/watchdog/lantiq_wdt.c
19 +++ b/drivers/watchdog/lantiq_wdt.c
20 @@ -51,16 +51,16 @@ static int ltq_wdt_ok_to_close;
21 static void
22 ltq_wdt_enable(void)
23 {
24 - ltq_wdt_timeout = ltq_wdt_timeout *
25 + unsigned long int timeout = ltq_wdt_timeout *
26 (ltq_io_region_clk_rate / LTQ_WDT_DIVIDER) + 0x1000;
27 - if (ltq_wdt_timeout > LTQ_MAX_TIMEOUT)
28 - ltq_wdt_timeout = LTQ_MAX_TIMEOUT;
29 + if (timeout > LTQ_MAX_TIMEOUT)
30 + timeout = LTQ_MAX_TIMEOUT;
31
32 /* write the first password magic */
33 ltq_w32(LTQ_WDT_PW1, ltq_wdt_membase + LTQ_WDT_CR);
34 /* write the second magic plus the configuration and new timeout */
35 ltq_w32(LTQ_WDT_SR_EN | LTQ_WDT_SR_PWD | LTQ_WDT_SR_CLKDIV |
36 - LTQ_WDT_PW2 | ltq_wdt_timeout, ltq_wdt_membase + LTQ_WDT_CR);
37 + LTQ_WDT_PW2 | timeout, ltq_wdt_membase + LTQ_WDT_CR);
38 }
39
40 static void