Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 62318
b: refs/heads/master
c: 5590a53
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Gleixner authored and Linus Torvalds committed Jul 22, 2007
1 parent 0f35db7 commit 972a2c0
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 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: 18de5bc4c1f1f1fa5e14f354a7603bd6e9d4e3b6
refs/heads/master: 5590a536c0bc403fc73908c66c1c88cbed735ecb
29 changes: 28 additions & 1 deletion trunk/kernel/time/tick-broadcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ struct tick_device tick_broadcast_device;
static cpumask_t tick_broadcast_mask;
static DEFINE_SPINLOCK(tick_broadcast_lock);

#ifdef CONFIG_TICK_ONESHOT
static void tick_broadcast_clear_oneshot(int cpu);
#else
static inline void tick_broadcast_clear_oneshot(int cpu) { }
#endif

/*
* Debugging: see timer_list.c
*/
Expand Down Expand Up @@ -99,8 +105,19 @@ int tick_device_uses_broadcast(struct clock_event_device *dev, int cpu)
cpu_set(cpu, tick_broadcast_mask);
tick_broadcast_start_periodic(tick_broadcast_device.evtdev);
ret = 1;
}
} else {
/*
* When the new device is not affected by the stop
* feature and the cpu is marked in the broadcast mask
* then clear the broadcast bit.
*/
if (!(dev->features & CLOCK_EVT_FEAT_C3STOP)) {
int cpu = smp_processor_id();

cpu_clear(cpu, tick_broadcast_mask);
tick_broadcast_clear_oneshot(cpu);
}
}
spin_unlock_irqrestore(&tick_broadcast_lock, flags);
return ret;
}
Expand Down Expand Up @@ -487,6 +504,16 @@ void tick_broadcast_oneshot_control(unsigned long reason)
spin_unlock_irqrestore(&tick_broadcast_lock, flags);
}

/*
* Reset the one shot broadcast for a cpu
*
* Called with tick_broadcast_lock held
*/
static void tick_broadcast_clear_oneshot(int cpu)
{
cpu_clear(cpu, tick_broadcast_oneshot_mask);
}

/**
* tick_broadcast_setup_highres - setup the broadcast device for highres
*/
Expand Down

0 comments on commit 972a2c0

Please sign in to comment.