diff options
author | 2012-10-17 19:16:10 +0000 | |
---|---|---|
committer | 2012-10-17 19:16:10 +0000 | |
commit | 5b6ac26334318afc3f633ef1e24d127e39d26328 (patch) | |
tree | 22208b840c497d6346e8f86c43942673838e9f43 | |
parent | adjust comment explaining what the files are for (diff) | |
download | wireguard-openbsd-5b6ac26334318afc3f633ef1e24d127e39d26328.tar.xz wireguard-openbsd-5b6ac26334318afc3f633ef1e24d127e39d26328.zip |
cleanup more of the driver soft-state when suspending; in certain
async operational modes a timeout and some requests on a queue
were still active
helps a machine mlarkin has
ok miod shadchin mlarkin
-rw-r--r-- | sys/dev/ic/pckbc.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/sys/dev/ic/pckbc.c b/sys/dev/ic/pckbc.c index 49d01d6b4b1..75a0d4cd753 100644 --- a/sys/dev/ic/pckbc.c +++ b/sys/dev/ic/pckbc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pckbc.c,v 1.30 2012/08/10 17:49:31 shadchin Exp $ */ +/* $OpenBSD: pckbc.c,v 1.31 2012/10/17 19:16:10 deraadt Exp $ */ /* $NetBSD: pckbc.c,v 1.5 2000/06/09 04:58:35 soda Exp $ */ /* @@ -92,6 +92,7 @@ static int pckbc_send_devcmd(struct pckbc_internal *, pckbc_slot_t, static void pckbc_poll_cmd1(struct pckbc_internal *, pckbc_slot_t, struct pckbc_devcmd *); +void pckbc_cleanqueues(struct pckbc_internal *); void pckbc_cleanqueue(struct pckbc_slotdata *); void pckbc_cleanup(void *); void pckbc_poll(void *); @@ -690,6 +691,15 @@ pckbc_cleanqueue(struct pckbc_slotdata *q) } } +void +pckbc_cleanqueues(struct pckbc_internal *t) +{ + if (t->t_slotdata[PCKBC_KBD_SLOT]) + pckbc_cleanqueue(t->t_slotdata[PCKBC_KBD_SLOT]); + if (t->t_slotdata[PCKBC_AUX_SLOT]) + pckbc_cleanqueue(t->t_slotdata[PCKBC_AUX_SLOT]); +} + /* * Timeout error handler: clean queues and data port. * XXX could be less invasive. @@ -704,10 +714,7 @@ pckbc_cleanup(void *self) s = spltty(); - if (t->t_slotdata[PCKBC_KBD_SLOT]) - pckbc_cleanqueue(t->t_slotdata[PCKBC_KBD_SLOT]); - if (t->t_slotdata[PCKBC_AUX_SLOT]) - pckbc_cleanqueue(t->t_slotdata[PCKBC_AUX_SLOT]); + pckbc_cleanqueues(t); while (bus_space_read_1(t->t_iot, t->t_ioh_c, 0) & KBS_DIB) { KBD_DELAY; @@ -728,6 +735,8 @@ pckbc_stop(struct pckbc_softc *sc) struct pckbc_internal *t = sc->id; timeout_del(&t->t_poll); + pckbc_cleanqueues(t); + timeout_del(&t->t_cleanup); } /* |