From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9651FC433E1 for ; Tue, 18 Aug 2020 11:31:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7DE8C205CB for ; Tue, 18 Aug 2020 11:31:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726730AbgHRLbm (ORCPT ); Tue, 18 Aug 2020 07:31:42 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:57382 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726633AbgHRLaS (ORCPT ); Tue, 18 Aug 2020 07:30:18 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id 85A4A298D0A From: Andrzej Pietrasiewicz To: linux-kernel@vger.kernel.org Cc: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Greg Kroah-Hartman , Jiri Slaby , Dmitry Torokhov , Andrzej Pietrasiewicz , linux-input@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel@collabora.com Subject: [PATCH v3 0/2] Add configurable handler to execute a compound action Date: Tue, 18 Aug 2020 13:28:23 +0200 Message-Id: <20200818112825.6445-1-andrzej.p@collabora.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a follow-up of this thread: https://www.spinics.net/lists/linux-input/msg68446.html It only touches DRM (dri-devel) in such a way that it changes the help message of sysrq_drm_fb_helper_restore_op, otherwise it is unrelated to DRM. Patch 2/2 adds a configurable handler to execute a compound action. Userland might want to execute e.g. 'w' (show blocked tasks), followed by 's' (sync), followed by 1000 ms delay and then followed by 'c' (crash) upon a single magic SysRq. Or one might want to execute the famous "Raising Elephants Is So Utterly Boring" action. This patch adds a configurable handler, triggered with 'C', for this exact purpose. The user specifies the composition of the compound action using syntax similar to getopt, where each letter corresponds to an individual action and a colon followed by a number corresponds to a delay of that many milliseconds, e.g.: ws:1000c or r:100eis:1000ub An example of userspace that wants to perform a compound action is Chrome OS, where SysRq-X (pressed for the second time within a certain time period from the first time) causes showing the locked tasks, syncing, waiting a 1000 ms delay and crashing the system. Since all the slots in the sysrq_key_table[] are already taken or reserved, patch 1/2 extends it to cover also capital letter versions. v2..v3: - eliminated compile error in !CONFIG_INPUT case (kernel test robot) v1..v2: - used toupper() instead of opencoding it (Jiri Slaby) - updated help message of sysrq_drm_fb_helper_restore_op (Jiri Slaby) - used unsigned int for specifying delays (Jiri Slaby) - improved printed messages formatting (Jiri Slaby) Andrzej Pietrasiewicz (2): tty/sysrq: Extend the sysrq_key_table to cover capital letters tty/sysrq: Add configurable handler to execute a compound action Documentation/admin-guide/sysrq.rst | 11 +++ drivers/gpu/drm/drm_fb_helper.c | 2 +- drivers/tty/sysrq.c | 129 +++++++++++++++++++++++++++- include/linux/sysrq.h | 1 + 4 files changed, 140 insertions(+), 3 deletions(-) base-commit: 9123e3a74ec7b934a4a099e98af6a61c2f80bbf5 -- 2.17.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C07BAC433E1 for ; Tue, 18 Aug 2020 11:28:33 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 99D01207FF for ; Tue, 18 Aug 2020 11:28:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 99D01207FF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CA44F89A9B; Tue, 18 Aug 2020 11:28:32 +0000 (UTC) Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by gabe.freedesktop.org (Postfix) with ESMTPS id 43AA389A9B for ; Tue, 18 Aug 2020 11:28:31 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id 85A4A298D0A From: Andrzej Pietrasiewicz To: linux-kernel@vger.kernel.org Subject: [PATCH v3 0/2] Add configurable handler to execute a compound action Date: Tue, 18 Aug 2020 13:28:23 +0200 Message-Id: <20200818112825.6445-1-andrzej.p@collabora.com> X-Mailer: git-send-email 2.17.1 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-input@vger.kernel.org, Thomas Zimmermann , David Airlie , Greg Kroah-Hartman , Dmitry Torokhov , Andrzej Pietrasiewicz , dri-devel@lists.freedesktop.org, Jiri Slaby , kernel@collabora.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This is a follow-up of this thread: https://www.spinics.net/lists/linux-input/msg68446.html It only touches DRM (dri-devel) in such a way that it changes the help message of sysrq_drm_fb_helper_restore_op, otherwise it is unrelated to DRM. Patch 2/2 adds a configurable handler to execute a compound action. Userland might want to execute e.g. 'w' (show blocked tasks), followed by 's' (sync), followed by 1000 ms delay and then followed by 'c' (crash) upon a single magic SysRq. Or one might want to execute the famous "Raising Elephants Is So Utterly Boring" action. This patch adds a configurable handler, triggered with 'C', for this exact purpose. The user specifies the composition of the compound action using syntax similar to getopt, where each letter corresponds to an individual action and a colon followed by a number corresponds to a delay of that many milliseconds, e.g.: ws:1000c or r:100eis:1000ub An example of userspace that wants to perform a compound action is Chrome OS, where SysRq-X (pressed for the second time within a certain time period from the first time) causes showing the locked tasks, syncing, waiting a 1000 ms delay and crashing the system. Since all the slots in the sysrq_key_table[] are already taken or reserved, patch 1/2 extends it to cover also capital letter versions. v2..v3: - eliminated compile error in !CONFIG_INPUT case (kernel test robot) v1..v2: - used toupper() instead of opencoding it (Jiri Slaby) - updated help message of sysrq_drm_fb_helper_restore_op (Jiri Slaby) - used unsigned int for specifying delays (Jiri Slaby) - improved printed messages formatting (Jiri Slaby) Andrzej Pietrasiewicz (2): tty/sysrq: Extend the sysrq_key_table to cover capital letters tty/sysrq: Add configurable handler to execute a compound action Documentation/admin-guide/sysrq.rst | 11 +++ drivers/gpu/drm/drm_fb_helper.c | 2 +- drivers/tty/sysrq.c | 129 +++++++++++++++++++++++++++- include/linux/sysrq.h | 1 + 4 files changed, 140 insertions(+), 3 deletions(-) base-commit: 9123e3a74ec7b934a4a099e98af6a61c2f80bbf5 -- 2.17.1 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel