mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Dmitry Torokhov" <dmitry.torokhov@gmail.com>
To: "Paulo Marques" <pmarques@grupopie.com>
Cc: "Roman Zippel" <zippel@linux-m68k.org>,
	"Andrew Morton" <akpm@osdl.org>,
	pavel@ucw.cz, roubert@df.lth.se, stern@rowland.harvard.edu,
	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: Thu, 13 Jul 2006 14:48:13 -0400	[thread overview]
Message-ID: <d120d5000607131148y3c80abadhb49cc22db0593d6e@mail.gmail.com> (raw)
In-Reply-To: <44B575EF.1080409@grupopie.com>

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

  parent reply	other threads:[~2006-07-13 18:48 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 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 [this message]
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=d120d5000607131148y3c80abadhb49cc22db0593d6e@mail.gmail.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=akpm@osdl.org \
    --cc=linux-input@atrey.karlin.mff.cuni.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=pmarques@grupopie.com \
    --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

all inboxes | Powered by JetHome®