Commit 468ffde4 authored by David Daney's avatar David Daney Committed by Ralf Baechle

WATCHDOG: octeon-wdt: Use I/O clock rate for timing calculations.

The creation of the I/O clock domain requires some adjustments.  Since
the watchdog counters are clocked by the I/O clock, use its rate for
timing calculations.
Signed-off-by: default avatarDavid Daney <ddaney@caviumnetworks.com>
Cc: Wim Van Sebroeck <wim@iguana.be>
Cc: linux-watchdog@vger.kernel.org
Patchwork: http://patchwork.linux-mips.org/patch/1659/Acked-by: default avatarWim Van Sebroeck <wim@iguana.be>
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 1fa25ab2
...@@ -478,7 +478,7 @@ static void octeon_wdt_calc_parameters(int t) ...@@ -478,7 +478,7 @@ static void octeon_wdt_calc_parameters(int t)
countdown_reset = periods > 2 ? periods - 2 : 0; countdown_reset = periods > 2 ? periods - 2 : 0;
heartbeat = t; heartbeat = t;
timeout_cnt = ((octeon_get_clock_rate() >> 8) * timeout_sec) >> 8; timeout_cnt = ((octeon_get_io_clock_rate() >> 8) * timeout_sec) >> 8;
} }
static int octeon_wdt_set_heartbeat(int t) static int octeon_wdt_set_heartbeat(int t)
...@@ -677,7 +677,7 @@ static int __init octeon_wdt_init(void) ...@@ -677,7 +677,7 @@ static int __init octeon_wdt_init(void)
max_timeout_sec = 6; max_timeout_sec = 6;
do { do {
max_timeout_sec--; max_timeout_sec--;
timeout_cnt = ((octeon_get_clock_rate() >> 8) * max_timeout_sec) >> 8; timeout_cnt = ((octeon_get_io_clock_rate() >> 8) * max_timeout_sec) >> 8;
} while (timeout_cnt > 65535); } while (timeout_cnt > 65535);
BUG_ON(timeout_cnt == 0); BUG_ON(timeout_cnt == 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment