diff -urN linux-2.6.25-gentoo-r9.orig/kernel/time/tick-broadcast.c linux-2.6.25-gentoo-r9/kernel/time/tick-broadcast.c --- linux-2.6.25-gentoo-r9.orig/kernel/time/tick-broadcast.c 2008-12-05 16:53:06.000000000 +0100 +++ linux-2.6.25-gentoo-r9/kernel/time/tick-broadcast.c 2008-12-05 17:03:52.000000000 +0100 @@ -209,7 +209,7 @@ struct clock_event_device *bc, *dev; struct tick_device *td; unsigned long flags, *reason = why; - int cpu, bc_stopped; + int cpu; spin_lock_irqsave(&tick_broadcast_lock, flags); @@ -227,8 +227,6 @@ if (!tick_device_is_functional(dev)) goto out; - bc_stopped = cpus_empty(tick_broadcast_mask); - switch (*reason) { case CLOCK_EVT_NOTIFY_BROADCAST_ON: case CLOCK_EVT_NOTIFY_BROADCAST_FORCE: @@ -250,10 +248,9 @@ break; } - if (cpus_empty(tick_broadcast_mask)) { - if (!bc_stopped) - clockevents_set_mode(bc, CLOCK_EVT_MODE_SHUTDOWN); - } else if (bc_stopped) { + if (cpus_empty(tick_broadcast_mask)) + clockevents_set_mode(bc, CLOCK_EVT_MODE_SHUTDOWN); + else { if (tick_broadcast_device.mode == TICKDEV_MODE_PERIODIC) tick_broadcast_start_periodic(bc); else @@ -490,52 +487,14 @@ cpu_clear(cpu, tick_broadcast_oneshot_mask); } -static void tick_broadcast_init_next_event(cpumask_t *mask, ktime_t expires) -{ - struct tick_device *td; - int cpu; - - for_each_cpu_mask(cpu, *mask) { - td = &per_cpu(tick_cpu_device, cpu); - if (td->evtdev) - td->evtdev->next_event = expires; - } -} - /** * tick_broadcast_setup_oneshot - setup the broadcast device */ void tick_broadcast_setup_oneshot(struct clock_event_device *bc) { - /* Set it up only once ! */ - if (bc->event_handler != tick_handle_oneshot_broadcast) { - int was_periodic = bc->mode == CLOCK_EVT_MODE_PERIODIC; - int cpu = smp_processor_id(); - cpumask_t mask; - - bc->event_handler = tick_handle_oneshot_broadcast; - clockevents_set_mode(bc, CLOCK_EVT_MODE_ONESHOT); - - /* Take the do_timer update */ - tick_do_timer_cpu = cpu; - - /* - * We must be careful here. There might be other CPUs - * waiting for periodic broadcast. We need to set the - * oneshot_mask bits for those and program the - * broadcast device to fire. - */ - mask = tick_broadcast_mask; - cpu_clear(cpu, mask); - cpus_or(tick_broadcast_oneshot_mask, - tick_broadcast_oneshot_mask, mask); - - if (was_periodic && !cpus_empty(mask)) { - tick_broadcast_init_next_event(&mask, tick_next_period); - tick_broadcast_set_event(tick_next_period, 1); - } else - bc->next_event.tv64 = KTIME_MAX; - } + bc->event_handler = tick_handle_oneshot_broadcast; + clockevents_set_mode(bc, CLOCK_EVT_MODE_ONESHOT); + bc->next_event.tv64 = KTIME_MAX; } /*