Skip to content

Commit

Permalink
vt,console,kdb: preserve console_blanked while in kdb
Browse files Browse the repository at this point in the history
Commit b45cfba (vt,console,kdb:
implement atomic console enter/leave functions) introduced the ability
to atomically change the console mode with kernel mode setting but did
not preserve the state of the console_blanked variable.

The console_blanked variable must be restored when executing the
con_debug_leave() or further kernel mode set changes (such as using
chvt X) will fail to correctly set the state of console.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
CC: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
Jason Wessel committed Aug 16, 2010
1 parent fed891c commit beed533
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/char/vt.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ static int saved_fg_console;
static int saved_last_console;
static int saved_want_console;
static int saved_vc_mode;
static int saved_console_blanked;

/*
* For each existing display, we have a pointer to console currently visible
Expand Down Expand Up @@ -3449,6 +3450,7 @@ int con_debug_enter(struct vc_data *vc)
saved_last_console = last_console;
saved_want_console = want_console;
saved_vc_mode = vc->vc_mode;
saved_console_blanked = console_blanked;
vc->vc_mode = KD_TEXT;
console_blanked = 0;
if (vc->vc_sw->con_debug_enter)
Expand Down Expand Up @@ -3492,6 +3494,7 @@ int con_debug_leave(void)
fg_console = saved_fg_console;
last_console = saved_last_console;
want_console = saved_want_console;
console_blanked = saved_console_blanked;
vc_cons[fg_console].d->vc_mode = saved_vc_mode;

vc = vc_cons[fg_console].d;
Expand Down

0 comments on commit beed533

Please sign in to comment.