diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-19 12:47:18 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-19 12:47:18 -0500 |
commit | 3cd312c3e887b4bee2d94668a481b3d19c07732c (patch) | |
tree | c8978186da2155f7752de79a2cd5b59e3e298ce8 /kernel | |
parent | ecd5907a200b18aeddac68b8c734b8ad4c931205 (diff) | |
parent | cf1e367ee84e02ac349ad0858eb65e8a6a511c8b (diff) |
Merge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
timers: Remove duplicate setting of new_base in __mod_timer()
clockevents: Prevent clockevent_devices list corruption on cpu hotplug
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/time/clockevents.c | 18 | ||||
-rw-r--r-- | kernel/timer.c | 2 |
2 files changed, 15 insertions, 5 deletions
diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c index 3d5fc0fd1cca..6f740d9f0948 100644 --- a/kernel/time/clockevents.c +++ b/kernel/time/clockevents.c | |||
@@ -238,8 +238,9 @@ void clockevents_exchange_device(struct clock_event_device *old, | |||
238 | */ | 238 | */ |
239 | void clockevents_notify(unsigned long reason, void *arg) | 239 | void clockevents_notify(unsigned long reason, void *arg) |
240 | { | 240 | { |
241 | struct list_head *node, *tmp; | 241 | struct clock_event_device *dev, *tmp; |
242 | unsigned long flags; | 242 | unsigned long flags; |
243 | int cpu; | ||
243 | 244 | ||
244 | raw_spin_lock_irqsave(&clockevents_lock, flags); | 245 | raw_spin_lock_irqsave(&clockevents_lock, flags); |
245 | clockevents_do_notify(reason, arg); | 246 | clockevents_do_notify(reason, arg); |
@@ -250,8 +251,19 @@ void clockevents_notify(unsigned long reason, void *arg) | |||
250 | * Unregister the clock event devices which were | 251 | * Unregister the clock event devices which were |
251 | * released from the users in the notify chain. | 252 | * released from the users in the notify chain. |
252 | */ | 253 | */ |
253 | list_for_each_safe(node, tmp, &clockevents_released) | 254 | list_for_each_entry_safe(dev, tmp, &clockevents_released, list) |
254 | list_del(node); | 255 | list_del(&dev->list); |
256 | /* | ||
257 | * Now check whether the CPU has left unused per cpu devices | ||
258 | */ | ||
259 | cpu = *((int *)arg); | ||
260 | list_for_each_entry_safe(dev, tmp, &clockevent_devices, list) { | ||
261 | if (cpumask_test_cpu(cpu, dev->cpumask) && | ||
262 | cpumask_weight(dev->cpumask) == 1) { | ||
263 | BUG_ON(dev->mode != CLOCK_EVT_MODE_UNUSED); | ||
264 | list_del(&dev->list); | ||
265 | } | ||
266 | } | ||
255 | break; | 267 | break; |
256 | default: | 268 | default: |
257 | break; | 269 | break; |
diff --git a/kernel/timer.c b/kernel/timer.c index 5db5a8d26811..15533b792397 100644 --- a/kernel/timer.c +++ b/kernel/timer.c | |||
@@ -656,8 +656,6 @@ __mod_timer(struct timer_list *timer, unsigned long expires, | |||
656 | 656 | ||
657 | debug_activate(timer, expires); | 657 | debug_activate(timer, expires); |
658 | 658 | ||
659 | new_base = __get_cpu_var(tvec_bases); | ||
660 | |||
661 | cpu = smp_processor_id(); | 659 | cpu = smp_processor_id(); |
662 | 660 | ||
663 | #if defined(CONFIG_NO_HZ) && defined(CONFIG_SMP) | 661 | #if defined(CONFIG_NO_HZ) && defined(CONFIG_SMP) |