Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 109886
b: refs/heads/master
c: 2344abb
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Gleixner committed Sep 16, 2008
1 parent 8402a51 commit a74999f
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 9 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: f1926ce63b996b42772b39e4b47bb4ef4ba748b4
refs/heads/master: 2344abbcbdb82140050e8be29d3d55e4f6fe860b
12 changes: 11 additions & 1 deletion trunk/kernel/time/clockevents.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@ void clockevents_set_mode(struct clock_event_device *dev,
}
}

/**
* clockevents_shutdown - shutdown the device and clear next_event
* @dev: device to shutdown
*/
void clockevents_shutdown(struct clock_event_device *dev)
{
clockevents_set_mode(dev, CLOCK_EVT_MODE_SHUTDOWN);
dev->next_event.tv64 = KTIME_MAX;
}

/**
* clockevents_program_event - Reprogram the clock event device.
* @expires: absolute expiry time (monotonic clock)
Expand Down Expand Up @@ -206,7 +216,7 @@ void clockevents_exchange_device(struct clock_event_device *old,

if (new) {
BUG_ON(new->mode != CLOCK_EVT_MODE_UNUSED);
clockevents_set_mode(new, CLOCK_EVT_MODE_SHUTDOWN);
clockevents_shutdown(new);
}
local_irq_restore(flags);
}
Expand Down
9 changes: 4 additions & 5 deletions trunk/kernel/time/tick-broadcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,7 @@ static void tick_do_broadcast_on_off(void *why)
if (!cpu_isset(cpu, tick_broadcast_mask)) {
cpu_set(cpu, tick_broadcast_mask);
if (td->mode == TICKDEV_MODE_PERIODIC)
clockevents_set_mode(dev,
CLOCK_EVT_MODE_SHUTDOWN);
clockevents_shutdown(dev);
}
if (*reason == CLOCK_EVT_NOTIFY_BROADCAST_FORCE)
tick_broadcast_force = 1;
Expand All @@ -254,7 +253,7 @@ static void tick_do_broadcast_on_off(void *why)

if (cpus_empty(tick_broadcast_mask)) {
if (!bc_stopped)
clockevents_set_mode(bc, CLOCK_EVT_MODE_SHUTDOWN);
clockevents_shutdown(bc);
} else if (bc_stopped) {
if (tick_broadcast_device.mode == TICKDEV_MODE_PERIODIC)
tick_broadcast_start_periodic(bc);
Expand Down Expand Up @@ -306,7 +305,7 @@ void tick_shutdown_broadcast(unsigned int *cpup)

if (tick_broadcast_device.mode == TICKDEV_MODE_PERIODIC) {
if (bc && cpus_empty(tick_broadcast_mask))
clockevents_set_mode(bc, CLOCK_EVT_MODE_SHUTDOWN);
clockevents_shutdown(bc);
}

spin_unlock_irqrestore(&tick_broadcast_lock, flags);
Expand All @@ -321,7 +320,7 @@ void tick_suspend_broadcast(void)

bc = tick_broadcast_device.evtdev;
if (bc)
clockevents_set_mode(bc, CLOCK_EVT_MODE_SHUTDOWN);
clockevents_shutdown(bc);

spin_unlock_irqrestore(&tick_broadcast_lock, flags);
}
Expand Down
4 changes: 2 additions & 2 deletions trunk/kernel/time/tick-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ static int tick_check_new_device(struct clock_event_device *newdev)
* not give it back to the clockevents layer !
*/
if (tick_is_broadcast_device(curdev)) {
clockevents_set_mode(curdev, CLOCK_EVT_MODE_SHUTDOWN);
clockevents_shutdown(curdev);
curdev = NULL;
}
clockevents_exchange_device(curdev, newdev);
Expand Down Expand Up @@ -311,7 +311,7 @@ static void tick_suspend(void)
unsigned long flags;

spin_lock_irqsave(&tick_device_lock, flags);
clockevents_set_mode(td->evtdev, CLOCK_EVT_MODE_SHUTDOWN);
clockevents_shutdown(td->evtdev);
spin_unlock_irqrestore(&tick_device_lock, flags);
}

Expand Down
2 changes: 2 additions & 0 deletions trunk/kernel/time/tick-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ extern int tick_do_timer_cpu __read_mostly;
extern void tick_setup_periodic(struct clock_event_device *dev, int broadcast);
extern void tick_handle_periodic(struct clock_event_device *dev);

extern void clockevents_shutdown(struct clock_event_device *dev);

/*
* NO_HZ / high resolution timer shared code
*/
Expand Down

0 comments on commit a74999f

Please sign in to comment.