aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/char/keyboard.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c
index edd996f6fb87..13e3126c1de5 100644
--- a/drivers/char/keyboard.c
+++ b/drivers/char/keyboard.c
@@ -151,6 +151,7 @@ unsigned char kbd_sysrq_xlate[KEY_MAX + 1] =
151 "230\177\000\000\213\214\000\000\000\000\000\000\000\000\000\000" /* 0x50 - 0x5f */ 151 "230\177\000\000\213\214\000\000\000\000\000\000\000\000\000\000" /* 0x50 - 0x5f */
152 "\r\000/"; /* 0x60 - 0x6f */ 152 "\r\000/"; /* 0x60 - 0x6f */
153static int sysrq_down; 153static int sysrq_down;
154static int sysrq_alt_use;
154#endif 155#endif
155static int sysrq_alt; 156static int sysrq_alt;
156 157
@@ -1143,7 +1144,7 @@ static void kbd_keycode(unsigned int keycode, int down,
1143 kbd = kbd_table + fg_console; 1144 kbd = kbd_table + fg_console;
1144 1145
1145 if (keycode == KEY_LEFTALT || keycode == KEY_RIGHTALT) 1146 if (keycode == KEY_LEFTALT || keycode == KEY_RIGHTALT)
1146 sysrq_alt = down; 1147 sysrq_alt = down ? keycode : 0;
1147#ifdef CONFIG_SPARC 1148#ifdef CONFIG_SPARC
1148 if (keycode == KEY_STOP) 1149 if (keycode == KEY_STOP)
1149 sparc_l1_a_state = down; 1150 sparc_l1_a_state = down;
@@ -1163,9 +1164,14 @@ static void kbd_keycode(unsigned int keycode, int down,
1163 1164
1164#ifdef CONFIG_MAGIC_SYSRQ /* Handle the SysRq Hack */ 1165#ifdef CONFIG_MAGIC_SYSRQ /* Handle the SysRq Hack */
1165 if (keycode == KEY_SYSRQ && (sysrq_down || (down == 1 && sysrq_alt))) { 1166 if (keycode == KEY_SYSRQ && (sysrq_down || (down == 1 && sysrq_alt))) {
1166 sysrq_down = down; 1167 if (!sysrq_down) {
1168 sysrq_down = down;
1169 sysrq_alt_use = sysrq_alt;
1170 }
1167 return; 1171 return;
1168 } 1172 }
1173 if (sysrq_down && !down && keycode == sysrq_alt_use)
1174 sysrq_down = 0;
1169 if (sysrq_down && down && !rep) { 1175 if (sysrq_down && down && !rep) {
1170 handle_sysrq(kbd_sysrq_xlate[keycode], regs, tty); 1176 handle_sysrq(kbd_sysrq_xlate[keycode], regs, tty);
1171 return; 1177 return;