All of lore.kernel.org
 help / color / mirror / Atom feed
From: James M Leddy <james.leddy@canonical.com>
To: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org
Subject: [PATCH 1/1][RESUBMIT] input: fix weird issue of synaptics psmouse sync lost after resume
Date: Tue, 09 Apr 2013 21:18:33 -0400	[thread overview]
Message-ID: <5164BDE9.3010706@canonical.com> (raw)
In-Reply-To: <1365553843-11951-1-git-send-email-james.leddy@canonical.com>

[-- Attachment #1: Type: text/plain, Size: 1976 bytes --]

From: Eric Miao <eric.miao@canonical.com>

In summary, the symptom is intermittent key events lost after resume
on some machines with synaptics touchpad (seems this is synaptics _only_),
and key events loss is due to serio port reconnect after psmouse sync lost.
Removing psmouse and inserting it back during the suspend/resume process
is able to work around the issue, so the difference between
psmouse_connect()
and psmouse_reconnect() is the key to the root cause of this problem.

After comparing the two different paths, synaptics driver has its own
implementation of synaptics_reconnect(), and the missing psmouse_probe()
seems significant, the patch below added psmouse_probe() to the reconnect
process, and has been verified many times that the issue could not be
reliably
reproduced.

There are two PS/2 commands in psmouse_probe():

  1. PSMOUSE_CMD_GETID
  2. PSMOUSE_CMD_RESET_DIS

Only the PSMOUSE_CMD_GETID seems to be significant. The
PSMOUSE_CMD_RESET_DIS is irrelevant to this issue after trying
several times.  So we have only implemented this patch to issue
the PSMOUSE_CMD_GETID so far.

Tested-by: Daniel Manrique <daniel.manrique@canonical.com>
Signed-off-by: James M Leddy <james.leddy@canonical.com>
---
 drivers/input/mouse/synaptics.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/input/mouse/synaptics.c
b/drivers/input/mouse/synaptics.c
index 12d12ca..3438a9d 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -1355,6 +1355,7 @@ static int synaptics_reconnect(struct psmouse
*psmouse)
 {
 	struct synaptics_data *priv = psmouse->private;
 	struct synaptics_data old_priv = *priv;
+	unsigned char param[2];
 	int retry = 0;
 	int error;
 @@ -1370,6 +1371,7 @@ static int synaptics_reconnect(struct psmouse
*psmouse)
 			 */
 			ssleep(1);
 		}
+		ps2_command(&psmouse->ps2dev, param, PSMOUSE_CMD_GETID);
 		error = synaptics_detect(psmouse, 0);
 	} while (error && ++retry < 3);
 -- 1.7.9.5




[-- Attachment #2: Attached Message Part --]
[-- Type: text/plain, Size: 0 bytes --]



      parent reply	other threads:[~2013-04-10  1:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-10  0:30 [PATCH 0/1][RESUBMIT] input: fix weird issue of synaptics psmouse sync lost James M Leddy
2013-04-10  0:30 ` [PATCH 1/1][RESUBMIT] input: fix weird issue of synaptics psmouse sync lost after resume James M Leddy
2013-04-10  1:14 ` [PATCH 0/1][RESUBMIT] input: fix weird issue of synaptics psmouse sync lost James M Leddy
2013-04-10  1:18 ` James M Leddy [this message]

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=5164BDE9.3010706@canonical.com \
    --to=james.leddy@canonical.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.