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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 11 Nov 2009 01:52:19 -0800
From:	Dmitry Torokhov <dmitry.torokhov@...il.com>
To:	Mikko Vinni <mmvinni@...oo.com>
Cc:	linux-input@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: keyboard leds not restored after s2ram in
	2.6.32-rc6-00166-g799dd75

Hi Mikko,

On Tue, Nov 10, 2009 at 09:27:40AM -0800, Mikko Vinni wrote:
> Hi,
> 
> my laptop shows the caps lock and scroll lock leds as being on after s2ram
> (and resume), even though they are off. If I press the caps lock key, the caps
> lock led stays on, the num lock led turns off, and the screen unlock screen
> warns about the caps lock being on.
> 

Thank you for the report. Could youplease tell me if the patch below
fixes the problem?

Thanks!

-- 
Dmitry


Input: force LED reset on resume

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

We should be sending EV_LED event down to drivers upon resume even in cases
when in-kernel state of the LED is off since device could come up with some
leds turned on.

Reported-by: Mikko Vinni <mmvinni@...oo.com>
Signed-off-by: Dmitry Torokhov <dtor@...l.ru>
---

 drivers/input/input.c |   29 ++++++++++++++++++-----------
 1 files changed, 18 insertions(+), 11 deletions(-)


diff --git a/drivers/input/input.c b/drivers/input/input.c
index 61069b2..77b6efe 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -1298,17 +1298,24 @@ static int input_dev_uevent(struct device *device, struct kobj_uevent_env *env)
 	return 0;
 }
 
-#define INPUT_DO_TOGGLE(dev, type, bits, on)			\
-	do {							\
-		int i;						\
-		if (!test_bit(EV_##type, dev->evbit))		\
-			break;					\
-		for (i = 0; i < type##_MAX; i++) {		\
-			if (!test_bit(i, dev->bits##bit) ||	\
-			    !test_bit(i, dev->bits))		\
-				continue;			\
-			dev->event(dev, EV_##type, i, on);	\
-		}						\
+#define INPUT_DO_TOGGLE(dev, type, bits, on)				\
+	do {								\
+		int i;							\
+		bool active;						\
+									\
+		if (!test_bit(EV_##type, dev->evbit))			\
+			break;						\
+									\
+		for (i = 0; i < type##_MAX; i++) {			\
+			if (!test_bit(i, dev->bits##bit))		\
+				continue;				\
+									\
+			active = test_bit(i, dev->bits);		\
+			if (!active && !on)				\
+				continue;				\
+									\
+			dev->event(dev, EV_##type, i, on ? active : 0);	\
+		}							\
 	} while (0)
 
 #ifdef CONFIG_PM
--
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