linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: "Éric Piel" <E.A.B.Piel@tudelft.nl>
Cc: "linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
	"Rafael J. Wysocki" <rjw@sisk.pl>
Subject: Re: [Regression 2.6.35-rc1?] Sysrq works too well (no need of alt)
Date: Wed, 9 Jun 2010 01:30:14 -0700	[thread overview]
Message-ID: <20100609083014.GA13304@core.coreip.homeip.net> (raw)
In-Reply-To: <201006081737.43007.dmitry.torokhov@gmail.com>

On Tue, Jun 08, 2010 at 05:37:42PM -0700, Dmitry Torokhov wrote:
> On Tuesday, June 08, 2010 03:55:08 pm Éric Piel wrote:
> > Op 08-06-10 11:33, Éric Piel schreef:
> > > Hello,
> > > I haven't investigated much yet, but I have the feeling that since
> > > 2.6.35-rc1 my "Print Screen/SysRq" key works only as SysRq: if I press
> > > it (normally assigned to take screenshot in gnome), nothing happens (no
> > > input event received in userspace) and no key on the keyboard works
> > > afterwards, until I press Alt. Actually the keys work, but behave as if
> > > the sysrq key was kept pressed (can be seen in dmesg, or by pressing
> > > "b").
> > > 
> > > Looking at the log, a potential culprit is commit
> > > 97f5f0cd8cd0a05449cbb77d1e6f02e026875802 (Input: implement SysRq as a
> > > separate input handler). Probably the logic of "have to press all the
> > > keys at the same time" changed to "have to press the keys one after each
> > > other". So pressing alt and later on pressing PrintScreen leads to a
> > > SysRq.
> > > 
> > > Does anybody else see this behaviour? Any suggestion on how to solve
> > > this bug? I'll try reverting the commit and report if it fixes the
> > > problem (the git revert fails so I've got to fix the conflict manually).
> > 
> > I can confirm this regression is due to
> > 97f5f0cd8cd0a05449cbb77d1e6f02e026875802: the reverting patch below
> > fixes it. And, as long as you don't press alt since boot, PrintScreen
> > works fine. So it is likely due to not taking into account key releases.
> > 
> > Dmitry, do you have a better fix? I'll be happy to test it if needed.
> > 
> 
> Not yet, but I see the effects you are describing... Stay tuned...
> 

Eric, could you tell me if the following fixes the problem for you?

Thanks!

-- 
Dmitry

Input: sysrq - fix "stuck" SysRq mode

This shoud fix the problem with SysRq mode staying half-way enabled
and interfereing with normal PrtScrn operation after user presses ALT
for the first time.

Reported-by: Éric Piel <E.A.B.Piel@tudelft.nl>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---

 drivers/char/sysrq.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)


diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c
index c046075..5bf3618 100644
--- a/drivers/char/sysrq.c
+++ b/drivers/char/sysrq.c
@@ -579,8 +579,12 @@ static bool sysrq_filter(struct input_handle *handle, unsigned int type,
 	case KEY_RIGHTALT:
 		if (value)
 			sysrq_alt = code;
-		else if (sysrq_down && code == sysrq_alt_use)
-			sysrq_down = false;
+		else {
+			if (sysrq_down && code == sysrq_alt_use)
+				sysrq_down = false;
+
+			sysrq_alt = 0;
+		}
 		break;
 
 	case KEY_SYSRQ:
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2010-06-09  8:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-08  9:33 [Regression 2.6.35-rc1?] Sysrq works too well (no need of alt) Éric Piel
2010-06-08 22:55 ` Éric Piel
2010-06-09  0:37   ` Dmitry Torokhov
2010-06-09  8:30     ` Dmitry Torokhov [this message]
2010-06-09 11:32       ` Éric Piel
2010-06-19 21:16 ` Rafael J. Wysocki
2010-06-19 23:15   ` Éric Piel
2010-06-29  7:07     ` Dmitry Torokhov

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=20100609083014.GA13304@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=E.A.B.Piel@tudelft.nl \
    --cc=linux-input@vger.kernel.org \
    --cc=rjw@sisk.pl \
    /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;
as well as URLs for NNTP newsgroup(s).