aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/printk.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2012-09-17 19:03:31 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-23 23:14:55 -0400
commit6b898c07cb1d5bd8344a8044288bb4ae3873da74 (patch)
tree746c283ebf35c7e038b28fee4f7a094f1b885db2 /kernel/printk.c
parentecbbfd44a08fa80e0d664814efd4c187721b85f6 (diff)
console: use might_sleep in console_lock
Instead of BUG_ON(in_interrupt()), since that doesn't check for all the newfangled stuff like preempt. Note that this is valid since the console_sem is essentially used like a real mutex with only two twists: - we allow trylock from hardirq context - across suspend/resume we lock the logical console_lock, but drop the semaphore protecting the locking state. Now that doesn't guarantee that no one is playing tricks in single-thread atomic contexts at suspend/resume/boot time, but - I couldn't find anything suspicious with some grepping, - might_sleep shouldn't die, - and I think the upside of catching more potential issues is worth the risk of getting a might_sleep backtrace that would have been save (and then dealing with that fallout). Cc: Dave Airlie <airlied@gmail.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel/printk.c')
-rw-r--r--kernel/printk.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/printk.c b/kernel/printk.c
index ee79f14db358..22e070f3470a 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -1914,7 +1914,8 @@ static int __cpuinit console_cpu_notify(struct notifier_block *self,
1914 */ 1914 */
1915void console_lock(void) 1915void console_lock(void)
1916{ 1916{
1917 BUG_ON(in_interrupt()); 1917 might_sleep();
1918
1918 down(&console_sem); 1919 down(&console_sem);
1919 if (console_suspended) 1920 if (console_suspended)
1920 return; 1921 return;