Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 109641
b: refs/heads/master
c: 9c17bcd
h: refs/heads/master
i:
  109639: 6b8f6a2
v: v3
  • Loading branch information
Thomas Gleixner committed Sep 5, 2008
1 parent 13455d1 commit 4c2d436
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7205656ab48da29a95d7f55e43a81db755d3cb3a
refs/heads/master: 9c17bcda991000351cb2373f78be7e4b1c44caa3
20 changes: 13 additions & 7 deletions trunk/kernel/time/tick-broadcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ static void tick_do_broadcast_on_off(void *why)
struct clock_event_device *bc, *dev;
struct tick_device *td;
unsigned long flags, *reason = why;
int cpu;
int cpu, bc_stopped;

spin_lock_irqsave(&tick_broadcast_lock, flags);

Expand All @@ -228,6 +228,8 @@ static void tick_do_broadcast_on_off(void *why)
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:
Expand All @@ -250,9 +252,10 @@ static void tick_do_broadcast_on_off(void *why)
break;
}

if (cpus_empty(tick_broadcast_mask))
clockevents_set_mode(bc, CLOCK_EVT_MODE_SHUTDOWN);
else {
if (cpus_empty(tick_broadcast_mask)) {
if (!bc_stopped)
clockevents_set_mode(bc, CLOCK_EVT_MODE_SHUTDOWN);
} else if (bc_stopped) {
if (tick_broadcast_device.mode == TICKDEV_MODE_PERIODIC)
tick_broadcast_start_periodic(bc);
else
Expand Down Expand Up @@ -501,9 +504,12 @@ static void tick_broadcast_clear_oneshot(int cpu)
*/
void tick_broadcast_setup_oneshot(struct clock_event_device *bc)
{
bc->event_handler = tick_handle_oneshot_broadcast;
clockevents_set_mode(bc, CLOCK_EVT_MODE_ONESHOT);
bc->next_event.tv64 = KTIME_MAX;
/* Set it up only once ! */
if (bc->event_handler != tick_handle_oneshot_broadcast) {
bc->event_handler = tick_handle_oneshot_broadcast;
clockevents_set_mode(bc, CLOCK_EVT_MODE_ONESHOT);
bc->next_event.tv64 = KTIME_MAX;
}
}

/*
Expand Down

0 comments on commit 4c2d436

Please sign in to comment.