diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-06 11:01:59 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-06 11:01:59 -0500 |
commit | 1483b3823542c9721eddf09a077af1e02ac96b50 (patch) | |
tree | 390dcff4ddfb8634ad62c7fc9c3c9d0e802e9c1e | |
parent | 4a2164a7dbf0d3b6a1c2ef6f20c0d54350491a12 (diff) | |
parent | 1a9a8aefa8f0530c97f4606ab7a2fc01fe31e9c1 (diff) |
Merge branch 'core-printk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
* 'core-printk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
printk, lockdep: Switch to tracked irq ops
printk, lockdep: Remove superfluous preempt_disable()
printk, lockdep: Disable lock debugging on zap_locks()
-rw-r--r-- | include/linux/lockdep.h | 4 | ||||
-rw-r--r-- | kernel/printk.c | 9 |
2 files changed, 8 insertions, 5 deletions
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index b6a56e37284c..d36619ead3ba 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h | |||
@@ -343,6 +343,8 @@ extern void lockdep_trace_alloc(gfp_t mask); | |||
343 | 343 | ||
344 | #define lockdep_assert_held(l) WARN_ON(debug_locks && !lockdep_is_held(l)) | 344 | #define lockdep_assert_held(l) WARN_ON(debug_locks && !lockdep_is_held(l)) |
345 | 345 | ||
346 | #define lockdep_recursing(tsk) ((tsk)->lockdep_recursion) | ||
347 | |||
346 | #else /* !LOCKDEP */ | 348 | #else /* !LOCKDEP */ |
347 | 349 | ||
348 | static inline void lockdep_off(void) | 350 | static inline void lockdep_off(void) |
@@ -392,6 +394,8 @@ struct lock_class_key { }; | |||
392 | 394 | ||
393 | #define lockdep_assert_held(l) do { } while (0) | 395 | #define lockdep_assert_held(l) do { } while (0) |
394 | 396 | ||
397 | #define lockdep_recursing(tsk) (0) | ||
398 | |||
395 | #endif /* !LOCKDEP */ | 399 | #endif /* !LOCKDEP */ |
396 | 400 | ||
397 | #ifdef CONFIG_LOCK_STAT | 401 | #ifdef CONFIG_LOCK_STAT |
diff --git a/kernel/printk.c b/kernel/printk.c index afc8310c4625..989e4a52da76 100644 --- a/kernel/printk.c +++ b/kernel/printk.c | |||
@@ -688,6 +688,7 @@ static void zap_locks(void) | |||
688 | 688 | ||
689 | oops_timestamp = jiffies; | 689 | oops_timestamp = jiffies; |
690 | 690 | ||
691 | debug_locks_off(); | ||
691 | /* If a crash is occurring, make sure we can't deadlock */ | 692 | /* If a crash is occurring, make sure we can't deadlock */ |
692 | raw_spin_lock_init(&logbuf_lock); | 693 | raw_spin_lock_init(&logbuf_lock); |
693 | /* And make sure that we print immediately */ | 694 | /* And make sure that we print immediately */ |
@@ -840,9 +841,8 @@ asmlinkage int vprintk(const char *fmt, va_list args) | |||
840 | boot_delay_msec(); | 841 | boot_delay_msec(); |
841 | printk_delay(); | 842 | printk_delay(); |
842 | 843 | ||
843 | preempt_disable(); | ||
844 | /* This stops the holder of console_sem just where we want him */ | 844 | /* This stops the holder of console_sem just where we want him */ |
845 | raw_local_irq_save(flags); | 845 | local_irq_save(flags); |
846 | this_cpu = smp_processor_id(); | 846 | this_cpu = smp_processor_id(); |
847 | 847 | ||
848 | /* | 848 | /* |
@@ -856,7 +856,7 @@ asmlinkage int vprintk(const char *fmt, va_list args) | |||
856 | * recursion and return - but flag the recursion so that | 856 | * recursion and return - but flag the recursion so that |
857 | * it can be printed at the next appropriate moment: | 857 | * it can be printed at the next appropriate moment: |
858 | */ | 858 | */ |
859 | if (!oops_in_progress) { | 859 | if (!oops_in_progress && !lockdep_recursing(current)) { |
860 | recursion_bug = 1; | 860 | recursion_bug = 1; |
861 | goto out_restore_irqs; | 861 | goto out_restore_irqs; |
862 | } | 862 | } |
@@ -962,9 +962,8 @@ asmlinkage int vprintk(const char *fmt, va_list args) | |||
962 | 962 | ||
963 | lockdep_on(); | 963 | lockdep_on(); |
964 | out_restore_irqs: | 964 | out_restore_irqs: |
965 | raw_local_irq_restore(flags); | 965 | local_irq_restore(flags); |
966 | 966 | ||
967 | preempt_enable(); | ||
968 | return printed_len; | 967 | return printed_len; |
969 | } | 968 | } |
970 | EXPORT_SYMBOL(printk); | 969 | EXPORT_SYMBOL(printk); |