aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ubsec
diff options
context:
space:
mode:
authorPawel Jakub Dawidek <pjd@FreeBSD.org>2006-05-22 10:11:18 +0000
committerPawel Jakub Dawidek <pjd@FreeBSD.org>2006-05-22 10:11:18 +0000
commite6cb03f1555b00098b5b4d95272d8eaab95b4a8f (patch)
treeee23a70ec6f7279b323d64dfa1ef7052f7590ba8 /sys/dev/ubsec
parent3a865c827a896c493cfe28b8531500c64755bddc (diff)
Notes
Diffstat (limited to 'sys/dev/ubsec')
-rw-r--r--sys/dev/ubsec/ubsec.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/sys/dev/ubsec/ubsec.c b/sys/dev/ubsec/ubsec.c
index 22ab6544b496..4a5656073d1c 100644
--- a/sys/dev/ubsec/ubsec.c
+++ b/sys/dev/ubsec/ubsec.c
@@ -698,13 +698,17 @@ ubsec_intr(void *arg)
}
if (sc->sc_needwakeup) { /* XXX check high watermark */
- int wakeup = sc->sc_needwakeup & (CRYPTO_SYMQ|CRYPTO_ASYMQ);
+ int wakeup;
+
+ mtx_lock(&sc->sc_freeqlock);
+ wakeup = sc->sc_needwakeup & (CRYPTO_SYMQ|CRYPTO_ASYMQ);
#ifdef UBSEC_DEBUG
if (ubsec_debug)
device_printf(sc->sc_dev, "wakeup crypto (%x)\n",
sc->sc_needwakeup);
#endif /* UBSEC_DEBUG */
sc->sc_needwakeup &= ~wakeup;
+ mtx_unlock(&sc->sc_freeqlock);
crypto_unblock(sc->sc_cid, wakeup);
}
}
@@ -1545,16 +1549,19 @@ errout:
bus_dmamap_unload(sc->sc_dmat, q->q_src_map);
bus_dmamap_destroy(sc->sc_dmat, q->q_src_map);
}
-
+ }
+ if (q != NULL || err == ERESTART) {
mtx_lock(&sc->sc_freeqlock);
SIMPLEQ_INSERT_TAIL(&sc->sc_freequeue, q, q_next);
+ if (q != NULL)
+ SIMPLEQ_INSERT_TAIL(&sc->sc_freequeue, q, q_next);
+ if (err == ERESTART)
+ sc->sc_needwakeup |= CRYPTO_SYMQ;
mtx_unlock(&sc->sc_freeqlock);
}
if (err != ERESTART) {
crp->crp_etype = err;
crypto_done(crp);
- } else {
- sc->sc_needwakeup |= CRYPTO_SYMQ;
}
return (err);
}