diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2011-02-03 09:09:41 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2011-02-04 04:31:22 -0500 |
commit | f266a5110d453b7987194460ac7edd31f1a5426c (patch) | |
tree | c616ed6d9f59c94e6c16116c8d656dd9862f353f /kernel | |
parent | 831d52bc153971b70e64eccfbed2b232394f22f8 (diff) |
lockdep, timer: Fix del_timer_sync() annotation
Calling local_bh_enable() will want to actually start processing
softirqs, which isn't a good idea since this can get called with IRQs
disabled.
Cure this by using _local_bh_enable() which doesn't start processing
softirqs, and use raw_local_irq_save() to avoid any softirqs from
happening without letting lockdep think IRQs are in fact disabled.
Reported-by: Nick Bowler <nbowler@elliptictech.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Reviewed-by: Yong Zhang <yong.zhang0@gmail.com>
LKML-Reference: <20110203141548.039540914@chello.nl>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/timer.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/timer.c b/kernel/timer.c index 43ca9936f2d0..d53ce66daea0 100644 --- a/kernel/timer.c +++ b/kernel/timer.c | |||
@@ -969,10 +969,14 @@ EXPORT_SYMBOL(try_to_del_timer_sync); | |||
969 | int del_timer_sync(struct timer_list *timer) | 969 | int del_timer_sync(struct timer_list *timer) |
970 | { | 970 | { |
971 | #ifdef CONFIG_LOCKDEP | 971 | #ifdef CONFIG_LOCKDEP |
972 | unsigned long flags; | ||
973 | |||
974 | raw_local_irq_save(flags); | ||
972 | local_bh_disable(); | 975 | local_bh_disable(); |
973 | lock_map_acquire(&timer->lockdep_map); | 976 | lock_map_acquire(&timer->lockdep_map); |
974 | lock_map_release(&timer->lockdep_map); | 977 | lock_map_release(&timer->lockdep_map); |
975 | local_bh_enable(); | 978 | _local_bh_enable(); |
979 | raw_local_irq_restore(flags); | ||
976 | #endif | 980 | #endif |
977 | /* | 981 | /* |
978 | * don't use it in hardirq context, because it | 982 | * don't use it in hardirq context, because it |