From patchwork Mon Sep 6 21:26:09 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Levitsky X-Patchwork-Id: 4263 Return-path: Envelope-to: mchehab@gaivota Delivery-date: Mon, 06 Sep 2010 19:28:49 -0300 Received: from mchehab by gaivota with local (Exim 4.72) (envelope-from ) id 1OskBE-0000tB-Ld for mchehab@gaivota; Mon, 06 Sep 2010 19:28:48 -0300 Received: from bombadil.infradead.org [18.85.46.34] by gaivota with IMAP (fetchmail-6.3.17) for (single-drop); Mon, 06 Sep 2010 19:28:48 -0300 (BRT) Received: from vger.kernel.org ([209.132.180.67]) by bombadil.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1OsjD0-0005rt-Mh; Mon, 06 Sep 2010 21:26:34 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755689Ab0IFV0d (ORCPT + 1 other); Mon, 6 Sep 2010 17:26:33 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:57693 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755680Ab0IFV0c (ORCPT ); Mon, 6 Sep 2010 17:26:32 -0400 Received: by mail-fx0-f46.google.com with SMTP id 13so2662937fxm.19 for ; Mon, 06 Sep 2010 14:26:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=wyyzUlPNPUFk2q6/42WIAVqD85Un9iI61yEYh0WmgEs=; b=skHvRFuIkbtIzUkUzp72H6dg4dBBV/Rvi3WBctG/yn4tv7qnVr9/PrT/svByl7HRsY E6kGVJeOg/j74g5KggzckZud7HJ51lxWkmBH0MUl7+VEnCjYgLnhJtm4DbTtyvd2wnUN lAHP4VwYRmXfH8s0NtHrYyPkS2GeGM5klX3d0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=ckjLyseI7lTARNS0DvRHSJ//9mak6qeOhLMTk48iNk7Q5hKlusW3G/rxcW2vkGVpaB lIV24/IOs8q4wMsqElmZUYjZQ96n82JDwhwmX8Ea2tSIHgVwbIj0HR85gW9oTOuaMdPR WERxYVduDqbg5/BV/RdbcED6D/5ihhgZd///E= Received: by 10.223.110.132 with SMTP id n4mr1080284fap.106.1283808389904; Mon, 06 Sep 2010 14:26:29 -0700 (PDT) Received: from localhost.localdomain (IGLD-84-228-233-189.inter.net.il [84.228.233.189]) by mx.google.com with ESMTPS id k15sm2504881fai.16.2010.09.06.14.26.27 (version=SSLv3 cipher=RC4-MD5); Mon, 06 Sep 2010 14:26:28 -0700 (PDT) From: Maxim Levitsky To: lirc-list@lists.sourceforge.net Cc: Jarod Wilson , =?UTF-8?q?David=20H=C3=A4rdeman?= , mchehab@infradead.org, linux-input@vger.kernel.org, linux-media@vger.kernel.org, Maxim Levitsky Subject: [PATCH 4/8] IR: fix keys beeing stuck down forever. Date: Tue, 7 Sep 2010 00:26:09 +0300 Message-Id: <1283808373-27876-5-git-send-email-maximlevitsky@gmail.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1283808373-27876-1-git-send-email-maximlevitsky@gmail.com> References: <1283808373-27876-1-git-send-email-maximlevitsky@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Sender: Mauro Carvalho Chehab The logic in ir_timer_keyup was inverted. In case that values aren't equal, the meaning of the time_is_after_eq_jiffies(ir->keyup_jiffies) is that ir->keyup_jiffies is after the the jiffies or equally that that jiffies are before the the ir->keyup_jiffies which is exactly the situation we want to avoid (that the timeout is in the future) Confusing Eh? Signed-off-by: Maxim Levitsky Acked-by: Jarod Wilson --- drivers/media/IR/ir-keytable.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/media/IR/ir-keytable.c b/drivers/media/IR/ir-keytable.c index 0917535..a8fd777 100644 --- a/drivers/media/IR/ir-keytable.c +++ b/drivers/media/IR/ir-keytable.c @@ -319,7 +319,7 @@ static void ir_timer_keyup(unsigned long cookie) * a keyup event might follow immediately after the keydown. */ spin_lock_irqsave(&ir->keylock, flags); - if (time_is_after_eq_jiffies(ir->keyup_jiffies)) + if (time_is_before_eq_jiffies(ir->keyup_jiffies)) ir_keyup(ir); spin_unlock_irqrestore(&ir->keylock, flags); }