Commit aea2fef4 authored by David S. Miller's avatar David S. Miller

[SPARC64]: Start timer tick after interpolator is registered.

Else we risk an OOPS.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 730c61f2
...@@ -910,10 +910,10 @@ void __init clock_probe(void) ...@@ -910,10 +910,10 @@ void __init clock_probe(void)
} }
/* This is gets the master TICK_INT timer going. */ /* This is gets the master TICK_INT timer going. */
static unsigned long sparc64_init_timers(irqreturn_t (*cfunc)(int, void *, struct pt_regs *)) static unsigned long sparc64_init_timers(void)
{ {
unsigned long pstate, clock; unsigned long clock;
int node, err; int node;
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
extern void smp_tick_init(void); extern void smp_tick_init(void);
#endif #endif
...@@ -946,6 +946,14 @@ static unsigned long sparc64_init_timers(irqreturn_t (*cfunc)(int, void *, struc ...@@ -946,6 +946,14 @@ static unsigned long sparc64_init_timers(irqreturn_t (*cfunc)(int, void *, struc
smp_tick_init(); smp_tick_init();
#endif #endif
return clock;
}
static void sparc64_start_timers(irqreturn_t (*cfunc)(int, void *, struct pt_regs *))
{
unsigned long pstate;
int err;
/* Register IRQ handler. */ /* Register IRQ handler. */
err = request_irq(build_irq(0, 0, 0UL, 0UL), cfunc, SA_STATIC_ALLOC, err = request_irq(build_irq(0, 0, 0UL, 0UL), cfunc, SA_STATIC_ALLOC,
"timer", NULL); "timer", NULL);
...@@ -971,8 +979,6 @@ static unsigned long sparc64_init_timers(irqreturn_t (*cfunc)(int, void *, struc ...@@ -971,8 +979,6 @@ static unsigned long sparc64_init_timers(irqreturn_t (*cfunc)(int, void *, struc
: "r" (pstate)); : "r" (pstate));
local_irq_enable(); local_irq_enable();
return clock;
} }
struct freq_table { struct freq_table {
...@@ -1036,11 +1042,16 @@ static struct time_interpolator sparc64_cpu_interpolator = { ...@@ -1036,11 +1042,16 @@ static struct time_interpolator sparc64_cpu_interpolator = {
#define SPARC64_NSEC_PER_CYC_SHIFT 30UL #define SPARC64_NSEC_PER_CYC_SHIFT 30UL
void __init time_init(void) void __init time_init(void)
{ {
unsigned long clock = sparc64_init_timers(timer_interrupt); unsigned long clock = sparc64_init_timers();
sparc64_cpu_interpolator.frequency = clock; sparc64_cpu_interpolator.frequency = clock;
register_time_interpolator(&sparc64_cpu_interpolator); register_time_interpolator(&sparc64_cpu_interpolator);
/* Now that the interpolator is registered, it is
* safe to start the timer ticking.
*/
sparc64_start_timers(timer_interrupt);
timer_ticks_per_nsec_quotient = timer_ticks_per_nsec_quotient =
(((NSEC_PER_SEC << SPARC64_NSEC_PER_CYC_SHIFT) + (((NSEC_PER_SEC << SPARC64_NSEC_PER_CYC_SHIFT) +
(clock / 2)) / clock); (clock / 2)) / clock);
......
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