public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Andrew Morton <akpm@osdl.org>
Cc: Linux Kernel list <linux-kernel@vger.kernel.org>
Subject: [PATCH] [Fwd: Console locking and blanking]
Date: Wed, 17 Aug 2005 11:41:14 +1000	[thread overview]
Message-ID: <1124242875.8848.10.camel@gaston> (raw)

I've had WARN_CONSOLE_UNLOCKED warnings when calling TIOCLINUX 
TIOCL_BLANKSCREEN and TIOCL_UNBLANKSCREEN.

(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: Stéphane Doyon <s.doyon@videotron.ca>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

--- linux-2.6.12/drivers/char/vt.c.orig	2005-08-16 15:39:14.000000000 -0400
+++ linux-2.6.12/drivers/char/vt.c	2005-08-16 15:41:04.000000000 -0400
@@ -2272,7 +2272,9 @@
  			ret = paste_selection(tty);
  			break;
  		case TIOCL_UNBLANKSCREEN:
+			acquire_console_sem();
  			unblank_screen();
+			release_console_sem();
  			break;
  		case TIOCL_SELLOADLUT:
  			ret = sel_loadlut(p);
@@ -2317,8 +2319,10 @@
  			}
  			break;
  		case TIOCL_BLANKSCREEN:	/* until explicitly unblanked, not only poked */
+			acquire_console_sem();
  			ignore_poke = 1;
  			do_blank_screen(0);
+			release_console_sem();
  			break;
  		case TIOCL_BLANKEDSCREEN:
  			ret = console_blanked;


             reply	other threads:[~2005-08-17  1:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-17  1:41 Benjamin Herrenschmidt [this message]
2005-08-17  3:29 ` [PATCH] [Fwd: Console locking and blanking] Benjamin Herrenschmidt
2005-08-17  3:44   ` Steven Rostedt
2005-08-17  3:51     ` Benjamin Herrenschmidt
2005-08-17  3:55     ` Alejandro Bonilla Beeche
2005-08-17  4:16       ` Steven Rostedt
2005-08-17  6:00       ` Antonino A. Daplas
2005-08-18  9:53       ` Helge Hafting
2005-08-17  3:52   ` Jon Smirl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1124242875.8848.10.camel@gaston \
    --to=benh@kernel.crashing.org \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox