Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A6F6C433EF for ; Mon, 15 Nov 2021 14:49:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2414F63210 for ; Mon, 15 Nov 2021 14:49:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234749AbhKOOwb (ORCPT ); Mon, 15 Nov 2021 09:52:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232166AbhKOOwE (ORCPT ); Mon, 15 Nov 2021 09:52:04 -0500 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F2F8C061714; Mon, 15 Nov 2021 06:49:03 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id B2D361F44CEF DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=collabora.com; s=mail; t=1636987742; bh=JorIZ5hhzSrh5qFWXEzqB7ZLaVuUqeQfg7BJ8jnsGZQ=; h=Subject:From:To:Cc:References:Date:In-Reply-To:From; b=f+a0vSycNMq8ZJhvvn4mWrlUAidtpOt6F7NmeqLbZefJoWUY27QN3/hp7vNEm6icl 5SqS/HZdv+zS/tTol/Espj+cXcvc+SX4exTV5F9hsAvgYUrEPZjdYk3tgMJ10yOQku w2AM87zjsDverTk4qCxyqjkD0QtPr+O4Km6IQ8cbSH+P6fAIv+YkIUbAK9QH5UvsHJ 0VN01UrsZ/N0gG8YXHx4qETXPOc5p9NiFFZNXJ+rMpfRngatVJxSCxVTPC1G0l8ujO FoZofm6fxwOORXl1UCjMgo4tqt6fAiQfrCtc2ac5RKb94kMEqmQdEdyixX+CTePEOF dUtejiVhlNcYA== Subject: Re: [RFC] tty/sysrq: Add alternative SysRq key From: Andrzej Pietrasiewicz To: Greg Kroah-Hartman Cc: "Maciej W. Rozycki" , Pavel Machek , linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Dmitry Torokhov , Jiri Slaby , kernel@collabora.com References: <20211103155438.11167-1-andrzej.p@collabora.com> <20211104120111.GB23122@duo.ucw.cz> <17ccc35d-441c-70c1-a80a-28a4ff824535@collabora.com> <9fbe062a-2992-0361-e72a-f2b1523143dd@collabora.com> Message-ID: Date: Mon, 15 Nov 2021 15:48:59 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jiri, Greg, W dniu 05.11.2021 o 15:06, Andrzej Pietrasiewicz pisze: > Hi Greg, > > W dniu 05.11.2021 o 14:27, Greg Kroah-Hartman pisze: >> On Fri, Nov 05, 2021 at 02:01:23PM +0100, Andrzej Pietrasiewicz wrote: >>> Hi, >>> >>> W dniu 04.11.2021 o 15:17, Andrzej Pietrasiewicz pisze: >>>> Hi Maciej, >>>> >>>> W dniu 04.11.2021 o 14:13, Maciej W. Rozycki pisze: >>>>> On Thu, 4 Nov 2021, Maciej W. Rozycki wrote: >>>>> >>>>>>    The reason for this is with their more recent laptops Lenovo in their >>>>>> infinite wisdom have placed the key (which in a traditional >>>>>> PS/2-keyboard manner produces when combined with ) in their >>>>>> keyboards between the right and keys.  With thumbs not being >>>>>> as accurate as other fingers (and the overall misdesign of the keyboard >>>>>> and touchpad interface) you can imagine how often I have inadvertently hit >>>>>> combined with a letter key, wreaking havoc to my system (and of >>>>>> course I want to keep the key enabled for times when I do need it). >>>>> >>>>>    On second thoughts this can be disabled with `setkeycodes 54 0' once we >>>>> do have an alternative combination available. >>>>> >>>> >>>> Doesn't `setkeycodes` affect only one keyboard? What if there are more >>>> keyboards connected to a machine? >>>> >>>>   From drivers/tty/vt/keyboard.c: >>>> >>>> /* >>>>    * Translation of scancodes to keycodes. We set them on only the first >>>>    * keyboard in the list that accepts the scancode and keycode. >>>>    * Explanation for not choosing the first attached keyboard anymore: >>>>    *  USB keyboards for example have two event devices: one for all "normal" >>>>    *  keys and one for extra function keys (like "volume up", "make coffee", >>>>    *  etc.). So this means that scancodes for the extra function keys won't >>>>    *  be valid for the first event device, but will be for the second. >>>>    */ >>>> >>> >>> My second thoughts: if we run `setkeycodes` to map, say, F10 as SysRq, >>> don't we lose F10? >> >> The fact that this patch adds a "new" sysrq key no matter what is a >> non-starter, please think through the consequences of such a change... >> > > I wouldn't say this RFC adds a "new" sysrq no matter what. It does so only > when the input device (keyboard) does _not_ have SysRq key at all. So I would > say that this patch adds a replacement SysRq key if the SysRq key proper is > _physically_ absent. Which seems not such a bad thing to me. The problem I'm > trying to solve is exactly this: what to use as SysRq if there's no SysRq? > What approach is acceptable then? Any criteria other than "go guess"? Is "connect an external keyboard" the _only_ choice Linux wants to offer to its users in case of devices such as e.g. Chromebooks? Regards, Andrzej