Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pad Wrap up calls to sc_intr in kpreempt[en/dis]able.



details:   https://anonhg.NetBSD.org/src/rev/5f7843357fc9
branches:  trunk
changeset: 339293:5f7843357fc9
user:      nat <nat%NetBSD.org@localhost>
date:      Fri Jul 10 21:58:56 2015 +0000

description:
Wrap up calls to sc_intr in kpreempt[en/dis]able.

This commit was approved by christos@

diffstat:

 sys/dev/pad/pad.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (42 lines):

diff -r 6991867ed74a -r 5f7843357fc9 sys/dev/pad/pad.c
--- a/sys/dev/pad/pad.c Fri Jul 10 21:31:19 2015 +0000
+++ b/sys/dev/pad/pad.c Fri Jul 10 21:58:56 2015 +0000
@@ -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@localhost>
@@ -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 @@
        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 @@
                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 @@
                mutex_exit(&sc->sc_intr_lock);
        }
        mutex_exit(&sc->sc_lock);
+       kpreempt_enable();
 
        return err;
 }



Home | Main Index | Thread Index | Old Index