Commit aaaf0698 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull timer fixes from Thomas Gleixner.

* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  tick: Fix the spurious broadcast timer ticks after resume
  tick: Ensure that the broadcast device is initialized
  tick: Fix oneshot broadcast setup really
parents 110a5c8b a6371f80
...@@ -346,7 +346,8 @@ int tick_resume_broadcast(void) ...@@ -346,7 +346,8 @@ int tick_resume_broadcast(void)
tick_get_broadcast_mask()); tick_get_broadcast_mask());
break; break;
case TICKDEV_MODE_ONESHOT: case TICKDEV_MODE_ONESHOT:
broadcast = tick_resume_broadcast_oneshot(bc); if (!cpumask_empty(tick_get_broadcast_mask()))
broadcast = tick_resume_broadcast_oneshot(bc);
break; break;
} }
} }
...@@ -373,6 +374,9 @@ static int tick_broadcast_set_event(ktime_t expires, int force) ...@@ -373,6 +374,9 @@ static int tick_broadcast_set_event(ktime_t expires, int force)
{ {
struct clock_event_device *bc = tick_broadcast_device.evtdev; struct clock_event_device *bc = tick_broadcast_device.evtdev;
if (bc->mode != CLOCK_EVT_MODE_ONESHOT)
clockevents_set_mode(bc, CLOCK_EVT_MODE_ONESHOT);
return clockevents_program_event(bc, expires, force); return clockevents_program_event(bc, expires, force);
} }
...@@ -531,7 +535,6 @@ void tick_broadcast_setup_oneshot(struct clock_event_device *bc) ...@@ -531,7 +535,6 @@ void tick_broadcast_setup_oneshot(struct clock_event_device *bc)
int was_periodic = bc->mode == CLOCK_EVT_MODE_PERIODIC; int was_periodic = bc->mode == CLOCK_EVT_MODE_PERIODIC;
bc->event_handler = tick_handle_oneshot_broadcast; bc->event_handler = tick_handle_oneshot_broadcast;
clockevents_set_mode(bc, CLOCK_EVT_MODE_ONESHOT);
/* Take the do_timer update */ /* Take the do_timer update */
tick_do_timer_cpu = cpu; tick_do_timer_cpu = cpu;
...@@ -549,6 +552,7 @@ void tick_broadcast_setup_oneshot(struct clock_event_device *bc) ...@@ -549,6 +552,7 @@ void tick_broadcast_setup_oneshot(struct clock_event_device *bc)
to_cpumask(tmpmask)); to_cpumask(tmpmask));
if (was_periodic && !cpumask_empty(to_cpumask(tmpmask))) { if (was_periodic && !cpumask_empty(to_cpumask(tmpmask))) {
clockevents_set_mode(bc, CLOCK_EVT_MODE_ONESHOT);
tick_broadcast_init_next_event(to_cpumask(tmpmask), tick_broadcast_init_next_event(to_cpumask(tmpmask),
tick_next_period); tick_next_period);
tick_broadcast_set_event(tick_next_period, 1); tick_broadcast_set_event(tick_next_period, 1);
...@@ -577,15 +581,10 @@ void tick_broadcast_switch_to_oneshot(void) ...@@ -577,15 +581,10 @@ void tick_broadcast_switch_to_oneshot(void)
raw_spin_lock_irqsave(&tick_broadcast_lock, flags); raw_spin_lock_irqsave(&tick_broadcast_lock, flags);
tick_broadcast_device.mode = TICKDEV_MODE_ONESHOT; tick_broadcast_device.mode = TICKDEV_MODE_ONESHOT;
if (cpumask_empty(tick_get_broadcast_mask()))
goto end;
bc = tick_broadcast_device.evtdev; bc = tick_broadcast_device.evtdev;
if (bc) if (bc)
tick_broadcast_setup_oneshot(bc); tick_broadcast_setup_oneshot(bc);
end:
raw_spin_unlock_irqrestore(&tick_broadcast_lock, flags); raw_spin_unlock_irqrestore(&tick_broadcast_lock, flags);
} }
......
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