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@xxxxxxxxx Signed-off-by: JJ Ding <jj_ding@xxxxxxxxxx> --- 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-input" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html