linux-mips
[Top] [All Lists]

[PATCH 1/6] MIPS: ath79: fix ar933x watchdog clock

To: Ralf Baechle <ralf@linux-mips.org>
Subject: [PATCH 1/6] MIPS: ath79: fix ar933x watchdog clock
From: Gabor Juhos <juhosg@openwrt.org>
Date: Wed, 28 Aug 2013 10:41:42 +0200
Cc: linux-mips@linux-mips.org, Felix Fietkau <nbd@openwrt.org>, stable@vger.kernel.org, Gabor Juhos <juhosg@openwrt.org>
In-reply-to: <1377679307-429-1-git-send-email-juhosg@openwrt.org>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1377679307-429-1-git-send-email-juhosg@openwrt.org>
Sender: linux-mips-bounce@linux-mips.org
From: Felix Fietkau <nbd@openwrt.org>

The watchdog device on the AR933x is connected to
the AHB clock, however the current code uses the
reference clock. Due to the wrong rate, the watchdog
driver can't calculate correct register values for
a given timeout value and the watchdog unexpectedly
restarts the system.

The code uses the wrong value since the initial
commit 04225e1d227c8e68d685936ecf42ac175fec0e54
(MIPS: ath79: add AR933X specific clock init)

The patch fixes the code to use the correct clock
rate to avoid the problem.

Cc: stable@vger.kernel.org
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
 arch/mips/ath79/clock.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/ath79/clock.c b/arch/mips/ath79/clock.c
index 765ef30..733017b 100644
--- a/arch/mips/ath79/clock.c
+++ b/arch/mips/ath79/clock.c
@@ -164,7 +164,7 @@ static void __init ar933x_clocks_init(void)
                ath79_ahb_clk.rate = freq / t;
        }
 
-       ath79_wdt_clk.rate = ath79_ref_clk.rate;
+       ath79_wdt_clk.rate = ath79_ahb_clk.rate;
        ath79_uart_clk.rate = ath79_ref_clk.rate;
 }
 
-- 
1.7.10

<Prev in Thread] Current Thread [Next in Thread>