summaryrefslogtreecommitdiffstats
path: root/drivers/char/sysrq.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2010-10-24 22:11:17 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2010-10-24 22:11:17 -0700
commit49327ad2bbbaf1945d5ba431522201574219d150 (patch)
tree47beb374d0cfb77d401220f20e8cece4ce4469db /drivers/char/sysrq.c
parentf9ce6eb5b6fa8cbcf0a0fb7c5f4203f94730fc52 (diff)
parent6521d0bf984ab1cc25795d312e21c438aea8b5d5 (diff)
downloadtalos-obmc-linux-49327ad2bbbaf1945d5ba431522201574219d150.tar.gz
talos-obmc-linux-49327ad2bbbaf1945d5ba431522201574219d150.zip
Merge branch 'next' into for-linus
Diffstat (limited to 'drivers/char/sysrq.c')
-rw-r--r--drivers/char/sysrq.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c
index ef31bb81e843..f0ad694cc2eb 100644
--- a/drivers/char/sysrq.c
+++ b/drivers/char/sysrq.c
@@ -566,10 +566,16 @@ static const unsigned char sysrq_xlate[KEY_MAX + 1] =
static bool sysrq_down;
static int sysrq_alt_use;
static int sysrq_alt;
+static DEFINE_SPINLOCK(sysrq_event_lock);
static bool sysrq_filter(struct input_handle *handle, unsigned int type,
unsigned int code, int value)
{
+ bool suppress;
+
+ /* We are called with interrupts disabled, just take the lock */
+ spin_lock(&sysrq_event_lock);
+
if (type != EV_KEY)
goto out;
@@ -601,7 +607,10 @@ static bool sysrq_filter(struct input_handle *handle, unsigned int type,
}
out:
- return sysrq_down;
+ suppress = sysrq_down;
+ spin_unlock(&sysrq_event_lock);
+
+ return suppress;
}
static int sysrq_connect(struct input_handler *handler,
@@ -652,8 +661,8 @@ static void sysrq_disconnect(struct input_handle *handle)
}
/*
- * We are matching on KEY_LEFTALT insteard of KEY_SYSRQ because not all
- * keyboards have SysRq ikey predefined and so user may add it to keymap
+ * We are matching on KEY_LEFTALT instead of KEY_SYSRQ because not all
+ * keyboards have SysRq key predefined and so user may add it to keymap
* later, but we expect all such keyboards to have left alt.
*/
static const struct input_device_id sysrq_ids[] = {
OpenPOWER on IntegriCloud