* 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; 12+ 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] 12+ messages in thread
* Re: Magic Alt-SysRq change in 2.6.18-rc1
@ 2006-07-10 0:01 Chuck Ebbert
0 siblings, 0 replies; 12+ 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] 12+ messages in thread
* Re: Magic Alt-SysRq change in 2.6.18-rc1
2006-07-09 21:06 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; 12+ 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] 12+ messages in thread
* Re: Magic Alt-SysRq change in 2.6.18-rc1
2006-07-09 21:06 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; 12+ 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] 12+ 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; 12+ 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] 12+ messages in thread
* Re: Magic Alt-SysRq change in 2.6.18-rc1
2006-07-09 21:06 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; 12+ 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] 12+ 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; 12+ 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] 12+ 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; 12+ 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] 12+ 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; 12+ 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] 12+ 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; 12+ 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] 12+ 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; 12+ 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] 12+ 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
0 siblings, 0 replies; 12+ 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] 12+ messages in thread
end of thread, other threads:[~2006-07-11 22:21 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-10 0:01 Magic Alt-SysRq change in 2.6.18-rc1 Chuck Ebbert
-- strict thread matches above, loose matches on Subject: below --
2006-07-09 21:06 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 12:42 ` Pavel Machek
2006-07-11 13:54 ` Alan Stern
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox