Merge branch 'core-printk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 6 Jan 2012 16:01:59 +0000 (08:01 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 6 Jan 2012 16:01:59 +0000 (08:01 -0800)
* '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()

1  2 
kernel/printk.c

diff --combined kernel/printk.c
index afc8310c462533fcc86def288e89e1e6f37cf7f4,dfd8f73dcb7656fbe6e4daf6c2d341b439056ed3..989e4a52da76e10c6bb43601d1a49931f7bb82ed
@@@ -199,7 -199,7 +199,7 @@@ void __init setup_log_buf(int early
                unsigned long mem;
  
                mem = memblock_alloc(new_log_buf_len, PAGE_SIZE);
 -              if (mem == MEMBLOCK_ERROR)
 +              if (!mem)
                        return;
                new_log_buf = __va(mem);
        } else {
@@@ -688,6 -688,7 +688,7 @@@ static void zap_locks(void
  
        oops_timestamp = jiffies;
  
+       debug_locks_off();
        /* If a crash is occurring, make sure we can't deadlock */
        raw_spin_lock_init(&logbuf_lock);
        /* And make sure that we print immediately */
@@@ -840,9 -841,8 +841,8 @@@ asmlinkage int vprintk(const char *fmt
        boot_delay_msec();
        printk_delay();
  
-       preempt_disable();
        /* This stops the holder of console_sem just where we want him */
-       raw_local_irq_save(flags);
+       local_irq_save(flags);
        this_cpu = smp_processor_id();
  
        /*
                 * recursion and return - but flag the recursion so that
                 * it can be printed at the next appropriate moment:
                 */
-               if (!oops_in_progress) {
+               if (!oops_in_progress && !lockdep_recursing(current)) {
                        recursion_bug = 1;
                        goto out_restore_irqs;
                }
  
        lockdep_on();
  out_restore_irqs:
-       raw_local_irq_restore(flags);
+       local_irq_restore(flags);
  
-       preempt_enable();
        return printed_len;
  }
  EXPORT_SYMBOL(printk);
@@@ -1293,11 -1292,10 +1292,11 @@@ again
        raw_spin_lock(&logbuf_lock);
        if (con_start != log_end)
                retry = 1;
 +      raw_spin_unlock_irqrestore(&logbuf_lock, flags);
 +
        if (retry && console_trylock())
                goto again;
  
 -      raw_spin_unlock_irqrestore(&logbuf_lock, flags);
        if (wake_klogd)
                wake_up_klogd();
  }