From patchwork Wed Oct 14 07:50:24 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 53617 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9E7rwVg015639 for ; Wed, 14 Oct 2009 07:53:58 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757153AbZJNHvH (ORCPT ); Wed, 14 Oct 2009 03:51:07 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756693AbZJNHvH (ORCPT ); Wed, 14 Oct 2009 03:51:07 -0400 Received: from mail-px0-f180.google.com ([209.85.216.180]:40181 "EHLO mail-px0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756209AbZJNHvG (ORCPT ); Wed, 14 Oct 2009 03:51:06 -0400 Received: by pxi10 with SMTP id 10so4731pxi.4 for ; Wed, 14 Oct 2009 00:50:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=AcYL1RklCDTZ41U3DobMkwoFBp8m+qO4TfG6XKCQ1lA=; b=jBJegpTrg3M38cD9dcrtWDYtYp3PzqpEm8Q12aIR6yjiWQxQJryzmvdFcO0sj8HSBx YHegNacJUDcf6kX1VqYf0VjzBX75igUlJTNWyig28fX8csYMQrIuHIJWcgZGEtTuSZxM SpV1AFIcltBPjRr74a1vbWifrbziXAf1oLmu4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=qQfxgGCGRjnWiL/oQEuaNgkAPWmwpQDyNO6iqiVQNCL6ccgiAkAZhy6AfDhgrlhjMM TM/Nh1NH6gMwodiElJAth/ux0/14reQkqpB4Wft+2a1PaKAYlNN3obB8qAjmfl2W2oj2 qreB+zPSTrjmgQPvfZyNs+PhchMuVe+pMFsdM= Received: by 10.114.68.14 with SMTP id q14mr1325676waa.103.1255506628901; Wed, 14 Oct 2009 00:50:28 -0700 (PDT) Received: from mailhub.coreip.homeip.net (c-24-6-153-137.hsd1.ca.comcast.net [24.6.153.137]) by mx.google.com with ESMTPS id 22sm315743pzk.2.2009.10.14.00.50.27 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 14 Oct 2009 00:50:27 -0700 (PDT) Date: Wed, 14 Oct 2009 00:50:24 -0700 From: Dmitry Torokhov To: Andi Kleen Cc: Jiri Kosina , rjw@sisk.pl, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [regression] 2.6.30 leaking keys on console switch Message-ID: <20091014075024.GC5318@core.coreip.homeip.net> References: <87eiss7uhb.fsf@basil.nowhere.org> <20090708065325.GE3309@dtor-d630.eng.vmware.com> <20091014045851.GA32413@core.coreip.homeip.net> <20091014071950.GF23248@one.firstfloor.org> <20091014073927.GB5318@core.coreip.homeip.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20091014073927.GB5318@core.coreip.homeip.net> User-Agent: Mutt/1.5.19 (2009-01-05) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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);