diff mbox

Reset ps/2 port should psmouse_probe fail before retrying

Message ID 1271953731.4566.27.camel@lovely (mailing list archive)
State New, archived
Headers show

Commit Message

Christoph Fritz April 22, 2010, 4:28 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
index d8c0c8d..6877371 100644
--- a/drivers/input/mouse/psmouse-base.c
+++ b/drivers/input/mouse/psmouse-base.c
@@ -1383,6 +1383,7 @@  static int psmouse_reconnect(struct serio *serio)
 	struct psmouse *parent = NULL;
 	struct serio_driver *drv = serio->drv;
 	int rc = -1;
+	int retries = 0;
 
 	if (!drv || !psmouse) {
 		printk(KERN_DEBUG "psmouse: reconnect request, but serio is disconnected, ignoring...\n");
@@ -1401,10 +1402,14 @@  static int psmouse_reconnect(struct serio *serio)
 	if (psmouse->reconnect) {
 		if (psmouse->reconnect(psmouse))
 			goto out;
-	} else if (psmouse_probe(psmouse) < 0 ||
+	} else {
+		while ((retries++ < 3) && psmouse_reset(psmouse))
+			/* empty */;
+		if (psmouse_probe(psmouse) < 0 ||
 		   psmouse->type != psmouse_extensions(psmouse,
 						psmouse_max_proto, false)) {
-		goto out;
+			goto out;
+		}
 	}
 
 	/* ok, the device type (and capabilities) match the old one,