]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.4.44/sysrq-attach-sysrq-handler-correctly-for-32-bit-kernel.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.4.44 / sysrq-attach-sysrq-handler-correctly-for-32-bit-kernel.patch
CommitLineData
7e0d956d
GKH
1From 802c03881f29844af0252b6e22be5d2f65f93fd0 Mon Sep 17 00:00:00 2001
2From: Akinobu Mita <akinobu.mita@gmail.com>
3Date: Fri, 6 Jan 2017 02:14:16 +0900
4Subject: sysrq: attach sysrq handler correctly for 32-bit kernel
5
6From: Akinobu Mita <akinobu.mita@gmail.com>
7
8commit 802c03881f29844af0252b6e22be5d2f65f93fd0 upstream.
9
10The sysrq input handler should be attached to the input device which has
11a left alt key.
12
13On 32-bit kernels, some input devices which has a left alt key cannot
14attach sysrq handler. Because the keybit bitmap in struct input_device_id
15for sysrq is not correctly initialized. KEY_LEFTALT is 56 which is
16greater than BITS_PER_LONG on 32-bit kernels.
17
18I found this problem when using a matrix keypad device which defines
19a KEY_LEFTALT (56) but doesn't have a KEY_O (24 == 56%32).
20
21Cc: Jiri Slaby <jslaby@suse.com>
22Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
23Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
24Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
25Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
26
27---
28 drivers/tty/sysrq.c | 4 ++--
29 1 file changed, 2 insertions(+), 2 deletions(-)
30
31--- a/drivers/tty/sysrq.c
32+++ b/drivers/tty/sysrq.c
33@@ -939,8 +939,8 @@ static const struct input_device_id sysr
34 {
35 .flags = INPUT_DEVICE_ID_MATCH_EVBIT |
36 INPUT_DEVICE_ID_MATCH_KEYBIT,
37- .evbit = { BIT_MASK(EV_KEY) },
38- .keybit = { BIT_MASK(KEY_LEFTALT) },
39+ .evbit = { [BIT_WORD(EV_KEY)] = BIT_MASK(EV_KEY) },
40+ .keybit = { [BIT_WORD(KEY_LEFTALT)] = BIT_MASK(KEY_LEFTALT) },
41 },
42 { },
43 };