FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Kernel Team

 
 
LinkBack Thread Tools
 
Old 03-26-2010, 08:23 PM
Peter M. Petrakis
 
Default Perform a reset should psmouse_probe fail for any reason. This is necessary for some PS/2 devices who can't even be identified when returning from sleep (S3).

---
psmouse-base.c | 28 +++++++++++++++++++++++++---
1 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/psmouse-base.c b/psmouse-base.c
index b407b35..3b8e63c 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,28 @@ 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 tries = 3;
+ int ret = -1;
+
+retry:
+ if (tries > 0 && ((ret = __psmouse_probe(psmouse)) != 0)) {
+ printk(KERN_ERR "psmouse.c: Error encountered while probing PS/2 device on %s "
+ "reseting...
", ps2dev->serio->phys);
+ psmouse_reset(psmouse);
+ msleep(500);
+ tries--;
+ goto retry;
+ }
+
+ return ret;
+}
+
+/*
* Here we set the mouse resolution.
*/

--
1.6.3.3


--------------000703040809060808000409
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team

--------------000703040809060808000409--
 

Thread Tools




All times are GMT. The time now is 10:12 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org