summaryrefslogtreecommitdiff
path: root/sys/dev/pad
diff options
context:
space:
mode:
authornat <nat@NetBSD.org>2015-07-10 21:58:56 +0000
committernat <nat@NetBSD.org>2015-07-10 21:58:56 +0000
commit85c52cb3ffd7c190b7024d2ff003ac11c4eae49c (patch)
tree063e4a75dcf470fb5a15e996a9cad167abd419cb /sys/dev/pad
parentd7ba07c802a746316054f699f8d44fda6e5b70af (diff)
Wrap up calls to sc_intr in kpreempt[en/dis]able.
This commit was approved by christos@
Diffstat (limited to 'sys/dev/pad')
-rw-r--r--sys/dev/pad/pad.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/dev/pad/pad.c b/sys/dev/pad/pad.c
index d4a0d840f6a..a754b91d5ec 100644
--- a/sys/dev/pad/pad.c
+++ b/sys/dev/pad/pad.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pad.c,v 1.22 2014/11/18 01:53:17 jmcneill Exp $ */
+/* $NetBSD: pad.c,v 1.23 2015/07/10 21:58:56 nat Exp $ */
/*-
* Copyright (c) 2007 Jared D. McNeill <jmcneill@invisible.ca>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pad.c,v 1.22 2014/11/18 01:53:17 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pad.c,v 1.23 2015/07/10 21:58:56 nat Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -354,6 +354,7 @@ pad_read(dev_t dev, struct uio *uio, int flags)
intr = sc->sc_intr;
intrarg = sc->sc_intrarg;
+ kpreempt_disable();
while (uio->uio_resid > 0 && !err) {
err = pad_get_block(sc, &pb, min(uio->uio_resid, PAD_BLKSIZE));
if (!err) {
@@ -375,6 +376,7 @@ pad_read(dev_t dev, struct uio *uio, int flags)
err = cv_wait_sig(&sc->sc_condvar, &sc->sc_lock);
if (err != 0) {
mutex_exit(&sc->sc_lock);
+ kpreempt_enable();
return err;
}
intr = sc->sc_intr;
@@ -387,6 +389,7 @@ pad_read(dev_t dev, struct uio *uio, int flags)
mutex_exit(&sc->sc_intr_lock);
}
mutex_exit(&sc->sc_lock);
+ kpreempt_enable();
return err;
}