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: <s5h35llxb25.wl-tiwai@suse.de>
Date:   Tue, 18 Jan 2022 17:28:50 +0100
From:   Takashi Iwai <tiwai@...e.de>
To:     linux-input@...r.kernel.org
Cc:     Dmitry Torokhov <dmitry.torokhov@...il.com>,
        linux-kernel@...r.kernel.org
Subject: [PATCH] Input: synaptics: retry query upon error

Some recent laptops such as Lenovo ThinkPad T14 AMD Gen 1 show the
errors at querying synaptics attributes.  This results in the driver
falling back to the legacy mode without multi-finger support.  It
happens only intermittently at some boots, and it seems that the same
query command seems working fine after retrying.

This patch implements a retry of synaptics_query_hardware() call after
some delay when it fails as a workaround.

BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1194086
Signed-off-by: Takashi Iwai <tiwai@...e.de>
---

It's rather an RFC, as I'm not sure whether it's the best way to fix
the problem.  At least, the retry of query seems working reliably, as
well as re-binding via sysfs.  And, I have no idea in which condition
this happens; it might be a flaky BIOS issue, of course :)

Above all, the device should have been connected via SMBUS.  But the
binding with SMBUS fails, so some other pieces are missing.  Maybe the
support with psmouse is suboptimal in anyway, but it's currently the
only way to make it working.

Any suggestions are appreciated.


thanks,

Takashi


 drivers/input/mouse/synaptics.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index ffad142801b3..0f23fba4c36e 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -416,7 +416,7 @@ static int synaptics_resolution(struct psmouse *psmouse,
 	return 0;
 }
 
-static int synaptics_query_hardware(struct psmouse *psmouse,
+static int __synaptics_query_hardware(struct psmouse *psmouse,
 				    struct synaptics_device_info *info)
 {
 	int error;
@@ -450,6 +450,21 @@ static int synaptics_query_hardware(struct psmouse *psmouse,
 	return 0;
 }
 
+static int synaptics_query_hardware(struct psmouse *psmouse,
+				    struct synaptics_device_info *info)
+{
+	int err;
+
+	err = __synaptics_query_hardware(psmouse, info);
+	if (err) {
+		psmouse_info(psmouse, "Query error (%d), retrying...\n", err);
+		msleep(100);
+		err = __synaptics_query_hardware(psmouse, info);
+	}
+
+	return err;
+}
+
 #endif /* CONFIG_MOUSE_PS2_SYNAPTICS || CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS */
 
 #ifdef CONFIG_MOUSE_PS2_SYNAPTICS
-- 
2.31.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ