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]
Message-Id: <20210811035025.44773-1-aaron.ma@canonical.com>
Date:   Wed, 11 Aug 2021 11:50:25 +0800
From:   Aaron Ma <aaron.ma@...onical.com>
To:     aaron.ma@...onical.com, dmitry.torokhov@...il.com,
        linux-input@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] Input: psmouse - disable non-wakeup armed PS/2 mouse when s2dile

After commit 684bec1092b6 ("Input: i8042 - enable keyboard wakeups by
default when s2idle is used"), kdb is enabled to wakeup laptops.
Kbd fails to wakeup when touchpad/trackpoint is used on ThinkPad.
The touchpad is not set to wakeup, and it shares buffer with kbd.
Send disable command to PS/2 mouse when s2idle, make it clean for
kdb to wakeup.
Enable PS/2 mouse when wakeup enabled.

Signed-off-by: Aaron Ma <aaron.ma@...onical.com>
---
 drivers/input/mouse/psmouse-base.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
index 0b4a3039f312..85dc9810d6ec 100644
--- a/drivers/input/mouse/psmouse-base.c
+++ b/drivers/input/mouse/psmouse-base.c
@@ -21,6 +21,7 @@
 #include <linux/libps2.h>
 #include <linux/mutex.h>
 #include <linux/types.h>
+#include <linux/suspend.h>
 
 #include "psmouse.h"
 #include "synaptics.h"
@@ -1457,11 +1458,13 @@ static void psmouse_cleanup(struct serio *serio)
 	 */
 	ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_RESET_DIS);
 
-	/*
-	 * Some boxes, such as HP nx7400, get terribly confused if mouse
-	 * is not fully enabled before suspending/shutting down.
-	 */
-	ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_ENABLE);
+	if (!pm_suspend_default_s2idle() || device_may_wakeup(&serio->dev)) {
+		/*
+		 * Some boxes, such as HP nx7400, get terribly confused if mouse
+		 * is not fully enabled before suspending/shutting down.
+		 */
+		ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_ENABLE);
+	}
 
 	if (parent) {
 		if (parent->pt_deactivate)
-- 
2.30.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ