* Magic Alt-SysRq change in 2.6.18-rc1
@ 2006-07-09 21:06 Alan Stern
2006-07-10 0:22 ` Andrew Morton
` (2 more replies)
0 siblings, 3 replies; 30+ messages in thread
From: Alan Stern @ 2006-07-09 21:06 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input, Kernel development list
Dmitry:
Are you the right person to handle changes in the behavior of Alt-SysRq?
Before 2.6.18-rc1, I used to be able to use it as follows:
Press and hold an Alt key,
Press and hold the SysRq key,
Release the Alt key,
Press and release some hot key like S or T or 7,
Repeat the previous step as many times as desired,
Release the SysRq key.
This scheme doesn't work any more, or if it does, the timing requirements
are now much stricter. In practice I have to hold down all three keys at
the same time; I can't release the Alt key before pressing the hot key.
This makes thinks very awkward on my laptop machine. Its keyboard
controller doesn't seem to like having three keys pressed simultaneously.
Instead of the expected hotkey behavior, I usually got an error message
from atkbd warning about too many keys being pressed. Getting it to work
as desired is hit-and-miss.
I would really appreciate going back to the old behavior, where only two
keys needed to be held down at any time.
Alan Stern
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: Magic Alt-SysRq change in 2.6.18-rc1
@ 2006-07-10 0:01 Chuck Ebbert
0 siblings, 0 replies; 30+ messages in thread
From: Chuck Ebbert @ 2006-07-10 0:01 UTC (permalink / raw)
To: Alan Stern; +Cc: linux-kernel, Dmitry Torokhov, linux-input
In-Reply-To: <Pine.LNX.4.44L0.0607091657490.28904-100000@netrider.rowland.org>
On Sun, 9 Jul 2006 17:06:57 -0400, Alan Stern wrote:
>
> <...> changes in the behavior of Alt-SysRq?
>
> Before 2.6.18-rc1, I used to be able to use it as follows:
>
> Press and hold an Alt key,
> Press and hold the SysRq key,
> Release the Alt key,
> Press and release some hot key like S or T or 7,
> Repeat the previous step as many times as desired,
> Release the SysRq key.
>
> This scheme doesn't work any more, or if it does, the timing requirements
> are now much stricter. In practice I have to hold down all three keys at
> the same time; I can't release the Alt key before pressing the hot key.
Look at the change history for keyboard.c:
[PATCH] fix magic sysrq on strange keyboards
Magic sysrq fails to work on many keyboards, particulary most of notebook
keyboards. This patch fixes it.
The idea is quite simple: Discard the SysRq break code if Alt is still being
held down. This way the broken keyboard can send the break code (or the user
with a normal keyboard can release the SysRq key) and the kernel waits until
the next key is pressed or the Alt key is released.
--
Chuck
"You can't read a newspaper if you can't read." --George W. Bush
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: Magic Alt-SysRq change in 2.6.18-rc1
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 9:44 ` Fredrik Roubert
2 siblings, 0 replies; 30+ messages in thread
From: Andrew Morton @ 2006-07-10 0:22 UTC (permalink / raw)
To: Alan Stern; +Cc: dmitry.torokhov, linux-input, linux-kernel, Fredrik Roubert
On Sun, 9 Jul 2006 17:06:57 -0400 (EDT)
Alan Stern <stern@rowland.harvard.edu> wrote:
> Dmitry:
>
> Are you the right person to handle changes in the behavior of Alt-SysRq?
>
> Before 2.6.18-rc1, I used to be able to use it as follows:
>
> Press and hold an Alt key,
> Press and hold the SysRq key,
> Release the Alt key,
> Press and release some hot key like S or T or 7,
> Repeat the previous step as many times as desired,
> Release the SysRq key.
>
> This scheme doesn't work any more, or if it does, the timing requirements
> are now much stricter. In practice I have to hold down all three keys at
> the same time; I can't release the Alt key before pressing the hot key.
>
> This makes thinks very awkward on my laptop machine. Its keyboard
> controller doesn't seem to like having three keys pressed simultaneously.
> Instead of the expected hotkey behavior, I usually got an error message
> from atkbd warning about too many keys being pressed. Getting it to work
> as desired is hit-and-miss.
>
> I would really appreciate going back to the old behavior, where only two
> keys needed to be held down at any time.
>
I assume reverting the below will fix it?
From: Fredrik Roubert <roubert@df.lth.se>
Magic sysrq fails to work on many keyboards, particulary most of notebook
keyboards. This patch fixes it.
The idea is quite simple: Discard the SysRq break code if Alt is still being
held down. This way the broken keyboard can send the break code (or the user
with a normal keyboard can release the SysRq key) and the kernel waits until
the next key is pressed or the Alt key is released.
Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---
drivers/char/keyboard.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff -puN drivers/char/keyboard.c~fix-magic-sysrq-on-strange-keyboards drivers/char/keyboard.c
--- a/drivers/char/keyboard.c~fix-magic-sysrq-on-strange-keyboards
+++ a/drivers/char/keyboard.c
@@ -151,6 +151,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;
#endif
static int sysrq_alt;
@@ -1143,7 +1144,7 @@ static void kbd_keycode(unsigned int key
kbd = kbd_table + fg_console;
if (keycode == KEY_LEFTALT || keycode == KEY_RIGHTALT)
- sysrq_alt = down;
+ sysrq_alt = down ? keycode : 0;
#ifdef CONFIG_SPARC
if (keycode == KEY_STOP)
sparc_l1_a_state = down;
@@ -1163,9 +1164,14 @@ static void kbd_keycode(unsigned int key
#ifdef CONFIG_MAGIC_SYSRQ /* Handle the SysRq Hack */
if (keycode == KEY_SYSRQ && (sysrq_down || (down == 1 && sysrq_alt))) {
- sysrq_down = down;
+ if (!sysrq_down) {
+ sysrq_down = down;
+ sysrq_alt_use = sysrq_alt;
+ }
return;
}
+ if (sysrq_down && !down && keycode == sysrq_alt_use)
+ sysrq_down = 0;
if (sysrq_down && down && !rep) {
handle_sysrq(kbd_sysrq_xlate[keycode], regs, tty);
return;
_
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: Magic Alt-SysRq change in 2.6.18-rc1
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
2 siblings, 1 reply; 30+ messages in thread
From: H. Peter Anvin @ 2006-07-10 1:12 UTC (permalink / raw)
To: Alan Stern; +Cc: Dmitry Torokhov, linux-input, Kernel development list
Alan Stern wrote:
> Dmitry:
>
> Are you the right person to handle changes in the behavior of Alt-SysRq?
>
> Before 2.6.18-rc1, I used to be able to use it as follows:
>
> Press and hold an Alt key,
> Press and hold the SysRq key,
> Release the Alt key,
> Press and release some hot key like S or T or 7,
> Repeat the previous step as many times as desired,
> Release the SysRq key.
>
> This scheme doesn't work any more, or if it does, the timing requirements
> are now much stricter. In practice I have to hold down all three keys at
> the same time; I can't release the Alt key before pressing the hot key.
>
> This makes thinks very awkward on my laptop machine. Its keyboard
> controller doesn't seem to like having three keys pressed simultaneously.
> Instead of the expected hotkey behavior, I usually got an error message
> from atkbd warning about too many keys being pressed. Getting it to work
> as desired is hit-and-miss.
>
> I would really appreciate going back to the old behavior, where only two
> keys needed to be held down at any time.
>
Looks like the current keyboard code lets you press Alt-SysRq,
Alt-<letter> without keeping the SysRq key held down, as long as you
don't release the Alt key.
That seems a lot more user-friendly to me.
-hpa
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: Magic Alt-SysRq change in 2.6.18-rc1
2006-07-10 1:12 ` H. Peter Anvin
@ 2006-07-10 3:08 ` Joshua Hudson
0 siblings, 0 replies; 30+ messages in thread
From: Joshua Hudson @ 2006-07-10 3:08 UTC (permalink / raw)
To: linux-kernel
> Looks like the current keyboard code lets you press Alt-SysRq,
> Alt-<letter> without keeping the SysRq key held down, as long as you
> don't release the Alt key.
>
> That seems a lot more user-friendly to me.
>
> -hpa
I second that. Using a non-modifier key (PrntScrn) as modifier is weird.
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: Magic Alt-SysRq change in 2.6.18-rc1
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 9:44 ` Fredrik Roubert
2006-07-10 9:59 ` Michael Buesch
2006-07-10 21:59 ` Roman Zippel
2 siblings, 2 replies; 30+ messages in thread
From: Fredrik Roubert @ 2006-07-10 9:44 UTC (permalink / raw)
To: Alan Stern; +Cc: Dmitry Torokhov, linux-input, linux-kernel
On Sun 09 Jul 23:06 CEST 2006, Alan Stern wrote:
> Before 2.6.18-rc1, I used to be able to use it as follows:
>
> Press and hold an Alt key,
> Press and hold the SysRq key,
> Release the Alt key,
> Press and release some hot key like S or T or 7,
> Repeat the previous step as many times as desired,
> Release the SysRq key.
>
> This scheme doesn't work any more,
The SysRq code has been updated to make it useable with keyboards that
are broken in other ways than your. With the new behaviour, you should
be able to use Magic SysRq with your keyboard in this way:
Press and hold an Alt key,
Press and release the SysRq key,
Press and release some hot key like S or T or 7,
Repeat the previous step as many times as desired,
Release the Alt key.
Does that work for you?
Cheers // Fredrik Roubert
--
Visserij 192 | +32 473 344527 / +46 708 776974
BE-9000 Gent | http://www.df.lth.se/~roubert/
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: Magic Alt-SysRq change in 2.6.18-rc1
2006-07-10 9:44 ` Fredrik Roubert
@ 2006-07-10 9:59 ` Michael Buesch
2006-07-10 21:59 ` Roman Zippel
1 sibling, 0 replies; 30+ messages in thread
From: Michael Buesch @ 2006-07-10 9:59 UTC (permalink / raw)
To: Fredrik Roubert; +Cc: Alan Stern, Dmitry Torokhov, linux-input, linux-kernel
On Monday 10 July 2006 11:44, Fredrik Roubert wrote:
> On Sun 09 Jul 23:06 CEST 2006, Alan Stern wrote:
>
> > Before 2.6.18-rc1, I used to be able to use it as follows:
> >
> > Press and hold an Alt key,
> > Press and hold the SysRq key,
> > Release the Alt key,
> > Press and release some hot key like S or T or 7,
> > Repeat the previous step as many times as desired,
> > Release the SysRq key.
> >
> > This scheme doesn't work any more,
>
> The SysRq code has been updated to make it useable with keyboards that
> are broken in other ways than your. With the new behaviour, you should
> be able to use Magic SysRq with your keyboard in this way:
>
> Press and hold an Alt key,
> Press and release the SysRq key,
> Press and release some hot key like S or T or 7,
> Repeat the previous step as many times as desired,
> Release the Alt key.
While we are at it, does someone know how to trigger
the sysrq on a PowerBook? Kernel Documentation says to press F13,
but the PowerBook keyboard does not have F13.
--
Greetings Michael.
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: Magic Alt-SysRq change in 2.6.18-rc1
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
` (2 more replies)
1 sibling, 3 replies; 30+ messages in thread
From: Roman Zippel @ 2006-07-10 21:59 UTC (permalink / raw)
To: Fredrik Roubert; +Cc: Alan Stern, Dmitry Torokhov, linux-input, linux-kernel
Hi,
On Mon, 10 Jul 2006, Fredrik Roubert wrote:
> > Before 2.6.18-rc1, I used to be able to use it as follows:
> >
> > Press and hold an Alt key,
> > Press and hold the SysRq key,
> > Release the Alt key,
> > Press and release some hot key like S or T or 7,
> > Repeat the previous step as many times as desired,
> > Release the SysRq key.
> >
> > This scheme doesn't work any more,
>
> The SysRq code has been updated to make it useable with keyboards that
> are broken in other ways than your. With the new behaviour, you should
> be able to use Magic SysRq with your keyboard in this way:
Apparently it changes existing well documented behaviour, which is a
really bad idea.
bye, Roman
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: Magic Alt-SysRq change in 2.6.18-rc1
2006-07-10 21:59 ` Roman Zippel
@ 2006-07-11 12:41 ` Pavel Machek
2006-07-11 22:21 ` Roman Zippel
2006-07-11 12:42 ` Pavel Machek
2006-07-11 13:54 ` Alan Stern
2 siblings, 1 reply; 30+ messages in thread
From: Pavel Machek @ 2006-07-11 12:41 UTC (permalink / raw)
To: Roman Zippel
Cc: Fredrik Roubert, Alan Stern, Dmitry Torokhov, linux-input,
linux-kernel
Hi!
> > > Before 2.6.18-rc1, I used to be able to use it as follows:
> > >
> > > Press and hold an Alt key,
> > > Press and hold the SysRq key,
> > > Release the Alt key,
> > > Press and release some hot key like S or T or 7,
> > > Repeat the previous step as many times as desired,
> > > Release the SysRq key.
> > >
> > > This scheme doesn't work any more,
> >
> > The SysRq code has been updated to make it useable with keyboards that
> > are broken in other ways than your. With the new behaviour, you should
> > be able to use Magic SysRq with your keyboard in this way:
>
> Apparently it changes existing well documented behaviour, which is a
> really bad idea.
_well documented_? Where was it documented? Anyway, 2.6.17 behaviour
does not work on _many_ keyboards, like for example thinkpad x32...
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: Magic Alt-SysRq change in 2.6.18-rc1
2006-07-10 21:59 ` Roman Zippel
2006-07-11 12:41 ` Pavel Machek
@ 2006-07-11 12:42 ` Pavel Machek
2006-07-11 13:54 ` Alan Stern
2 siblings, 0 replies; 30+ messages in thread
From: Pavel Machek @ 2006-07-11 12:42 UTC (permalink / raw)
To: Roman Zippel
Cc: Fredrik Roubert, Alan Stern, Dmitry Torokhov, linux-input,
linux-kernel
Hi!
> > > Before 2.6.18-rc1, I used to be able to use it as follows:
> > >
> > > Press and hold an Alt key,
> > > Press and hold the SysRq key,
> > > Release the Alt key,
> > > Press and release some hot key like S or T or 7,
> > > Repeat the previous step as many times as desired,
> > > Release the SysRq key.
> > >
> > > This scheme doesn't work any more,
> >
> > The SysRq code has been updated to make it useable with keyboards that
> > are broken in other ways than your. With the new behaviour, you should
> > be able to use Magic SysRq with your keyboard in this way:
>
> Apparently it changes existing well documented behaviour, which is a
> really bad idea.
(Actually, I do not care much if current approach stays or goes, but
many keyboards can't use sysrq as a modifier, and that needs to be
somehow solved. 2.6.18-rc1 behaviour provides a solution.)
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: Magic Alt-SysRq change in 2.6.18-rc1
2006-07-10 21:59 ` Roman Zippel
2006-07-11 12:41 ` Pavel Machek
2006-07-11 12:42 ` Pavel Machek
@ 2006-07-11 13:54 ` Alan Stern
2 siblings, 0 replies; 30+ messages in thread
From: Alan Stern @ 2006-07-11 13:54 UTC (permalink / raw)
To: Roman Zippel
Cc: Fredrik Roubert, Dmitry Torokhov, linux-input,
Kernel development list
On Mon, 10 Jul 2006, Roman Zippel wrote:
> Hi,
>
> On Mon, 10 Jul 2006, Fredrik Roubert wrote:
>
> > > Before 2.6.18-rc1, I used to be able to use it as follows:
> > >
> > > Press and hold an Alt key,
> > > Press and hold the SysRq key,
> > > Release the Alt key,
> > > Press and release some hot key like S or T or 7,
> > > Repeat the previous step as many times as desired,
> > > Release the SysRq key.
> > >
> > > This scheme doesn't work any more,
> >
> > The SysRq code has been updated to make it useable with keyboards that
> > are broken in other ways than your. With the new behaviour, you should
> > be able to use Magic SysRq with your keyboard in this way:
Thanks to everyone who replied. Holding down the Alt key instead of the
SysRq key does indeed make everything work well.
> Apparently it changes existing well documented behaviour, which is a
> really bad idea.
In this case it's not all that bad, because Alt-SysRq is used only by a
relatively small community of developers (it is a debugging tool, after
all).
Changing well documented behavior wouldn't be so bad if the changes were
also well documented and easily available for perusal. Perhaps there
should be an area on www.kernel.org devoted to listing the new features
and changes added by each kernel release.
Alan Stern
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: Magic Alt-SysRq change in 2.6.18-rc1
2006-07-11 12:41 ` Pavel Machek
@ 2006-07-11 22:21 ` Roman Zippel
2006-07-11 22:42 ` [patch] " Pavel Machek
0 siblings, 1 reply; 30+ messages in thread
From: Roman Zippel @ 2006-07-11 22:21 UTC (permalink / raw)
To: Pavel Machek
Cc: Fredrik Roubert, Alan Stern, Dmitry Torokhov, linux-input,
linux-kernel
Hi,
On Tue, 11 Jul 2006, Pavel Machek wrote:
> > Apparently it changes existing well documented behaviour, which is a
> > really bad idea.
>
> _well documented_? Where was it documented? Anyway, 2.6.17 behaviour
> does not work on _many_ keyboards, like for example thinkpad x32...
Documentation/sysrq.txt and this was working on _many_ more keyboards just
fine.
The fact is this patch changes existing behaviour, it either needs to be
fixed or reverted. Adding new features is one thing, breaking existing
features is not acceptable without a very good reason.
bye, Roman
^ permalink raw reply [flat|nested] 30+ messages in thread
* [patch] Re: Magic Alt-SysRq change in 2.6.18-rc1
2006-07-11 22:21 ` Roman Zippel
@ 2006-07-11 22:42 ` Pavel Machek
2006-07-11 23:33 ` Roman Zippel
0 siblings, 1 reply; 30+ messages in thread
From: Pavel Machek @ 2006-07-11 22:42 UTC (permalink / raw)
To: Roman Zippel, Andrew Morton
Cc: Fredrik Roubert, Alan Stern, Dmitry Torokhov, linux-input,
linux-kernel
On Wed 2006-07-12 00:21:31, Roman Zippel wrote:
> Hi,
>
> On Tue, 11 Jul 2006, Pavel Machek wrote:
>
> > > Apparently it changes existing well documented behaviour, which is a
> > > really bad idea.
> >
> > _well documented_? Where was it documented? Anyway, 2.6.17 behaviour
> > does not work on _many_ keyboards, like for example thinkpad x32...
>
> Documentation/sysrq.txt and this was working on _many_ more keyboards just
> fine.
> The fact is this patch changes existing behaviour, it either needs to be
> fixed or reverted. Adding new features is one thing, breaking existing
> features is not acceptable without a very good reason.
Your "well documented" is sentence "you may have better luck
with"... okay, but we now have better sentence. Document it better.
BTW I believe that original way (alt down, sysrq down, b down) still
works before and after the patch.
Here's patch that updates docs with now-working trick.
Signed-off-by: Pavel Machek <pavel@suse.cz>
diff --git a/Documentation/sysrq.txt b/Documentation/sysrq.txt
index e0188a2..58e04c0 100644
--- a/Documentation/sysrq.txt
+++ b/Documentation/sysrq.txt
@@ -43,7 +43,7 @@ On x86 - You press the key combo 'ALT-
keyboards may not have a key labeled 'SysRq'. The 'SysRq' key is
also known as the 'Print Screen' key. Also some keyboards cannot
handle so many keys being pressed at the same time, so you might
- have better luck with "press Alt", "press SysRq", "release Alt",
+ have better luck with "press Alt", "press SysRq", "release SysRq",
"press <command key>", release everything.
On SPARC - You press 'ALT-STOP-<command key>', I believe.
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply related [flat|nested] 30+ messages in thread
* Re: [patch] Re: Magic Alt-SysRq change in 2.6.18-rc1
2006-07-11 22:42 ` [patch] " Pavel Machek
@ 2006-07-11 23:33 ` Roman Zippel
2006-07-11 23:50 ` Andrew Morton
0 siblings, 1 reply; 30+ messages in thread
From: Roman Zippel @ 2006-07-11 23:33 UTC (permalink / raw)
To: Pavel Machek
Cc: Andrew Morton, Fredrik Roubert, Alan Stern, Dmitry Torokhov,
linux-input, linux-kernel
Hi,
On Wed, 12 Jul 2006, Pavel Machek wrote:
> BTW I believe that original way (alt down, sysrq down, b down) still
> works before and after the patch.
No, it doesn't.
> Here's patch that updates docs with now-working trick.
NACK.
bye, Roman
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [patch] Re: Magic Alt-SysRq change in 2.6.18-rc1
2006-07-11 23:33 ` Roman Zippel
@ 2006-07-11 23:50 ` Andrew Morton
2006-07-12 0:16 ` Roman Zippel
0 siblings, 1 reply; 30+ messages in thread
From: Andrew Morton @ 2006-07-11 23:50 UTC (permalink / raw)
To: Roman Zippel
Cc: pavel, roubert, stern, dmitry.torokhov, linux-input, linux-kernel
Roman Zippel <zippel@linux-m68k.org> wrote:
>
> Hi,
>
> On Wed, 12 Jul 2006, Pavel Machek wrote:
>
> > BTW I believe that original way (alt down, sysrq down, b down) still
> > works before and after the patch.
>
> No, it doesn't.
>
> > Here's patch that updates docs with now-working trick.
>
> NACK.
>
Nack your nack! The patch in 2.6.18-rc1 makes sysrq work on machines on
which it *did not work at all*. If that makes it harder to type but still
possible to type on other machines, well, we win.
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [patch] Re: Magic Alt-SysRq change in 2.6.18-rc1
2006-07-11 23:50 ` Andrew Morton
@ 2006-07-12 0:16 ` Roman Zippel
2006-07-12 0:37 ` Andrew Morton
2006-07-12 7:26 ` Fredrik Roubert
0 siblings, 2 replies; 30+ messages in thread
From: Roman Zippel @ 2006-07-12 0:16 UTC (permalink / raw)
To: Andrew Morton
Cc: pavel, roubert, stern, dmitry.torokhov, linux-input, linux-kernel
Hi,
On Tue, 11 Jul 2006, Andrew Morton wrote:
> > On Wed, 12 Jul 2006, Pavel Machek wrote:
> >
> > > BTW I believe that original way (alt down, sysrq down, b down) still
> > > works before and after the patch.
> >
> > No, it doesn't.
> >
> > > Here's patch that updates docs with now-working trick.
> >
> > NACK.
> >
>
> Nack your nack! The patch in 2.6.18-rc1 makes sysrq work on machines on
> which it *did not work at all*. If that makes it harder to type but still
> possible to type on other machines, well, we win.
Why can't we even _try_ to preserve compatibility? :-(
bye, Roman
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [patch] Re: Magic Alt-SysRq change in 2.6.18-rc1
2006-07-12 0:16 ` Roman Zippel
@ 2006-07-12 0:37 ` Andrew Morton
2006-07-12 0:52 ` Roman Zippel
2006-07-12 7:26 ` Fredrik Roubert
1 sibling, 1 reply; 30+ messages in thread
From: Andrew Morton @ 2006-07-12 0:37 UTC (permalink / raw)
To: Roman Zippel
Cc: pavel, roubert, stern, dmitry.torokhov, linux-input, linux-kernel
Roman Zippel <zippel@linux-m68k.org> wrote:
>
> Hi,
>
> On Tue, 11 Jul 2006, Andrew Morton wrote:
>
> > > On Wed, 12 Jul 2006, Pavel Machek wrote:
> > >
> > > > BTW I believe that original way (alt down, sysrq down, b down) still
> > > > works before and after the patch.
> > >
> > > No, it doesn't.
> > >
> > > > Here's patch that updates docs with now-working trick.
> > >
> > > NACK.
> > >
> >
> > Nack your nack! The patch in 2.6.18-rc1 makes sysrq work on machines on
> > which it *did not work at all*. If that makes it harder to type but still
> > possible to type on other machines, well, we win.
>
> Why can't we even _try_ to preserve compatibility? :-(
>
It would of course be good if we could do that. If it's impossible to
retain the old behaviour without breaking those oddball keyboards then
we're screwed.
IOW, someone needs to find a way to make the new code work like the old
code without re-breaking Pavel's keyboard. But the bitchin-to-patchin
ratio here seems to exclude that outcome.
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [patch] Re: Magic Alt-SysRq change in 2.6.18-rc1
2006-07-12 0:37 ` Andrew Morton
@ 2006-07-12 0:52 ` Roman Zippel
2006-07-12 1:36 ` Andrew Morton
0 siblings, 1 reply; 30+ messages in thread
From: Roman Zippel @ 2006-07-12 0:52 UTC (permalink / raw)
To: Andrew Morton
Cc: pavel, roubert, stern, dmitry.torokhov, linux-input, linux-kernel
Hi,
On Tue, 11 Jul 2006, Andrew Morton wrote:
> > > > > BTW I believe that original way (alt down, sysrq down, b down) still
> > > > > works before and after the patch.
> > > >
> > > > No, it doesn't.
> > > >
> > > > > Here's patch that updates docs with now-working trick.
> > > >
> > > > NACK.
> > > >
> > >
> > > Nack your nack! The patch in 2.6.18-rc1 makes sysrq work on machines on
> > > which it *did not work at all*. If that makes it harder to type but still
> > > possible to type on other machines, well, we win.
> >
> > Why can't we even _try_ to preserve compatibility? :-(
> >
>
> It would of course be good if we could do that. If it's impossible to
> retain the old behaviour without breaking those oddball keyboards then
> we're screwed.
>
> IOW, someone needs to find a way to make the new code work like the old
> code without re-breaking Pavel's keyboard. But the bitchin-to-patchin
> ratio here seems to exclude that outcome.
Traditionally that responsibility is in the hands of whose who break it in
the first place, so this patch needs to be either reverted or fixed
(preferably before 2.18).
bye, Roman
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [patch] Re: Magic Alt-SysRq change in 2.6.18-rc1
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
0 siblings, 2 replies; 30+ messages in thread
From: Andrew Morton @ 2006-07-12 1:36 UTC (permalink / raw)
To: Roman Zippel
Cc: pavel, roubert, stern, dmitry.torokhov, linux-input, linux-kernel
On Wed, 12 Jul 2006 02:52:24 +0200 (CEST)
Roman Zippel <zippel@linux-m68k.org> wrote:
> > IOW, someone needs to find a way to make the new code work like the old
> > code without re-breaking Pavel's keyboard. But the bitchin-to-patchin
> > ratio here seems to exclude that outcome.
>
> Traditionally that responsibility is in the hands of whose who break it in
> the first place
If that person cannot reproduce the problem but another skilled kernel
developer can then it would make sense for he-who-can-reproduce-it to do
some work.
Still, I doubt if that's the case here.
Is the below correct?
Old behaviour:
a) press alt
b) press sysrq
c) release alt
d) press T
e) release T
f) release sysrq
New behaviour:
a) press alt
b) press sysrq
c) release sysrq
d) press T
e) release T
f) release alt
If so, then the old behaviour was weird and the new behaviour is sensible.
What, actually, is the problem?
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [patch] Re: Magic Alt-SysRq change in 2.6.18-rc1
2006-07-12 0:16 ` Roman Zippel
2006-07-12 0:37 ` Andrew Morton
@ 2006-07-12 7:26 ` Fredrik Roubert
2006-07-12 9:09 ` Roman Zippel
2006-07-12 15:12 ` Randy.Dunlap
1 sibling, 2 replies; 30+ messages in thread
From: Fredrik Roubert @ 2006-07-12 7:26 UTC (permalink / raw)
To: Roman Zippel
Cc: Andrew Morton, pavel, stern, dmitry.torokhov, linux-input,
linux-kernel
On Wed 12 Jul 02:16 CEST 2006, Roman Zippel wrote:
> > Nack your nack! The patch in 2.6.18-rc1 makes sysrq work on machines on
> > which it *did not work at all*. If that makes it harder to type but still
> > possible to type on other machines, well, we win.
>
> Why can't we even _try_ to preserve compatibility? :-(
First, please note that the documented behaviour (You press the key
combo 'ALT-SysRq-<command key>'.) still works.
The problem at hand is that not all keyboards can handle this many keys
pressed at once, and that there also are keyboards broken in other ways.
The work-around suggested in the documentation ([Y]ou might have better
luck with "press Alt", "press SysRq", "release Alt", "press <command
key>", release everything.) does not work with keyboards that sends the
make and break codes for SysRq immediately after another, and this was
the reason for changing the behaviour (for broken keyboards) in
2.6.18-rc1. The new behaviour works with every keyboard the people
involved in this discussion has heard of.
That the documentation wasn't updated with the new work-around key
combination for broken keyboards was a mistake.
Cheers // Fredrik Roubert
--
Visserij 192 | +32 473 344527 / +46 708 776974
BE-9000 Gent | http://www.df.lth.se/~roubert/
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [patch] Re: Magic Alt-SysRq change in 2.6.18-rc1
2006-07-12 1:36 ` Andrew Morton
@ 2006-07-12 8:08 ` Pavel Machek
2006-07-12 9:07 ` Roman Zippel
1 sibling, 0 replies; 30+ messages in thread
From: Pavel Machek @ 2006-07-12 8:08 UTC (permalink / raw)
To: Andrew Morton
Cc: Roman Zippel, roubert, stern, dmitry.torokhov, linux-input,
linux-kernel
Hi!
> > > IOW, someone needs to find a way to make the new code work like the old
> > > code without re-breaking Pavel's keyboard. But the bitchin-to-patchin
> > > ratio here seems to exclude that outcome.
> >
> > Traditionally that responsibility is in the hands of whose who break it in
> > the first place
>
> If that person cannot reproduce the problem but another skilled kernel
> developer can then it would make sense for he-who-can-reproduce-it to do
> some work.
>
> Still, I doubt if that's the case here.
>
>
> Is the below correct?
>
> Old behaviour:
>
> a) press alt
> b) press sysrq
> c) release alt
> d) press T
> e) release T
> f) release sysrq
>
> New behaviour:
>
> a) press alt
> b) press sysrq
> c) release sysrq
> d) press T
> e) release T
> f) release alt
Plus there was "very old" behaviour:
a) press alt
b) press sysrq
c) press T
d) release T
e) release sysrq
f) release alt
...that worked along with "old" behaviour....
> If so, then the old behaviour was weird and the new behaviour is sensible.
> What, actually, is the problem?
I'd agree. ...and was _real_ weird.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [patch] Re: Magic Alt-SysRq change in 2.6.18-rc1
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
1 sibling, 1 reply; 30+ messages in thread
From: Roman Zippel @ 2006-07-12 9:07 UTC (permalink / raw)
To: Andrew Morton
Cc: pavel, roubert, stern, dmitry.torokhov, linux-input, linux-kernel
Hi,
On Tue, 11 Jul 2006, Andrew Morton wrote:
> > Traditionally that responsibility is in the hands of whose who break it in
> > the first place
>
> If that person cannot reproduce the problem but another skilled kernel
> developer can then it would make sense for he-who-can-reproduce-it to do
> some work.
>
> Still, I doubt if that's the case here.
>
>
> Is the below correct?
>
> Old behaviour:
>
> a) press alt
> b) press sysrq
> c) release alt
> d) press T
> e) release T
> f) release sysrq
>
> New behaviour:
>
> a) press alt
> b) press sysrq
> c) release sysrq
> d) press T
> e) release T
> f) release alt
>
> If so, then the old behaviour was weird and the new behaviour is sensible.
It may be weird, but it was documented and people know about it.
> 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?
bye, Roman
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [patch] Re: Magic Alt-SysRq change in 2.6.18-rc1
2006-07-12 7:26 ` Fredrik Roubert
@ 2006-07-12 9:09 ` Roman Zippel
2006-07-12 15:12 ` Randy.Dunlap
1 sibling, 0 replies; 30+ messages in thread
From: Roman Zippel @ 2006-07-12 9:09 UTC (permalink / raw)
To: Fredrik Roubert
Cc: Andrew Morton, pavel, stern, dmitry.torokhov, linux-input,
linux-kernel
Hi,
On Wed, 12 Jul 2006, Fredrik Roubert wrote:
> The work-around suggested in the documentation ([Y]ou might have better
> luck with "press Alt", "press SysRq", "release Alt", "press <command
> key>", release everything.) does not work with keyboards that sends the
> make and break codes for SysRq immediately after another, and this was
> the reason for changing the behaviour (for broken keyboards) in
> 2.6.18-rc1. The new behaviour works with every keyboard the people
> involved in this discussion has heard of.
Could you please try to get both methods working?
bye, Roman
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [patch] Re: Magic Alt-SysRq change in 2.6.18-rc1
2006-07-12 9:07 ` Roman Zippel
@ 2006-07-12 13:26 ` Paulo Marques
2006-07-12 19:42 ` Paulo Marques
0 siblings, 1 reply; 30+ messages in thread
From: Paulo Marques @ 2006-07-12 13:26 UTC (permalink / raw)
To: Roman Zippel
Cc: Andrew Morton, pavel, roubert, stern, dmitry.torokhov,
linux-input, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 999 bytes --]
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?
I don't have time to test it (it compiles, at least), but it seems the
logic is pretty clear: once you have pressed both "Alt" and "SysRq"
sysrq mode becomes active until you release *both* keys. In this mode
any regular key press triggers handle_sysrq.
This allows for all the combinations mentioned before in this thread and
makes the logic simpler, IMHO.
--
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: 1462 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 14:18:52.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,17 @@ 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) {
+ sysrq_down = down;
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 (sysrq_active && down && !rep) {
handle_sysrq(kbd_sysrq_xlate[keycode], regs, tty);
return;
}
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [patch] Re: Magic Alt-SysRq change in 2.6.18-rc1
2006-07-12 7:26 ` Fredrik Roubert
2006-07-12 9:09 ` Roman Zippel
@ 2006-07-12 15:12 ` Randy.Dunlap
1 sibling, 0 replies; 30+ messages in thread
From: Randy.Dunlap @ 2006-07-12 15:12 UTC (permalink / raw)
To: Fredrik Roubert
Cc: zippel, akpm, pavel, stern, dmitry.torokhov, linux-input,
linux-kernel
On Wed, 12 Jul 2006 09:26:28 +0200 Fredrik Roubert wrote:
> On Wed 12 Jul 02:16 CEST 2006, Roman Zippel wrote:
>
> > > Nack your nack! The patch in 2.6.18-rc1 makes sysrq work on machines on
> > > which it *did not work at all*. If that makes it harder to type but still
> > > possible to type on other machines, well, we win.
> >
> > Why can't we even _try_ to preserve compatibility? :-(
>
> First, please note that the documented behaviour (You press the key
> combo 'ALT-SysRq-<command key>'.) still works.
>
> The problem at hand is that not all keyboards can handle this many keys
> pressed at once, and that there also are keyboards broken in other ways.
>
> The work-around suggested in the documentation ([Y]ou might have better
> luck with "press Alt", "press SysRq", "release Alt", "press <command
> key>", release everything.) does not work with keyboards that sends the
> make and break codes for SysRq immediately after another, and this was
> the reason for changing the behaviour (for broken keyboards) in
> 2.6.18-rc1. The new behaviour works with every keyboard the people
> involved in this discussion has heard of.
>
> That the documentation wasn't updated with the new work-around key
> combination for broken keyboards was a mistake.
In the past, I've had/used several huge-company black
keyboards that didn't work (recognize) Alt-SysRq-X.
Should they work now? (I don't currently have one.)
It would be very nice if they do.
---
~Randy
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [patch] Re: Magic Alt-SysRq change in 2.6.18-rc1
2006-07-12 13:26 ` Paulo Marques
@ 2006-07-12 19:42 ` Paulo Marques
2006-07-12 20:05 ` Dmitry Torokhov
0 siblings, 1 reply; 30+ messages in thread
From: Paulo Marques @ 2006-07-12 19:42 UTC (permalink / raw)
To: Roman Zippel
Cc: Andrew Morton, pavel, roubert, stern, dmitry.torokhov,
linux-input, linux-kernel
[-- 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;
}
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [patch] Re: Magic Alt-SysRq change in 2.6.18-rc1
2006-07-12 19:42 ` Paulo Marques
@ 2006-07-12 20:05 ` Dmitry Torokhov
2006-07-12 22:21 ` Paulo Marques
0 siblings, 1 reply; 30+ messages in thread
From: Dmitry Torokhov @ 2006-07-12 20:05 UTC (permalink / raw)
To: Paulo Marques
Cc: Roman Zippel, Andrew Morton, pavel, roubert, stern, linux-input,
linux-kernel
Hi,
On 7/12/06, Paulo Marques <pmarques@grupopie.com> wrote:
>
> 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.
>
I like this, however:
> + if (keycode == KEY_SYSRQ) {
> + if (down) {
> + if(sysrq_alt)
> + sysrq_down = down;
> + } else {
> + sysrq_down = 0;
Are you sure? This will set sysrq_down only if ALT has already been
pressed. If SysRq does not autorepeat and it is pressed first we won't
ever see sysrq_down. Am I missing something?
> +
> + if (sysrq_down && sysrq_alt)
> + sysrq_active = 1;
> + else if (!sysrq_down && !sysrq_alt)
> + sysrq_active = 0;
> +
> + if (keycode == KEY_SYSRQ && sysrq_active)
> + return;
What about alt? I think that "if (...) sysrq_active = 1;" statement
should go down, below handle_sysrq block.
> +
> + if (sysrq_active && down && !rep) {
> handle_sysrq(kbd_sysrq_xlate[keycode], regs, tty);
> return;
> }
>
We also need to check if emulate_raw() needs to be adjusted...
--
Dmitry
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [patch] Re: Magic Alt-SysRq change in 2.6.18-rc1
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
0 siblings, 2 replies; 30+ messages in thread
From: Paulo Marques @ 2006-07-12 22:21 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Roman Zippel, Andrew Morton, pavel, roubert, stern, linux-input,
linux-kernel
Dmitry Torokhov wrote:
> Hi,
>
> On 7/12/06, Paulo Marques <pmarques@grupopie.com> wrote:
>
>> 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.
>
> I like this, however:
>
>> + if (keycode == KEY_SYSRQ) {
>> + if (down) {
>> + if(sysrq_alt)
>> + sysrq_down = down;
>> + } else {
>> + sysrq_down = 0;
>
> Are you sure? This will set sysrq_down only if ALT has already been
> pressed. If SysRq does not autorepeat and it is pressed first we won't
> ever see sysrq_down. Am I missing something?
This was done on purpose, yes. My first thought was to allow any order,
but this could cause strange complications like: if I just press
PrintScreen when is it ok to forward that keypress before I press Alt?
The Alt afterwards arrives to late to not have messed the user space
application already.
Anyway, none of the sequences posted required this, and it is more
intuitive to press Alt first anyway.
>> +
>> + if (sysrq_down && sysrq_alt)
>> + sysrq_active = 1;
>> + else if (!sysrq_down && !sysrq_alt)
>> + sysrq_active = 0;
>> +
>> + if (keycode == KEY_SYSRQ && sysrq_active)
>> + return;
>
> What about alt? I think that "if (...) sysrq_active = 1;" statement
> should go down, below handle_sysrq block.
It can not go down, or when you press Alt and then SysRq, the first
SysRq down event will get through without returning.
alt is handled a little higher in that function outside the #IFDEF. This
is because emulate_raw should work even if we don't support magic sysrq.
The logic here is pretty simple: if we press Alt and then SysRq we enter
sysrq_active mode. We only come out of that mode when we release both
keys. Releasing any one of them individually is fine.
Any KEY_SYSRQ repetitions or releases while on this mode are not
processed any further.
Oops, I just realised that if I release Alt first and then SysRq, the
SysRq release will get through because at that point we're already out
of sysrq_active mode. This should be easy to fix, though. If this is a
problem, I can send a new patch tomorrow (with some more comments in
there, too).
>> +
>> + if (sysrq_active && down && !rep) {
>> handle_sysrq(kbd_sysrq_xlate[keycode], regs, tty);
>> return;
>> }
>
> We also need to check if emulate_raw() needs to be adjusted...
I looked at that very quickly, to be honest, but couldn't understand it
entirely. This code:
1087 if (keycode == KEY_SYSRQ && sysrq_alt) {
1088 put_queue(vc, 0x54 | up_flag);
1089 return 0;
1090 }
seems to be supposed to cancel the Alt "press" by sending a Alt
"release" to handle the sequence press alt -> press sysrq without
affecting the application. However, this is just a guess. I couldn't
find out what that magic 0x54 meant or why this would be enough wether
we pressed the left or the right alt...
Then there are other things that I don't understand there: I don't see
any code to filter out the keys we press ('T','P', etc.) while using
SysRq magic if we are in raw mode. emulate_raw will happily call
put_queue on them before we have a chance to bail out.
Maybe we should just stop calling emulate_raw while sysrq_active is
active. This way, after we press Alt + SysRq, every keypress would be
processed as a magic sysrq and not handled by any other code until we
release both keys.
Does this sound reasonable?
--
Paulo Marques - www.grupopie.com
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [patch] Re: Magic Alt-SysRq change in 2.6.18-rc1
2006-07-12 22:21 ` Paulo Marques
@ 2006-07-12 22:44 ` Pavel Machek
2006-07-13 18:48 ` Dmitry Torokhov
1 sibling, 0 replies; 30+ messages in thread
From: Pavel Machek @ 2006-07-12 22:44 UTC (permalink / raw)
To: Paulo Marques
Cc: Dmitry Torokhov, Roman Zippel, Andrew Morton, roubert, stern,
linux-input, linux-kernel
Hi!
> Maybe we should just stop calling emulate_raw while sysrq_active is
> active. This way, after we press Alt + SysRq, every keypress would be
> processed as a magic sysrq and not handled by any other code until we
> release both keys.
I guess so. Magic sysrq should be hidden from applications, even
applications using raw mode.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [patch] Re: Magic Alt-SysRq change in 2.6.18-rc1
2006-07-12 22:21 ` Paulo Marques
2006-07-12 22:44 ` Pavel Machek
@ 2006-07-13 18:48 ` Dmitry Torokhov
1 sibling, 0 replies; 30+ messages in thread
From: Dmitry Torokhov @ 2006-07-13 18:48 UTC (permalink / raw)
To: Paulo Marques
Cc: Roman Zippel, Andrew Morton, pavel, roubert, stern, linux-input,
linux-kernel
On 7/12/06, Paulo Marques <pmarques@grupopie.com> wrote:
> >
> > We also need to check if emulate_raw() needs to be adjusted...
>
> I looked at that very quickly, to be honest, but couldn't understand it
> entirely. This code:
>
> 1087 if (keycode == KEY_SYSRQ && sysrq_alt) {
> 1088 put_queue(vc, 0x54 | up_flag);
> 1089 return 0;
> 1090 }
>
> seems to be supposed to cancel the Alt "press" by sending a Alt
> "release" to handle the sequence press alt -> press sysrq without
> affecting the application. However, this is just a guess. I couldn't
> find out what that magic 0x54 meant or why this would be enough wether
> we pressed the left or the right alt...
>
Real AT keyboards (that's what we are trying to emulate here) send
0x54 scancode (and 0xB4 break code) if PrintScreen/SysRq key is
pressed while holding Alt (left or right). Otherwise it sends e0 2a e0
37. That's it.
> Then there are other things that I don't understand there: I don't see
> any code to filter out the keys we press ('T','P', etc.) while using
> SysRq magic if we are in raw mode. emulate_raw will happily call
> put_queue on them before we have a chance to bail out.
>
> Maybe we should just stop calling emulate_raw while sysrq_active is
> active. This way, after we press Alt + SysRq, every keypress would be
> processed as a magic sysrq and not handled by any other code until we
> release both keys.
We never supressed sysrq scancodes from reaching userspace if keyboard
is in raw mode (2.4 works the same). Plus you won't be able to supress
it for keyboards working in hadware raw mode (kbd_rawcode is called
even before we get to detecting SysRq state). Also users getting
keyboard events from alternative interfaces (such as evdev) won't be
affected anyway so I think we shoudl leave it as is.
--
Dmitry
^ permalink raw reply [flat|nested] 30+ messages in thread
end of thread, other threads:[~2006-07-13 18:48 UTC | newest]
Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
-- strict thread matches above, loose matches on Subject: below --
2006-07-10 0:01 Chuck Ebbert
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox