diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2012-10-17 19:16:11 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2012-10-17 19:16:11 +0000 |
commit | 6843cf64ad0ab3d95e61e3a0ea6effa01d94e8af (patch) | |
tree | ee72690be5b26723ac2d9cd2e9f8c6d5dfa382be /sys/dev/ic | |
parent | c455292996cb4baeb6e31340a7c991752a49c16b (diff) |
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
Diffstat (limited to 'sys/dev/ic')
-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); } /* |