From 0fd950ec150a0792f849261f13837315dda73f84 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner 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 Tested-by: Mike Galbraith Signed-off-by: Paul Gortmaker --- kernel/printk.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/kernel/printk.c b/kernel/printk.c index 9c5139c..013f0e5 100644 --- a/kernel/printk.c +++ b/kernel/printk.c @@ -790,9 +790,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); @@ -1062,7 +1064,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.0.4