From 20396fc1509001613727e96c6c68530b8bd18dc5 Mon Sep 17 00:00:00 2001 From: Marius Strobl Date: Tue, 28 Mar 2006 20:25:46 +0000 Subject: [PATCH] - Move the check for too high HZ values from tick_init() to tick_start() as we have to call tick_init() before cninit() in order to provide the low-level console drivers with a working DELAY() which in turn means we cannot use panic() in tick_init(). - s,to high, too high, in the panic string Inspired by: kmacy's sun4v changes MFC after: 3 days --- sys/sparc64/sparc64/tick.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/sys/sparc64/sparc64/tick.c b/sys/sparc64/sparc64/tick.c index 61f3baef1f36..d246dca95d97 100644 --- a/sys/sparc64/sparc64/tick.c +++ b/sys/sparc64/sparc64/tick.c @@ -146,13 +146,6 @@ tick_init(u_long clock) tick_freq = clock; tick_MHz = clock / 1000000; tick_increment = clock / hz; - /* - * Avoid stopping of hardclock in terms of a lost tick interrupt - * by ensuring that the tick period is at least TICK_GRACE ticks. - */ - if (tick_increment < TICK_GRACE) - panic("%s: HZ to high, decrease to at least %ld", __func__, - clock / TICK_GRACE); /* * UltraSparc II[e,i] based systems come up with the tick interrupt @@ -172,6 +165,18 @@ tick_start(void) { u_long base, s; + /* + * Avoid stopping of hardclock in terms of a lost tick interrupt + * by ensuring that the tick period is at least TICK_GRACE ticks. + * This check would be better placed in tick_init(), however we + * have to call tick_init() before cninit() in order to provide + * the low-level console drivers with a working DELAY() which in + * turn means we cannot use panic() in tick_init(). + */ + if (tick_increment < TICK_GRACE) + panic("%s: HZ too high, decrease to at least %ld", __func__, + tick_freq / TICK_GRACE); + if (PCPU_GET(cpuid) == 0) intr_setup(PIL_TICK, tick_hardclock, -1, NULL, NULL);