All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Peter M. Petrakis" <peter.petrakis@canonical.com>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] Reset ps/2 port should psmouse_probe fail before retrying
Date: Wed, 14 Apr 2010 16:46:29 -0400	[thread overview]
Message-ID: <4BC629A5.4040500@canonical.com> (raw)

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

Filed a bug on this too:

https://bugzilla.kernel.org/show_bug.cgi?id=15780

This particular laptop will lose it's synaptics touch
pad on return from suspend state. Reloading the psmouse
module makes no difference. I came up with the attached
work around which simply calls psmouse_reset on the
port should the initial probe fail. This solves the problem
for me and I've tested this on several laptops.

Initially discovered on Ubuntu 2.6.31 (karmic) and the problem
continues to exist in lucid 2.6.32. I've filed a bug against
ubuntu kernel here:

https://bugs.launchpad.net/oem-priority/+bug/551234

though the Ubuntu kernel team would really like to get upstream's
input on the matter before accepting the patch. Please
let me know what you think. Thanks.

Peter



[-- Attachment #2: psmouse_reset.patch --]
[-- Type: text/x-diff, Size: 1181 bytes --]

diff --git a/psmouse-base.c b/psmouse-base.c
index b407b35..d79eafc 100644
--- a/psmouse-base.c
+++ b/psmouse-base.c
@@ -856,12 +856,12 @@ static const struct psmouse_protocol *psmouse_protocol_by_name(const char *name,
 	return NULL;
 }
 
-
 /*
- * psmouse_probe() probes for a PS/2 mouse.
+ * __psmouse_probe() probes for a PS/2 mouse.
+ * Wrapped by psmouse_probe() for clean reset code.
  */
 
-static int psmouse_probe(struct psmouse *psmouse)
+static int __psmouse_probe(struct psmouse *psmouse)
 {
 	struct ps2dev *ps2dev = &psmouse->ps2dev;
 	unsigned char param[2];
@@ -892,6 +892,23 @@ static int psmouse_probe(struct psmouse *psmouse)
 }
 
 /*
+ * Wrapper for probe routine to cleanly reset the device should
+ * the initial probe fail for any reason.
+ */
+static int psmouse_probe(struct psmouse *psmouse) {
+	struct ps2dev *ps2dev = &psmouse->ps2dev;
+	int i, ret = -1;
+
+	for (i=0; ((ret = __psmouse_probe(psmouse)) != 0) && i < 3; i++) {
+		printk(KERN_ERR "psmouse.c: Error encountered while probing"
+			" PS/2 device on %s, reseting.\n", ps2dev->serio->phys);
+		psmouse_reset(psmouse);
+	}
+
+	return ret;
+}
+
+/*
  * Here we set the mouse resolution.
  */
 

             reply	other threads:[~2010-04-14 20:46 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-14 20:46 Peter M. Petrakis [this message]
2010-04-14 21:04 ` [PATCH] Reset ps/2 port should psmouse_probe fail before retrying Randy Dunlap
  -- strict thread matches above, loose matches on Subject: below --
2010-04-16 22:52 Peter M. Petrakis
2010-04-17 11:01 ` Christoph Fritz
2010-04-17 15:31   ` Peter M. Petrakis
2010-04-17 16:53     ` Christoph Fritz
2010-04-19 15:33       ` Peter M. Petrakis
2010-04-20  0:37         ` Christoph Fritz
2010-04-20 21:08           ` Peter M. Petrakis
2010-04-21  6:33             ` Dmitry Torokhov
2010-04-21 16:05               ` Peter M. Petrakis
2010-04-21 17:10                 ` Dmitry Torokhov
2010-04-21 19:38                   ` Peter M. Petrakis
2010-04-21 19:52                     ` Dmitry Torokhov
2010-04-21 21:10                       ` Peter M. Petrakis
2010-04-22 16:28                         ` Christoph Fritz
2010-04-22 21:48                           ` Peter M. Petrakis
2010-04-22 21:55                             ` Dmitry Torokhov
2010-04-23  0:47                               ` Christoph Fritz
2010-04-23 16:53                                 ` Dmitry Torokhov
2010-04-23 18:46                                   ` Peter M. Petrakis
2010-04-28 17:07                                     ` Dmitry Torokhov
2010-04-28 20:17                                       ` Peter M. Petrakis
2010-04-29 16:57                                         ` Christoph Fritz
2010-04-29 17:46                                           ` Dmitry Torokhov
2010-04-30 22:37                                           ` Peter M. Petrakis
2010-05-02  3:07                                             ` Christoph Fritz
2010-05-02  7:41                                               ` Christoph Fritz
2010-05-07 17:57                                               ` Peter M. Petrakis
2010-05-08 16:01                                                 ` Christoph Fritz
2010-04-24  1:22                                   ` Christoph Fritz
2010-04-24 10:00                                     ` Christoph Fritz
2010-04-28  7:26                                       ` Dmitry Torokhov
2010-05-08 16:22                                         ` Christoph Fritz
2010-05-11  8:22                                           ` Dmitry Torokhov
2010-05-11 22:24                                             ` Christoph Fritz

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=4BC629A5.4040500@canonical.com \
    --to=peter.petrakis@canonical.com \
    --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.