Index: fwdev.c =================================================================== RCS file: /cvsroot/src/sys/dev/ieee1394/fwdev.c,v retrieving revision 1.24 diff -u -p -r1.24 fwdev.c --- fwdev.c 26 Aug 2010 12:48:19 -0000 1.24 +++ fwdev.c 2 Sep 2010 06:34:37 -0000 @@ -248,9 +248,7 @@ readloop: if (slept == 0) { slept = 1; ir->flag |= FWXFERQ_WAKEUP; - mutex_exit(&fc->fc_mtx); - err = tsleep(ir, FWPRI, "fw_read", hz); - mutex_enter(&fc->fc_mtx); + err = cv_timedwait_sig(&fc->fc_cv, &fc->fc_mtx, hz); ir->flag &= ~FWXFERQ_WAKEUP; if (err == 0) goto readloop; @@ -326,9 +324,7 @@ isoloop: if (err) goto out; #endif - mutex_exit(&fc->fc_mtx); - err = tsleep(it, FWPRI, "fw_write", hz); - mutex_enter(&fc->fc_mtx); + err = cv_timedwait_sig(&fc->fc_cv, &fc->fc_mtx, hz); if (err) goto out; goto isoloop; @@ -804,17 +800,12 @@ fw_read_async(struct fw_drv1 *d, struct mutex_enter(&d->fc->fc_mtx); - for (;;) { - xfer = STAILQ_FIRST(&d->rq); - if (xfer == NULL && err == 0) { - mutex_exit(&d->fc->fc_mtx); - err = tsleep(&d->rq, FWPRI, "fwra", 0); - if (err != 0) - return err; - mutex_enter(&d->fc->fc_mtx); - continue; - } - break; + while ((xfer = STAILQ_FIRST(&d->rq)) == NULL && err == 0) + err = cv_wait_sig(&xfer->cv, &d->fc->fc_mtx); + + if (err != 0) { + mutex_exit(&d->fc->fc_mtx); + return err; } STAILQ_REMOVE_HEAD(&d->rq, link); @@ -907,6 +898,6 @@ fw_hand(struct fw_xfer *xfer) d = (struct fw_drv1 *)fwb->sc; mutex_enter(&xfer->fc->fc_mtx); STAILQ_INSERT_TAIL(&d->rq, xfer, link); + cv_broadcast(&xfer->cv); mutex_exit(&xfer->fc->fc_mtx); - wakeup(&d->rq); } Index: fwohci.c =================================================================== RCS file: /cvsroot/src/sys/dev/ieee1394/fwohci.c,v retrieving revision 1.129 diff -u -p -r1.129 fwohci.c --- fwohci.c 29 Aug 2010 21:15:26 -0000 1.129 +++ fwohci.c 2 Sep 2010 06:34:37 -0000 @@ -882,13 +882,12 @@ static int fwohci_irx_disable(struct firewire_comm *fc, int dmach) { struct fwohci_softc *sc = (struct fwohci_softc *)fc; - int sleepch; OWRITE(sc, OHCI_IRCTLCLR(dmach), OHCI_CNTL_DMA_RUN); OWRITE(sc, OHCI_IR_MASKCLR, 1 << dmach); OWRITE(sc, OHCI_IR_STATCLR, 1 << dmach); /* XXX we cannot free buffers until the DMA really stops */ - tsleep((void *)&sleepch, FWPRI, "fwirxd", hz); + kpause("fwirxd", true, hz, NULL); fwohci_db_free(sc, &sc->ir[dmach]); sc->ir[dmach].xferq.flag &= ~FWXFERQ_RUNNING; return 0; @@ -1016,14 +1015,13 @@ static int fwohci_itx_disable(struct firewire_comm *fc, int dmach) { struct fwohci_softc *sc = (struct fwohci_softc *)fc; - int sleepch; OWRITE(sc, OHCI_ITCTLCLR(dmach), OHCI_CNTL_DMA_RUN | OHCI_CNTL_CYCMATCH_S); OWRITE(sc, OHCI_IT_MASKCLR, 1 << dmach); OWRITE(sc, OHCI_IT_STATCLR, 1 << dmach); /* XXX we cannot free buffers until the DMA really stops */ - tsleep((void *)&sleepch, FWPRI, "fwitxd", hz); + kpause("fwitxd", true, hz, NULL); fwohci_db_free(sc, &sc->it[dmach]); sc->it[dmach].xferq.flag &= ~FWXFERQ_RUNNING; return 0; @@ -2214,9 +2212,9 @@ fwohci_tbuf_update(struct fwohci_softc * STAILQ_INSERT_TAIL(&it->stfree, chunk, link); w++; } - mutex_exit(&fc->fc_mtx); if (w) - wakeup(it); + cv_broadcast(&fc->fc_cv); + mutex_exit(&fc->fc_mtx); } static void @@ -2277,8 +2275,11 @@ fwohci_rbuf_update(struct fwohci_softc * return; if (ir->flag & FWXFERQ_HANDLER) ir->hand(ir); - else - wakeup(ir); + else { + mutex_enter(&fc->fc_mtx); + cv_broadcast(&fc->fc_cv); + mutex_exit(&fc->fc_mtx); + } } static void