Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/sbus Eliminate a race condition reported by mouse on...



details:   https://anonhg.NetBSD.org/src/rev/5ccd1e4d716f
branches:  trunk
changeset: 487871:5ccd1e4d716f
user:      pk <pk%NetBSD.org@localhost>
date:      Wed Jun 14 08:01:26 2000 +0000

description:
Eliminate a race condition reported by mouse on port-sparc.

diffstat:

 sys/dev/sbus/bpp.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (37 lines):

diff -r 97e6489b386b -r 5ccd1e4d716f sys/dev/sbus/bpp.c
--- a/sys/dev/sbus/bpp.c        Wed Jun 14 06:54:20 2000 +0000
+++ b/sys/dev/sbus/bpp.c        Wed Jun 14 08:01:26 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bpp.c,v 1.3 1999/11/21 15:01:50 pk Exp $ */
+/*     $NetBSD: bpp.c,v 1.4 2000/06/14 08:01:26 pk Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -301,7 +301,7 @@
        int s;
 
        /*
-        * Wait until the DMA engibe is free.
+        * Wait until the DMA engine is free.
         */
        s = splbpp();
        while ((sc->sc_flags & BPP_LOCKED) != 0) {
@@ -344,14 +344,18 @@
                                          L64854_REG_TCR, tcr);
 
                        /* Enable DMA */
+                       s = splbpp();
                        DMA_GO(lsi);
                        error = tsleep(sc, PZERO|PCATCH, "bppdma", 0);
+                       splx(s);
                        if (error != 0)
                                goto out;
 
                        /* Bail out if bottom half reported an error */
                        if ((error = sc->sc_error) != 0)
                                goto out;
+
+                       len -= size;
                }
        }
 



Home | Main Index | Thread Index | Old Index