public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Synaptics Touchpad workaround for strange behavior after Sync loss (With Patch).
@ 2004-01-09 10:17 Gunter Königsmann
  2004-01-09 10:58 ` Vojtech Pavlik
  2004-01-10  8:44 ` Dmitry Torokhov
  0 siblings, 2 replies; 26+ messages in thread
From: Gunter Königsmann @ 2004-01-09 10:17 UTC (permalink / raw)
  To: rubini; +Cc: linux-kernel


Don't know if I'm supposed to the list or to the maintainer, mailing tho
both.

PROBLEM: My Touchpad generates rapid movements, random clicks and even
keypress events on the keyboard connected to the same BUS. Resetting the
Touchpad after bad syncs doesn't help.

Throwing away two packets after a bad sync loss fixed the whole problem.
One packet is not sufficient.

TODO:
        Don't know If I also should throw away packages we are supposed to
        pass through. Didn't touch this part of the driver.

        Perhaps we need a better resync algorithm anyway or --- even better
        --- find the reason of the sync losses.
        Meanwhile this patch shouldn't hurt anyone not suffering from
	sync losses on a regular base. This patch might discard a vital
	click but ---at least on my system--- prevents the system from
	generating them by itself.




PATCH:
diff -r -u linux-2.6.0/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
--- linux-2.6.0/drivers/input/mouse/synaptics.c	2003-11-24 02:31:44.000000000 +0100
+++ b/drivers/input/mouse/synaptics.c	2004-01-09 11:06:55.359149432 +0100
@@ -1,6 +1,9 @@
 /*
  * Synaptics TouchPad PS/2 mouse driver
  *
+ *   2003 Gunter K\"onigsmann <gunter.koenigsmann@gmx.de>
+ *     Experimental fix for strange behaviour after resync.
+ *
  *   2003 Dmitry Torokhov <dtor@mail.ru>
  *     Added support for pass-through port
  *
@@ -607,16 +610,23 @@
 	default:
 		if (psmouse->pktcnt < 6)
 			break;		    /* Wait for full packet */
-
+
 		if (priv->out_of_sync) {
 			priv->out_of_sync = 0;
 			printk(KERN_NOTICE "Synaptics driver resynced.\n");
 		}
-
+
 		if (priv->ptport && synaptics_is_pt_packet(psmouse->packet))
-			synaptics_pass_pt_packet(priv->ptport, psmouse->packet);
+		        synaptics_pass_pt_packet(priv->ptport, psmouse->packet);
 		else
-			synaptics_process_packet(psmouse);
+			if((priv->throwaway--)>0) /* When sync was
+			lost --- should we throw away packets we are
+		        supposed to pass through as well? If yes move
+		        this line three lines higher. */
+			{
+				priv->throwaway=0;
+				synaptics_process_packet(psmouse);
+			}

 		psmouse->pktcnt = 0;
 		break;
@@ -625,6 +635,9 @@

  bad_sync:
 	priv->out_of_sync++;
+	priv->throwaway=2;    /* Throw away the next 2 packets after a
+				 bad sync. Seems like at least one of
+				 them *will* be bad.*/
 	psmouse->pktcnt = 0;
 	if (psmouse_resetafter > 0 && priv->out_of_sync	== psmouse_resetafter) {
 		psmouse->state = PSMOUSE_IGNORE;
diff -r -u linux-2.6.0/drivers/input/mouse/synaptics.h b/drivers/input/mouse/synaptics.h
--- linux-2.6.0/drivers/input/mouse/synaptics.h	2003-11-24 02:31:54.000000000 +0100
+++ b/drivers/input/mouse/synaptics.h	2004-01-09 11:07:01.838164472 +0100
@@ -104,6 +104,10 @@

 	/* Data for normal processing */
 	unsigned int out_of_sync;		/* # of packets out of sync */
+	unsigned int throwaway;                 /* Packet was out of */
+						/* sync. Throw away */
+						/* N packets.*/
+
 	int old_w;				/* Previous w value */

 	struct serio *ptport;			/* pass-through port */

System:

Siemens-Amilo M Notebook

Linux labtop 2.6.0 #14 Fri Jan 9 09:45:26 CET 2004 i686 unknown unknown
GNU/Linux

Gnu C                  3.3
Gnu make               3.80
util-linux             2.11z
mount                  2.11z
module-init-tools      0.9.8
e2fsprogs              1.28
jfsutils               1.1.1
xfsprogs               2.3.9
pcmcia-cs              3.2.3
PPP                    2.4.1
isdn4k-utils           3.2p3
nfs-utils              1.0.1
Linux C Library        x    1 root     root      1491599 Mar 14  2003
/lib/libc.so.6
Dynamic linker (ldd)   2.3.2
Linux C++ Library      5.0.3
Procps                 3.1.6
Net-tools              1.60
Kbd                    1.06
Sh-utils               4.5.8
Modules Loaded         raw1394

Touchpad:
<6>i8042.c: Detected active multiplexing controller, rev 1.1.
<6>serio: i8042 AUX0 port at 0x60,0x64 irq 12
<6>serio: i8042 AUX1 port at 0x60,0x64 irq 12
<6>serio: i8042 AUX2 port at 0x60,0x64 irq 12
<6>Synaptics Touchpad, model: 1
<6> Firmware: 5.8
<6> 180 degree mounted touchpad
<6> Sensor: 18
<6> new absolute packet format
<6> Touchpad has extended capability bits
<6> -> 4 multi-buttons, i.e. besides standard buttons
<6> -> multifinger detection
<6> -> palm detection
<6>input: SynPS/2 Synaptics TouchPad on isa0060/serio4
<6>serio: i8042 AUX3 port at 0x60,0x64 irq 12
<6>input: AT Translated Set 2 keyboard on isa0060/serio0
<6>serio: i8042 KBD port at 0x60,0x64 irq 1
--
The parents of young organic lifeforms be warned: The swallowing of towels
in great quantities may be harmful.
        --Douglas Adams.


^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2004-01-19 22:26 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-09 10:17 Synaptics Touchpad workaround for strange behavior after Sync loss (With Patch) Gunter Königsmann
2004-01-09 10:58 ` Vojtech Pavlik
2004-01-10 22:50   ` Peter Berg Larsen
2004-01-11  2:39     ` Peter Berg Larsen
2004-01-11  3:33       ` Dmitry Torokhov
2004-01-11  8:37       ` Gunter Königsmann
2004-01-11 12:52         ` Peter Berg Larsen
2004-01-11 14:22           ` Vojtech Pavlik
2004-01-11 15:34             ` Dmitry Torokhov
2004-01-11 15:06           ` Gunter Königsmann
2004-01-11  8:10     ` Vojtech Pavlik
2004-01-11 12:46       ` Peter Berg Larsen
2004-01-11 14:21         ` Vojtech Pavlik
2004-01-19 22:25         ` Vojtech Pavlik
2004-01-10  8:44 ` Dmitry Torokhov
2004-01-10  8:45   ` [PATCH 1/2] Synaptics rate switching Dmitry Torokhov
2004-01-10  8:46     ` [PATCH 2/2] Psmouse log and discard timed out bytes Dmitry Torokhov
2004-01-10 13:05       ` Gunter Königsmann
2004-01-10 13:23       ` Gunter Königsmann
2004-01-11  4:57       ` [PATCH 3/2] Psmouse log and discard timed out bytes - addition Dmitry Torokhov
2004-01-11  8:11         ` Gunter Königsmann
2004-01-10  9:56     ` [PATCH 1/2] Synaptics rate switching Vojtech Pavlik
2004-01-10 22:05     ` Gunter Königsmann
2004-01-10 23:37       ` Vojtech Pavlik
2004-01-11  2:20       ` Dmitry Torokhov
2004-01-11  8:00         ` Gunter Königsmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox