X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=arch%2Fparisc%2Fkernel%2Ftime.c;h=24be86bba94d6bdf93618109bb490bf6fbe68205;hb=551395ae667d699189014f762355e9131fc03e79;hp=e47e27cea42ea97002fd724f871abf88fb4bfea5;hpb=12df29b64c782133afea8cacc6acdad68a6b7d17;p=linux-2.6 diff --git a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c index e47e27cea4..24be86bba9 100644 --- a/arch/parisc/kernel/time.c +++ b/arch/parisc/kernel/time.c @@ -99,7 +99,7 @@ irqreturn_t timer_interrupt(int irq, void *dev_id) * cycles after the IT fires. But it's arbitrary how much time passes * before we call it "late". I've picked one second. */ - if (ticks_elapsed > HZ) { + if (unlikely(ticks_elapsed > HZ)) { /* Scenario 3: very long delay? bad in any case */ printk (KERN_CRIT "timer_interrupt(CPU %d): delayed!" " cycles %lX rem %lX " @@ -148,10 +148,6 @@ irqreturn_t timer_interrupt(int irq, void *dev_id) write_sequnlock(&xtime_lock); } - /* check soft power switch status */ - if (cpu == 0 && !atomic_read(&power_tasklet.count)) - tasklet_schedule(&power_tasklet); - return IRQ_HANDLED; } @@ -187,20 +183,27 @@ static struct clocksource clocksource_cr16 = { .mask = CLOCKSOURCE_MASK(BITS_PER_LONG), .mult = 0, /* to be set */ .shift = 22, - .is_continuous = 1, + .flags = CLOCK_SOURCE_IS_CONTINUOUS, }; +#ifdef CONFIG_SMP +int update_cr16_clocksource(void) +{ + /* since the cr16 cycle counters are not synchronized across CPUs, + we'll check if we should switch to a safe clocksource: */ + if (clocksource_cr16.rating != 0 && num_online_cpus() > 1) { + clocksource_change_rating(&clocksource_cr16, 0); + return 1; + } -/* - * XXX: We can do better than this. - * Returns nanoseconds - */ - -unsigned long long sched_clock(void) + return 0; +} +#else +int update_cr16_clocksource(void) { - return (unsigned long long)jiffies * (1000000000 / HZ); + return 0; /* no change */ } - +#endif /*CONFIG_SMP*/ void __init start_cpu_itimer(void) { @@ -225,10 +228,6 @@ void __init time_init(void) current_cr16_khz = PAGE0->mem_10msec/10; /* kHz */ clocksource_cr16.mult = clocksource_khz2mult(current_cr16_khz, clocksource_cr16.shift); - /* lower the rating if we already know its unstable: */ - if (num_online_cpus()>1) - clocksource_cr16.rating = 200; - clocksource_register(&clocksource_cr16); if (pdc_tod_read(&tod_data) == 0) {