Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Jul 2000 12:14:25 +0900
From:      Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
To:        "Jordan K. Hubbard" <jkh@zippy.osd.bsdi.com>
Cc:        stable@freebsd.org, yokota@zodiac.mech.utsunomiya-u.ac.jp
Subject:   Re: psmintr: out of sync (0080 != 0000). ARGH! 
Message-ID:  <200007220314.MAA20629@zodiac.mech.utsunomiya-u.ac.jp>
In-Reply-To: Your message of "Fri, 21 Jul 2000 15:50:24 MST." <6390.964219824@localhost> 
References:  <6390.964219824@localhost> 

next in thread | previous in thread | raw e-mail | index | archive | help

>At first I was laboring under the assumption that this was an
>SMP-related problem and, while intensely irritating on my box "zippy",
>I figured it would at least only bite a small number of people and
>only in -current.
>
>Now I've switched over to a single-CPU box running RELENG_4 and this
>problem is, indeed, very much there.  It's a really _bad_ problem 
>given that the mouse goes absolutely nuts during these intervals
>and you *will* have bogus contents selected and pasted into your
>xterms at random intervals.  Depending on what was cut and pasted,
>the results could be pretty nasty.

Have you tried the patch below which I posted to -stable and -current
mailing lists back in June?

Kazu

Index: psm.c
===================================================================
RCS file: /src/CVS/src/sys/isa/psm.c,v
retrieving revision 1.26
diff -u -r1.26 psm.c
--- psm.c	2000/04/19 14:57:50	1.26
+++ psm.c	2000/06/09 01:19:59
@@ -1830,10 +1830,11 @@
 
     unit = (int)arg;
     sc = devclass_get_softc(psm_devclass, unit);
-    if (sc->watchdog) {
+    if (sc->watchdog && kbdc_lock(sc->kbdc, TRUE)) {
 	if (verbose >= 4)
 	    log(LOG_DEBUG, "psm%d: lost interrupt?\n", unit);
 	psmintr(sc);
+	kbdc_lock(sc->kbdc, FALSE);
     }
     sc->watchdog = TRUE;
     sc->callout = timeout(psmtimeout, (void *)unit, hz);
@@ -1880,18 +1881,6 @@
         if ((sc->state & PSM_OPEN) == 0)
             continue;
     
-        /* 
-	 * Check sync bits. We check for overflow bits and the bit 3
-	 * for most mice. True, the code doesn't work if overflow 
-	 * condition occurs. But we expect it rarely happens...
-	 */
-	if ((sc->inputbytes == 0) 
-		&& ((c & sc->mode.syncmask[0]) != sc->mode.syncmask[1])) {
-            log(LOG_DEBUG, "psmintr: out of sync (%04x != %04x).\n", 
-		c & sc->mode.syncmask[0], sc->mode.syncmask[1]);
-            continue;
-	}
-
         sc->ipacket[sc->inputbytes++] = c;
         if (sc->inputbytes < sc->mode.packetsize) 
 	    continue;
@@ -1904,6 +1893,13 @@
 
 	c = sc->ipacket[0];
 
+	if ((c & sc->mode.syncmask[0]) != sc->mode.syncmask[1]) {
+            log(LOG_DEBUG, "psmintr: out of sync (%04x != %04x).\n", 
+		c & sc->mode.syncmask[0], sc->mode.syncmask[1]);
+	    sc->inputbytes = 0;
+            continue;
+	}
+
 	/* 
 	 * A kludge for Kensington device! 
 	 * The MSB of the horizontal count appears to be stored in 



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200007220314.MAA20629>