Subject: old PS/2 mouse driver fix?
To: None <tech-kern@netbsd.org>
From: None <jiho@mail.c-zone.net>
List: tech-kern
Date: 08/15/1999 12:43:36
I haven't posted this as a bug fix yet -- I'm not 100%
satisfied yet that it is one -- but so far it _seems_
to be one....

On my Cheeseball DeLuxe i386 with a VIA MVP3 chipset (so-called
"Super 7" AMD-based alternative to Intel), I was having sporadic
and seemingly random crashes of my file manager and X server
while doing things with the PS/2 mouse -- using the "old" PS/2
mouse driver (pre-wscons).  (The file manager "grabs" the
mouse.)

I _seem_ to have fixed this by adding a while() loop to the
hardware interrupt handler so that it repeats to handle any
further input, as long as a keyboard controller status bit flags
that mouse data is waiting.  This is equivalent to what the
pccons keyboard driver has done for keyboard input (using
another bit, of course) since prehistoric times.

Due to wscons the PS/2 mouse driver seems to be in a state of
flux, so this is not a patch, but rather an "or words to that
effect" representation of the fix in <arch/i386/isa/pms.c>:


#if (NOPMS_HACK > 0)
int opmsintr(void *arg)
  {
  struct opms_softc *sc=arg;

  if((sc->sc_state & PMS_OPEN)==0)
    {
    pms_flush_input();
    return(0);
    }

  /*-------------------------------------------------------*/
  /* NEW:  repeat while 'mouse output buffer full' bit set */
  /*-------------------------------------------------------*/
  while(inb(PMS_STATUS) & 0x20)
    opmsinput(arg, inb(PMS_DATA));

  return(-1);
  }
#endif


For older versions of pms.c without the opmsinput() function,
just add braces and inline the function in the above and you
pretty much have the idea.

Since adding this fix, I haven't had a single crash in as much
testing as I've been able to contrive, but it's only been a
couple of days.  If anyone with a PS/2 mouse wants to apply
this fix, I'd appreciate their feedback before filing a bug
report.


--Jim Howard  <jiho@mail.c-zone.net>


----------------------------------
E-Mail: <jiho@mail.c-zone.net>
Date: 15-Aug-99
Time: 12:43:36

This message was sent by XFMail
----------------------------------