From: Takashi Iwai <tiwai@suse.de>
To: linux-input@vger.kernel.org
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH] Input: synaptics: retry query upon error
Date: Tue, 18 Jan 2022 17:28:50 +0100 [thread overview]
Message-ID: <s5h35llxb25.wl-tiwai@suse.de> (raw)
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@suse.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
reply other threads:[~2022-01-18 16:28 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=s5h35llxb25.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®