Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: David 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: Wim Van Sebroeck <wim@iguana.be>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

David Daney and committed by
Ralf Baechle
468ffde4 1fa25ab2

+2 -2
+2 -2
drivers/watchdog/octeon-wdt-main.c
··· 478 478 479 479 countdown_reset = periods > 2 ? periods - 2 : 0; 480 480 heartbeat = t; 481 - timeout_cnt = ((octeon_get_clock_rate() >> 8) * timeout_sec) >> 8; 481 + timeout_cnt = ((octeon_get_io_clock_rate() >> 8) * timeout_sec) >> 8; 482 482 } 483 483 484 484 static int octeon_wdt_set_heartbeat(int t) ··· 677 677 max_timeout_sec = 6; 678 678 do { 679 679 max_timeout_sec--; 680 - timeout_cnt = ((octeon_get_clock_rate() >> 8) * max_timeout_sec) >> 8; 680 + timeout_cnt = ((octeon_get_io_clock_rate() >> 8) * max_timeout_sec) >> 8; 681 681 } while (timeout_cnt > 65535); 682 682 683 683 BUG_ON(timeout_cnt == 0);