diff options
-rw-r--r-- | sys/dev/pccbb/pccbb.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/sys/dev/pccbb/pccbb.c b/sys/dev/pccbb/pccbb.c index 8df8efc..a3435b4 100644 --- a/sys/dev/pccbb/pccbb.c +++ b/sys/dev/pccbb/pccbb.c @@ -1011,23 +1011,21 @@ cbb_event_thread(void *arg) mtx_unlock(&Giant); /* - * In our ISR, we turn off the card changed interrupt. Turn - * them back on here before we wait for them to happen. We - * turn them on/off so that we can tolerate a large latency - * between the time we signal cbb_event_thread and it gets - * a chance to run. - */ - cbb_setb(sc, CBB_SOCKET_MASK, CBB_SOCKET_MASK_CD); - - /* * Wait until it has been 1s since the last time we * get an interrupt. We handle the rest of the interrupt * at the top of the loop. Although we clear the bit in the * ISR, we signal sc->cv from the detach path after we've * set the CBB_KTHREAD_DONE bit, so we can't do a simple * 1s sleep here. + * + * In our ISR, we turn off the card changed interrupt. Turn + * them back on here before we wait for them to happen. We + * turn them on/off so that we can tolerate a large latency + * between the time we signal cbb_event_thread and it gets + * a chance to run. */ mtx_lock(&sc->mtx); + cbb_setb(sc, CBB_SOCKET_MASK, CBB_SOCKET_MASK_CD); cv_wait(&sc->cv, &sc->mtx); err = 0; while (err != EWOULDBLOCK && @@ -1125,8 +1123,8 @@ cbb_intr(void *arg) * excellent results. */ if (sockevent & CBB_SOCKET_EVENT_CD) { - cbb_clrb(sc, CBB_SOCKET_MASK, CBB_SOCKET_MASK_CD); mtx_lock(&sc->mtx); + cbb_setb(sc, CBB_SOCKET_MASK, CBB_SOCKET_MASK_CD); sc->flags &= ~CBB_CARD_OK; cbb_disable_func_intr(sc); DPRINTF(("Waking up thread\n")); |