diff options
author | yokota <yokota@FreeBSD.org> | 2000-07-22 04:08:12 +0000 |
---|---|---|
committer | yokota <yokota@FreeBSD.org> | 2000-07-22 04:08:12 +0000 |
commit | 59b3f471f6c4ef91e64ad28e6e88ae6c6bf79fec (patch) | |
tree | 4ef4e8d783ad8da6f70507af79ddf6fb4eb8984c /sys | |
parent | 8c2fae53742ffaf1871be8c56947b9ac306af564 (diff) | |
download | FreeBSD-src-59b3f471f6c4ef91e64ad28e6e88ae6c6bf79fec.zip FreeBSD-src-59b3f471f6c4ef91e64ad28e6e88ae6c6bf79fec.tar.gz |
This is yet another attempt to fix "psmintr out of sync.." problems.
- Properly protect the watchdog timer routine.
- Relocate the sync check statement so that we don't see too many
error messages.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/atkbdc/psm.c | 22 | ||||
-rw-r--r-- | sys/isa/psm.c | 22 |
2 files changed, 18 insertions, 26 deletions
diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c index bcc8a87..b3433c9 100644 --- a/sys/dev/atkbdc/psm.c +++ b/sys/dev/atkbdc/psm.c @@ -1830,10 +1830,11 @@ psmtimeout(void *arg) 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 @@ psmintr(void *arg) 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 @@ psmintr(void *arg) 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 diff --git a/sys/isa/psm.c b/sys/isa/psm.c index bcc8a87..b3433c9 100644 --- a/sys/isa/psm.c +++ b/sys/isa/psm.c @@ -1830,10 +1830,11 @@ psmtimeout(void *arg) 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 @@ psmintr(void *arg) 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 @@ psmintr(void *arg) 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 |