From owner-freebsd-hackers Mon Jan 8 18: 4:27 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from outmail.utsunomiya-u.ac.jp (outmail.utsunomiya-u.ac.jp [160.12.196.3]) by hub.freebsd.org (Postfix) with ESMTP id 2E2F837B699 for ; Mon, 8 Jan 2001 18:04:06 -0800 (PST) Received: from zodiac.mech.utsunomiya-u.ac.jp (IDENT:lhk7oBoQr54nHQi+ChrqpRmJ8D5UUQxp@zodiac.mech.utsunomiya-u.ac.jp [160.12.42.1]) by outmail.utsunomiya-u.ac.jp (8.11.0/3.7Wpl2) with ESMTP id f0923tH02292; Tue, 9 Jan 2001 11:03:59 +0900 (JST) Received: from zodiac.mech.utsunomiya-u.ac.jp (IDENT:ZmNAt1ifc/My6iHDMWXkVyAzDREk2+21@zodiac.mech.utsunomiya-u.ac.jp [160.12.42.1]) by zodiac.mech.utsunomiya-u.ac.jp (8.9.3+3.2W/3.7W/zodiac-May2000) with ESMTP id LAA02768; Tue, 9 Jan 2001 11:11:36 +0900 (JST) Message-Id: <200101090211.LAA02768@zodiac.mech.utsunomiya-u.ac.jp> To: Greg Black Cc: hackers@freebsd.org, yokota@zodiac.mech.utsunomiya-u.ac.jp Subject: Re: psmintr: out of sync In-reply-to: Your message of "Sun, 07 Jan 2001 10:52:21 +1000." References: Date: Tue, 09 Jan 2001 11:11:35 +0900 From: Kazutaka YOKOTA Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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