aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/serio/i8042.c
diff options
context:
space:
mode:
authorTAMUKI Shoichi <tamuki@linet.gr.jp>2010-08-10 21:03:28 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-11 11:59:22 -0400
commitc7ff0d9c92435e836e13aaa8d0e56d4000424bcc (patch)
tree96f56d15b5dd96c44fb183ce00152608df50dc5c /drivers/input/serio/i8042.c
parentbebf8cfaea1df1a104b993b995bb385e998a4dc8 (diff)
panic: keep blinking in spite of long spin timer mode
To keep panic_timeout accuracy when running under a hypervisor, the current implementation only spins on long time (1 second) calls to mdelay. That brings a good effect, but the problem is the keyboard LEDs don't blink at all on that situation. This patch changes to call to panic_blink_enter() between every mdelay and keeps blinking in spite of long spin timer mode. The time to call to mdelay is now 100ms. Even this change will keep panic_timeout accuracy enough when running under a hypervisor. Signed-off-by: TAMUKI Shoichi <tamuki@linet.gr.jp> Cc: Ben Dooks <ben-linux@fluff.org> Cc: Russell King <linux@arm.linux.org.uk> Acked-by: Dmitry Torokhov <dtor@mail.ru> Cc: Anton Blanchard <anton@samba.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/input/serio/i8042.c')
-rw-r--r--drivers/input/serio/i8042.c25
1 files changed, 5 insertions, 20 deletions
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index 258b98b9d7c2..46e4ba0b9246 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -61,10 +61,6 @@ static bool i8042_noloop;
61module_param_named(noloop, i8042_noloop, bool, 0); 61module_param_named(noloop, i8042_noloop, bool, 0);
62MODULE_PARM_DESC(noloop, "Disable the AUX Loopback command while probing for the AUX port"); 62MODULE_PARM_DESC(noloop, "Disable the AUX Loopback command while probing for the AUX port");
63 63
64static unsigned int i8042_blink_frequency = 500;
65module_param_named(panicblink, i8042_blink_frequency, uint, 0600);
66MODULE_PARM_DESC(panicblink, "Frequency with which keyboard LEDs should blink when kernel panics");
67
68#ifdef CONFIG_X86 64#ifdef CONFIG_X86
69static bool i8042_dritek; 65static bool i8042_dritek;
70module_param_named(dritek, i8042_dritek, bool, 0); 66module_param_named(dritek, i8042_dritek, bool, 0);
@@ -1030,8 +1026,8 @@ static void i8042_controller_reset(void)
1030 1026
1031 1027
1032/* 1028/*
1033 * i8042_panic_blink() will flash the keyboard LEDs and is called when 1029 * i8042_panic_blink() will turn the keyboard LEDs on or off and is called
1034 * kernel panics. Flashing LEDs is useful for users running X who may 1030 * when kernel panics. Flashing LEDs is useful for users running X who may
1035 * not see the console and will help distingushing panics from "real" 1031 * not see the console and will help distingushing panics from "real"
1036 * lockups. 1032 * lockups.
1037 * 1033 *
@@ -1041,22 +1037,12 @@ static void i8042_controller_reset(void)
1041 1037
1042#define DELAY do { mdelay(1); if (++delay > 10) return delay; } while(0) 1038#define DELAY do { mdelay(1); if (++delay > 10) return delay; } while(0)
1043 1039
1044static long i8042_panic_blink(long count) 1040static long i8042_panic_blink(int state)
1045{ 1041{
1046 long delay = 0; 1042 long delay = 0;
1047 static long last_blink; 1043 char led;
1048 static char led;
1049
1050 /*
1051 * We expect frequency to be about 1/2s. KDB uses about 1s.
1052 * Make sure they are different.
1053 */
1054 if (!i8042_blink_frequency)
1055 return 0;
1056 if (count - last_blink < i8042_blink_frequency)
1057 return 0;
1058 1044
1059 led ^= 0x01 | 0x04; 1045 led = (state) ? 0x01 | 0x04 : 0;
1060 while (i8042_read_status() & I8042_STR_IBF) 1046 while (i8042_read_status() & I8042_STR_IBF)
1061 DELAY; 1047 DELAY;
1062 dbg("%02x -> i8042 (panic blink)", 0xed); 1048 dbg("%02x -> i8042 (panic blink)", 0xed);
@@ -1069,7 +1055,6 @@ static long i8042_panic_blink(long count)
1069 dbg("%02x -> i8042 (panic blink)", led); 1055 dbg("%02x -> i8042 (panic blink)", led);
1070 i8042_write_data(led); 1056 i8042_write_data(led);
1071 DELAY; 1057 DELAY;
1072 last_blink = count;
1073 return delay; 1058 return delay;
1074} 1059}
1075 1060