public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paulo Marques <pmarques@grupopie.com>
To: Roman Zippel <zippel@linux-m68k.org>
Cc: Andrew Morton <akpm@osdl.org>,
	pavel@ucw.cz, roubert@df.lth.se, stern@rowland.harvard.edu,
	dmitry.torokhov@gmail.com, linux-input@atrey.karlin.mff.cuni.cz,
	linux-kernel@vger.kernel.org
Subject: Re: [patch] Re: Magic Alt-SysRq change in 2.6.18-rc1
Date: Wed, 12 Jul 2006 20:42:09 +0100	[thread overview]
Message-ID: <44B55091.2040207@grupopie.com> (raw)
In-Reply-To: <44B4F88D.3060301@grupopie.com>

[-- Attachment #1: Type: text/plain, Size: 949 bytes --]

Paulo Marques wrote:
> Roman Zippel wrote:
>> On Tue, 11 Jul 2006, Andrew Morton wrote:
>> [...]
>>> What, actually, is the problem?
>>
>> It changes the behaviour, it will annoy the hell out of people like me 
>> who have to deal with different kernels and expect this to just work. :-(
>> Since then has it been acceptable to just go ahead and break stuff? 
>> This problem doesn't really look unsolvable, so why is my request to 
>> fix the damn thing so unreasonable?
> 
> Ok, what about this one?

It doesn't work :P

Ok, I've tested it this time and this new one works as expected. I can
use any of the sequences discussed and I can produce a SysRq every time.
Still, just pressing SysRq or any sequence that doesn't start with 
"press Alt -> press SysRq" seems unaffected.

-- 
Paulo Marques - www.grupopie.com

Pointy-Haired Boss: I don't see anything that could stand in our way.
            Dilbert: Sanity? Reality? The laws of physics?


[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 1586 bytes --]

Subject: allow the old behavior of Alt+SysRq+<key>

This should allow any order of Alt + SysRq press followed by any key
while still holding one of SysRq or Alt.

Signed-off-by: Paulo Marques <pmarques@grupopie.com>

--- ./drivers/char/keyboard.c.orig	2006-07-12 13:03:32.000000000 +0100
+++ ./drivers/char/keyboard.c	2006-07-12 20:39:21.000000000 +0100
@@ -150,7 +150,7 @@ unsigned char kbd_sysrq_xlate[KEY_MAX +
         "230\177\000\000\213\214\000\000\000\000\000\000\000\000\000\000" /* 0x50 - 0x5f */
         "\r\000/";                                      /* 0x60 - 0x6f */
 static int sysrq_down;
-static int sysrq_alt_use;
+static int sysrq_active;
 #endif
 static int sysrq_alt;

@@ -1164,16 +1164,24 @@ static void kbd_keycode(unsigned int key
 				printk(KERN_WARNING "keyboard.c: can't emulate rawmode for keycode %d\n", keycode);

 #ifdef CONFIG_MAGIC_SYSRQ	       /* Handle the SysRq Hack */
-	if (keycode == KEY_SYSRQ && (sysrq_down || (down == 1 && sysrq_alt))) {
-		if (!sysrq_down) {
-			sysrq_down = down;
-			sysrq_alt_use = sysrq_alt;
+	if (keycode == KEY_SYSRQ) {
+		if (down) {
+			if(sysrq_alt)
+				sysrq_down = down;
+		} else {
+			sysrq_down = 0;
 		}
-		return;
 	}
-	if (sysrq_down && !down && keycode == sysrq_alt_use)
-		sysrq_down = 0;
-	if (sysrq_down && down && !rep) {
+
+	if (sysrq_down && sysrq_alt)
+		sysrq_active = 1;
+	else if (!sysrq_down && !sysrq_alt)
+		sysrq_active = 0;
+
+	if (keycode == KEY_SYSRQ && sysrq_active)
+		return;
+
+	if (sysrq_active && down && !rep) {
 		handle_sysrq(kbd_sysrq_xlate[keycode], regs, tty);
 		return;
 	}

  reply	other threads:[~2006-07-12 19:42 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-09 21:06 Magic Alt-SysRq change in 2.6.18-rc1 Alan Stern
2006-07-10  0:22 ` Andrew Morton
2006-07-10  1:12 ` H. Peter Anvin
2006-07-10  3:08   ` Joshua Hudson
2006-07-10  9:44 ` Fredrik Roubert
2006-07-10  9:59   ` Michael Buesch
2006-07-10 21:59   ` Roman Zippel
2006-07-11 12:41     ` Pavel Machek
2006-07-11 22:21       ` Roman Zippel
2006-07-11 22:42         ` [patch] " Pavel Machek
2006-07-11 23:33           ` Roman Zippel
2006-07-11 23:50             ` Andrew Morton
2006-07-12  0:16               ` Roman Zippel
2006-07-12  0:37                 ` Andrew Morton
2006-07-12  0:52                   ` Roman Zippel
2006-07-12  1:36                     ` Andrew Morton
2006-07-12  8:08                       ` Pavel Machek
2006-07-12  9:07                       ` Roman Zippel
2006-07-12 13:26                         ` Paulo Marques
2006-07-12 19:42                           ` Paulo Marques [this message]
2006-07-12 20:05                             ` Dmitry Torokhov
2006-07-12 22:21                               ` Paulo Marques
2006-07-12 22:44                                 ` Pavel Machek
2006-07-13 18:48                                 ` Dmitry Torokhov
2006-07-12  7:26                 ` Fredrik Roubert
2006-07-12  9:09                   ` Roman Zippel
2006-07-12 15:12                   ` Randy.Dunlap
2006-07-11 12:42     ` Pavel Machek
2006-07-11 13:54     ` Alan Stern
     [not found] <6wOHw-5gl-23@gated-at.bofh.it>
     [not found] ` <6x0yX-5An-17@gated-at.bofh.it>
     [not found]   ` <6xc78-6gi-15@gated-at.bofh.it>
     [not found]     ` <6xyhf-5Fq-1@gated-at.bofh.it>
     [not found]       ` <6xyU6-6Hn-63@gated-at.bofh.it>
     [not found]         ` <6xzdl-75B-13@gated-at.bofh.it>
     [not found]           ` <6xzZO-8gU-23@gated-at.bofh.it>
     [not found]             ` <6xA9p-8ti-7@gated-at.bofh.it>
     [not found]               ` <6xACo-Op-1@gated-at.bofh.it>
     [not found]                 ` <6xAVM-1b9-5@gated-at.bofh.it>
     [not found]                   ` <6xBfh-1yd-29@gated-at.bofh.it>
     [not found]                     ` <6xBRQ-2v4-3@gated-at.bofh.it>
     [not found]                       ` <6xITm-4td-17@gated-at.bofh.it>
     [not found]                         ` <6xMX0-2bX-21@gated-at.bofh.it>
2006-07-12 22:06                           ` [patch] " Bodo Eggert
2006-07-12 22:35                             ` Paulo Marques

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44B55091.2040207@grupopie.com \
    --to=pmarques@grupopie.com \
    --cc=akpm@osdl.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@atrey.karlin.mff.cuni.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=roubert@df.lth.se \
    --cc=stern@rowland.harvard.edu \
    --cc=zippel@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox