lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Wed, 25 Mar 2015 17:04:04 +0100
From:	Tomeu Vizoso <tomeu.vizoso@...labora.com>
To:	linux-kernel@...r.kernel.org
Cc:	Tomeu Vizoso <tomeu.vizoso@...labora.com>,
	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	Javier Martinez Canillas <javier.martinez@...labora.co.uk>,
	Lee Jones <lee.jones@...aro.org>,
	Doug Anderson <dianders@...omium.org>,
	Andrew Bresticker <abrestic@...omium.org>,
	Sjoerd Simons <sjoerd.simons@...labora.co.uk>,
	Bill Richardson <wfrichar@...omium.org>,
	Todd Broch <tbroch@...omium.org>, linux-input@...r.kernel.org
Subject: [PATCH] Input: cros_ec_keyb - Clear keyboard state only when it hasn't been a wake source

As the comment right before explains, the keyboard state is to be
cleared only if the EC wasn't a wakeup source in the last suspend.

Without this commit, there's an unneeded delay when resuming from
suspend and we also lose the key that was pressed while suspended.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@...labora.com>
---
 drivers/input/keyboard/cros_ec_keyb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c
index 769f8f7..14f35c4 100644
--- a/drivers/input/keyboard/cros_ec_keyb.c
+++ b/drivers/input/keyboard/cros_ec_keyb.c
@@ -327,7 +327,7 @@ static void cros_ec_keyb_clear_keyboard(struct cros_ec_keyb *ckdev)
 			break;
 	}
 	duration = jiffies - duration;
-	dev_info(ckdev->dev, "Discarded %d keyscan(s) in %dus\n", i,
+	printk("Discarded %d keyscan(s) in %dus\n", i,
 		jiffies_to_usecs(duration));
 }
 
@@ -341,7 +341,7 @@ static int cros_ec_keyb_resume(struct device *dev)
 	 * wake source (e.g. the lid is open and the user might press a key to
 	 * wake) then the key scan buffer should be preserved.
 	 */
-	if (ckdev->ec->was_wake_device)
+	if (!ckdev->ec->was_wake_device)
 		cros_ec_keyb_clear_keyboard(ckdev);
 
 	return 0;
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ