Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 09 Jan 2001 11:11:35 +0900
From:      Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
To:        Greg Black <gjb@gbch.net>
Cc:        hackers@freebsd.org, yokota@zodiac.mech.utsunomiya-u.ac.jp
Subject:   Re: psmintr: out of sync 
Message-ID:  <200101090211.LAA02768@zodiac.mech.utsunomiya-u.ac.jp>
In-Reply-To: Your message of "Sun, 07 Jan 2001 10:52:21 %2B1000." <nospam-3a57bdc52710f07@maxim.gbch.net> 
References:  <nospam-3a57bdc52710f07@maxim.gbch.net> 

next in thread | previous in thread | raw e-mail | index | archive | help
There is a workaround, if not a fix, for this problem in -CURRENT.

Apply the following patch to /sys/isa/psm.c and add flags 0x8000
to psm driver in your kernel config file as follows.

device          psm0    at atkbdc? irq 12 flags 0x8000

Kazu

>I have an intermittent (and fairly rare) problem with various
>PS/2 mice on a set of boxes running 4.1-R (but the problem was
>also evident under 3.{1,2,3,4}-R).  The boxes all run X and, on
>occasion, the mouse will stop working and hundreds of "psmintr:
>out of sync" messages will be logged.
>
>It happens maybe once in 6 weeks on one of seven machines, so is
>not easy to diagnose.
>
>I can fix it by logging in with ssh (or switching to one of the
>virtual consoles if the box is handy), killing and re-starting
>moused.
>
>This is not a very useful solution for distant clients who are
>not competent to do stuff like that and tend to resort to the
>power switch if I'm not available instantly -- and that leads to
>undesirable collateral damage.
>
>I'm keen to hear practical suggestions for a fix, or even better
>that a bug has been found and fixed.

Index: psm.c
===================================================================
RCS file: /src/CVS/src/sys/isa/psm.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- psm.c	2000/12/01 05:24:30	1.33
+++ psm.c	2000/12/01 05:26:24	1.34
@@ -20,7 +20,7 @@
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/isa/psm.c,v 1.33 2000/12/01 05:24:30 yokota Exp $
+ * $FreeBSD: src/sys/isa/psm.c,v 1.34 2000/12/01 05:26:24 yokota Exp $
  */
 
 /*
@@ -176,10 +176,12 @@
 #define PSM_CONFIG_IGNPORTERROR	0x1000  /* ignore error in aux port test */
 #define PSM_CONFIG_HOOKRESUME	0x2000	/* hook the system resume event */
 #define PSM_CONFIG_INITAFTERSUSPEND 0x4000 /* init the device at the resume event */
+#define PSM_CONFIG_SYNCHACK	0x8000 /* enable `out-of-sync' hack */
 
 #define PSM_CONFIG_FLAGS	(PSM_CONFIG_RESOLUTION 		\
 				    | PSM_CONFIG_ACCEL		\
 				    | PSM_CONFIG_NOCHECKSYNC	\
+				    | PSM_CONFIG_SYNCHACK	\
 				    | PSM_CONFIG_NOIDPROBE	\
 				    | PSM_CONFIG_NORESET	\
 				    | PSM_CONFIG_FORCETAP	\
@@ -1900,6 +1902,15 @@
             log(LOG_DEBUG, "psmintr: out of sync (%04x != %04x).\n", 
 		c & sc->mode.syncmask[0], sc->mode.syncmask[1]);
 	    sc->inputbytes = 0;
+	    if (sc->config & PSM_CONFIG_SYNCHACK) {
+		/*
+		 * XXX: this is a grotesque hack to get us out of
+		 * dreaded "out of sync" error.
+		 */
+		log(LOG_DEBUG, "psmintr: re-enable the mouse.\n");
+		disable_aux_dev(sc->kbdc);
+		enable_aux_dev(sc->kbdc);
+	    }
             continue;
 	}
 


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




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