diff options
author | Stephane Doyon <s.doyon@videotron.ca> | 2005-09-06 18:17:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-07 19:57:31 -0400 |
commit | 2d237c63659c098a662b1b09d43460f04c498436 (patch) | |
tree | 08a16c34d381b4d3347e353b598ccdbcc5f46c2b /drivers | |
parent | f62c6d0a2607b2d1fdf280d4d1467a7a6e24c67d (diff) |
[PATCH] Console blanking locking fix
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: Stephane Doyon <s.doyon@videotron.ca>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/vt.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/char/vt.c b/drivers/char/vt.c index 665103ccaee8..27b6c297906a 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c | |||
@@ -2272,7 +2272,9 @@ int tioclinux(struct tty_struct *tty, unsigned long arg) | |||
2272 | ret = paste_selection(tty); | 2272 | ret = paste_selection(tty); |
2273 | break; | 2273 | break; |
2274 | case TIOCL_UNBLANKSCREEN: | 2274 | case TIOCL_UNBLANKSCREEN: |
2275 | acquire_console_sem(); | ||
2275 | unblank_screen(); | 2276 | unblank_screen(); |
2277 | release_console_sem(); | ||
2276 | break; | 2278 | break; |
2277 | case TIOCL_SELLOADLUT: | 2279 | case TIOCL_SELLOADLUT: |
2278 | ret = sel_loadlut(p); | 2280 | ret = sel_loadlut(p); |
@@ -2317,8 +2319,10 @@ int tioclinux(struct tty_struct *tty, unsigned long arg) | |||
2317 | } | 2319 | } |
2318 | break; | 2320 | break; |
2319 | case TIOCL_BLANKSCREEN: /* until explicitly unblanked, not only poked */ | 2321 | case TIOCL_BLANKSCREEN: /* until explicitly unblanked, not only poked */ |
2322 | acquire_console_sem(); | ||
2320 | ignore_poke = 1; | 2323 | ignore_poke = 1; |
2321 | do_blank_screen(0); | 2324 | do_blank_screen(0); |
2325 | release_console_sem(); | ||
2322 | break; | 2326 | break; |
2323 | case TIOCL_BLANKEDSCREEN: | 2327 | case TIOCL_BLANKEDSCREEN: |
2324 | ret = console_blanked; | 2328 | ret = console_blanked; |