tree 08a16c34d381b4d3347e353b598ccdbcc5f46c2b
parent f62c6d0a2607b2d1fdf280d4d1467a7a6e24c67d
author Stephane Doyon <[EMAIL PROTECTED]> Wed, 07 Sep 2005 05:17:31 -0700
committer Linus Torvalds <[EMAIL PROTECTED]> Thu, 08 Sep 2005 06:57:31 -0700

[PATCH] Console blanking locking fix

I've had WARN_CONSOLE_UNLOCKED warnings when calling TIOCLINUX

(I'm blind and I use a braille display.  I use those functions to blank my
laptop's screen so people don't read it, and hopefully to conserve power.)

The warnings are from these places:
do_blank_screen at drivers/char/vt.c:2754 (Not tainted)
save_screen at drivers/char/vt.c:575 (Not tainted)
do_unblank_screen at drivers/char/vt.c:2822 (Not tainted)
set_palette at drivers/char/vt.c:2908 (Not tainted)

At a glance I would think the following patch ought to fix that.  Tested on
one machine.  Could you please tell me if this is correct and/or forward
the patch where appropriate...

Signed-off-by: Stephane Doyon <[EMAIL PROTECTED]>
Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

 drivers/char/vt.c |    4 ++++
 1 files changed, 4 insertions(+)

diff --git a/drivers/char/vt.c b/drivers/char/vt.c
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -2272,7 +2272,9 @@ int tioclinux(struct tty_struct *tty, un
                        ret = paste_selection(tty);
                case TIOCL_UNBLANKSCREEN:
+                       acquire_console_sem();
+                       release_console_sem();
                case TIOCL_SELLOADLUT:
                        ret = sel_loadlut(p);
@@ -2317,8 +2319,10 @@ int tioclinux(struct tty_struct *tty, un
                case TIOCL_BLANKSCREEN: /* until explicitly unblanked, not only 
poked */
+                       acquire_console_sem();
                        ignore_poke = 1;
+                       release_console_sem();
                case TIOCL_BLANKEDSCREEN:
                        ret = console_blanked;
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to