| From 8a990abe111ffa920f22d4ed04af1415c30d3c3a Mon Sep 17 00:00:00 2001 |
| From: Thomas Gleixner <tglx@linutronix.de> |
| Date: Mon, 2 Aug 2010 16:25:37 +0200 |
| Subject: [PATCH] printk: Restore irqs before calling release_console_mutex() |
| |
| commit 8a990abe111ffa920f22d4ed04af1415c30d3c3a in tip. |
| |
| Mike reported that printk is not working properly on RT. The reason is |
| that we call release_console_mutex() which calls the console drivers |
| with interrupts disabled, even if printk was called from an irq |
| enabled region. |
| |
| Signed-off-by: Thomas Gleixner <tglx@linutronix.de> |
| Tested-by: Mike Galbraith <efault@gmx.de> |
| |
| diff --git a/kernel/printk.c b/kernel/printk.c |
| index bbce874..0f3aafd 100644 |
| --- a/kernel/printk.c |
| +++ b/kernel/printk.c |
| @@ -797,9 +797,11 @@ asmlinkage int vprintk(const char *fmt, va_list args) |
| * will release 'logbuf_lock' regardless of whether it |
| * actually gets the mutex or not. |
| */ |
| - if (acquire_console_mutex_for_printk(this_cpu)) |
| + if (acquire_console_mutex_for_printk(this_cpu)) { |
| + raw_local_irq_restore(flags); |
| release_console_mutex(); |
| - |
| + raw_local_irq_save(flags); |
| + } |
| lockdep_on(); |
| out: |
| raw_local_irq_restore(flags); |
| @@ -1069,7 +1071,7 @@ void release_console_mutex(void) |
| /* |
| * on PREEMPT_RT, call console drivers with |
| * interrupts enabled (if printk was called |
| - * with interrupts disabled): |
| + * with interrupts enabled): |
| */ |
| #ifdef CONFIG_PREEMPT_RT |
| raw_spin_unlock_irqrestore(&logbuf_lock, flags); |
| -- |
| 1.7.1.1 |
| |