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: <1335173400-15719-1-git-send-email-jj_ding@emc.com.tw>
Date:	Mon, 23 Apr 2012 17:30:00 +0800
From:	JJ Ding <jj_ding@....com.tw>
To:	ubase133@...il.com
Cc:	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
	JJ Ding <jj_ding@....com.tw>
Subject: [PATCH] Input: elantech - make synaptics_send_cmd() retry for 3 times

synaptics_send_cmd() doesn't seem to be very reliable with Elan touchapds,
so people could see infrequent failures when it is called in elantech_detect(),
resulting touchpads fail to be recognized as Elan.

Teach synaptics_send_cmd() to retry for 3 times to make sure we are properly
detected.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=43136
Reported-by: ubase133@...il.com
Signed-off-by: JJ Ding <jj_ding@....com.tw>
---
Hi ubase133,

Dmitry forwarded your bugzilla report to me.

I used to see rare cases when this also happened on my test machine, but we
don't really know why. Does this always happen on your machine?

Anyway, could you please try this patch out? This is really the only fix I can
think of. If it doesn't work for you, then I will have to dig deeper.

P.S. Patch is against 3.4-rc4.

Thanks,
JJ

 drivers/input/mouse/elantech.c |   19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index 4790110..6b8df09 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -30,7 +30,7 @@
 /*
  * Send a Synaptics style sliced query command
  */
-static int synaptics_send_cmd(struct psmouse *psmouse, unsigned char c,
+static int __synaptics_send_cmd(struct psmouse *psmouse, unsigned char c,
 				unsigned char *param)
 {
 	if (psmouse_sliced_command(psmouse, c) ||
@@ -42,6 +42,23 @@ static int synaptics_send_cmd(struct psmouse *psmouse, unsigned char c,
 	return 0;
 }
 
+static int synaptics_send_cmd(struct psmouse *psmouse, unsigned char c,
+				unsigned char *param)
+{
+	int rc;
+	int tries = ETP_PS2_COMMAND_TRIES;
+
+	do {
+		rc = __synaptics_send_cmd(psmouse, c, param);
+		if (rc == 0)
+			break;
+		tries--;
+		msleep(ETP_PS2_COMMAND_DELAY);
+	} while (tries > 0);
+
+	return rc;
+}
+
 /*
  * V3 and later support this fast command
  */
-- 
1.7.10

--
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