Commit 6b898c07 authored by Daniel Vetter's avatar Daniel Vetter Committed by Greg Kroah-Hartman

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 <>
Cc: Thomas Gleixner <>
Cc: Alan Cox <>
Cc: Peter Zijlstra <>
Signed-off-by: default avatarDaniel Vetter <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent ecbbfd44
......@@ -1914,7 +1914,8 @@ static int __cpuinit console_cpu_notify(struct notifier_block *self,
void console_lock(void)
if (console_suspended)
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment