Re: [patch] Re: Magic Alt-SysRq change in 2.6.18-rc1

Dmitry Torokhov
2006-07-12T20:05:45Z

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