From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938985AbdAEWQU (ORCPT ); Thu, 5 Jan 2017 17:16:20 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:34116 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932970AbdAEWOr (ORCPT ); Thu, 5 Jan 2017 17:14:47 -0500 Date: Thu, 5 Jan 2017 14:14:44 -0800 From: Dmitry Torokhov To: Akinobu Mita Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby Subject: Re: [PATCH] sysrq: attach sysrq handler correctly for 32-bit kernel Message-ID: <20170105221444.GA20478@dtor-ws> References: <1483636456-23336-1-git-send-email-akinobu.mita@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1483636456-23336-1-git-send-email-akinobu.mita@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 06, 2017 at 02:14:16AM +0900, Akinobu Mita wrote: > The sysrq input handler should be attached to the input device which has > a left alt key. > > On 32-bit kernels, some input devices which has a left alt key cannot > attach sysrq handler. Because the keybit bitmap in struct input_device_id > for sysrq is not correctly initialized. KEY_LEFTALT is 56 which is > greater than BITS_PER_LONG on 32-bit kernels. > > I found this problem when using a matrix keypad device which defines > a KEY_LEFTALT (56) but doesn't have a KEY_O (24 == 56%32). > > Cc: Greg Kroah-Hartman > Cc: Jiri Slaby > Cc: Dmitry Torokhov > Signed-off-by: Akinobu Mita Acked-by: Dmitry Torokhov I guess Greg will take it through TTY tree. Might go to stable as well, although apparently not pressing since it was only noticed now. > --- > drivers/tty/sysrq.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c > index 52bbd27..701c085 100644 > --- a/drivers/tty/sysrq.c > +++ b/drivers/tty/sysrq.c > @@ -946,8 +946,8 @@ static const struct input_device_id sysrq_ids[] = { > { > .flags = INPUT_DEVICE_ID_MATCH_EVBIT | > INPUT_DEVICE_ID_MATCH_KEYBIT, > - .evbit = { BIT_MASK(EV_KEY) }, > - .keybit = { BIT_MASK(KEY_LEFTALT) }, > + .evbit = { [BIT_WORD(EV_KEY)] = BIT_MASK(EV_KEY) }, > + .keybit = { [BIT_WORD(KEY_LEFTALT)] = BIT_MASK(KEY_LEFTALT) }, > }, > { }, > }; > -- > 2.7.4 > Thanks. -- Dmitry