linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: Jiri Kosina <jkosina@suse.cz>,
	rjw@sisk.pl, linux-input@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [regression] 2.6.30 leaking keys on console switch
Date: Wed, 14 Oct 2009 00:50:24 -0700	[thread overview]
Message-ID: <20091014075024.GC5318@core.coreip.homeip.net> (raw)
In-Reply-To: <20091014073927.GB5318@core.coreip.homeip.net>

On Wed, Oct 14, 2009 at 12:39:28AM -0700, Dmitry Torokhov wrote:
> On Wed, Oct 14, 2009 at 09:19:50AM +0200, Andi Kleen wrote:
> > > Btw, what kind of keyboard is this? I was playing today but I could not
> > > get my USB keyboards to report release of more than 1 key per report....
> > 
> > The log was with a PS/2<->USB adapter, with a PS/2 keyboard connected
> > to a USB port through it.
> > 
> 
> Hmm, I don't think I have one of those... It is curious beast - we have
> software autorepeat for HID but PS/2 keyboards do autorepeat
> themselves... What will combination do?
> 

Could you please try this incredibly stupid patch?

-- 
Dmitry


Input: autorepeat debug patch

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---

 drivers/input/input.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)


diff --git a/drivers/input/input.c b/drivers/input/input.c
index 6ba676b..77fa3da 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -137,7 +137,7 @@ static void input_repeat_key(unsigned long data)
 	if (test_bit(dev->repeat_key, dev->key) &&
 	    is_event_supported(dev->repeat_key, dev->keybit, KEY_MAX)) {
 
-		input_pass_event(dev, EV_KEY, dev->repeat_key, 2);
+		input_pass_event(dev, EV_KEY, dev->repeat_key, 200);
 
 		if (dev->sync) {
 			/*
@@ -208,7 +208,15 @@ static void input_handle_event(struct input_dev *dev,
 		if (is_event_supported(code, dev->keybit, KEY_MAX) &&
 		    !!test_bit(code, dev->key) != value) {
 
-			if (value != 2) {
+			if (value == 2 || value == 200) {
+				/* autorepeat */
+				if (!test_bit(code, dev->key)) {
+					printk(KERN_ERR "%s autorepeat for released key %d\n",
+						value == 200 ? "software" : "hardware", code);
+					break;
+				}
+				value = 2;
+			} else {
 				__change_bit(code, dev->key);
 				if (value)
 					input_start_autorepeat(dev, code);

  reply	other threads:[~2009-10-14  7:51 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-07  8:44 [regression] 2.6.30 leaking keys on console switch Andi Kleen
2009-07-07  8:50 ` Jiri Kosina
2009-07-07  9:12   ` Andi Kleen
2009-07-07  9:15     ` Jiri Kosina
2009-07-08  6:53   ` Dmitry Torokhov
2009-07-08 11:20     ` Jiri Kosina
2009-07-09 11:29       ` Jiri Kosina
2009-07-09 20:01         ` Andi Kleen
2009-10-14  4:58       ` Dmitry Torokhov
2009-10-14  7:19         ` Andi Kleen
2009-10-14  7:39           ` Dmitry Torokhov
2009-10-14  7:50             ` Dmitry Torokhov [this message]
2009-10-16  5:41             ` H. Peter Anvin
2009-10-19 21:38             ` Pavel Machek
2009-10-21  8:15               ` Dmitry Torokhov
2009-10-23 20:29                 ` Pavel Machek
2009-07-09 11:20     ` Jiri Kosina
2009-07-09 12:00       ` Andi Kleen
2009-07-09 20:03       ` Andi Kleen
2009-07-09 21:58         ` Jiri Kosina
2009-07-13  4:05       ` Dmitry Torokhov
2009-07-13  7:07         ` Jiri Kosina
2009-07-13  8:25           ` Andi Kleen
2009-07-16  9:02             ` Jiri Kosina
2009-07-16  9:24               ` Andi Kleen
2009-10-16  4:59                 ` 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=20091014075024.GC5318@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=andi@firstfloor.org \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@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).