Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/mipsco/mipsco Revert back to invalidating cache dur...



details:   https://anonhg.NetBSD.org/src/rev/74fe50e2b6eb
branches:  trunk
changeset: 519331:74fe50e2b6eb
user:      wdk <wdk%NetBSD.org@localhost>
date:      Sat Dec 15 11:33:13 2001 +0000

description:
Revert back to invalidating cache during BUS_DMASYNC_POSTREAD instead of
during BUS_DMASYNC_PREREAD.

Fixes problem where SCSI bus probe didn't read meaningful identity data.

Technically there should be no difference between invalidating before or
after the DMA, but for reasons known only to the R3000 this fixes the
problem.   Some thought needs to be given to whether there is a performace
difference between these two cases.

diffstat:

 sys/arch/mipsco/mipsco/bus_dma.c |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (50 lines):

diff -r 0917ba6005c5 -r 74fe50e2b6eb sys/arch/mipsco/mipsco/bus_dma.c
--- a/sys/arch/mipsco/mipsco/bus_dma.c  Sat Dec 15 11:17:03 2001 +0000
+++ b/sys/arch/mipsco/mipsco/bus_dma.c  Sat Dec 15 11:33:13 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus_dma.c,v 1.7 2001/11/14 18:15:29 thorpej Exp $      */
+/*     $NetBSD: bus_dma.c,v 1.8 2001/12/15 11:33:13 wdk Exp $  */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -439,14 +439,14 @@
        bus_addr_t addr;
        int i;
 
+#ifdef DIAGNOSTIC
        /*
-        * Mising PRE and POST operations is not allowed.
+        * Mixing PRE and POST operations is not allowed.
         */
        if ((ops & (BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE)) != 0 &&
            (ops & (BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE)) != 0)
                panic("_bus_dmamap_sync: mix PRE and POST");
 
-#ifdef DIAGNOSTIC
        if (offset >= map->dm_mapsize)
                panic("_bus_dmamap_sync: bad offset %lu (map size is %lu)",
                      offset, map->dm_mapsize);
@@ -458,9 +458,9 @@
         * The R3000 cache is write-through.  Therefore, we only need
         * to drain the write buffer on PREWRITE.  The cache is not
         * coherent, however, so we need to invalidate the data cache
-        * on PREREAD (should we do it POSTREAD instead?).
+        * on POSTREAD.
         *
-        * POSTWRITE (and POSTREAD, currently) are noops.
+        * PREREAD and POSTWRITE are noops.
         */
 
        if (ops & BUS_DMASYNC_PREWRITE) {
@@ -471,9 +471,9 @@
        }
 
        /*
-        * If we're not doing a PREREAD, nothing more to do.
+        * If we're not doing a POSTREAD, nothing more to do.
         */
-       if ((ops & BUS_DMASYNC_PREREAD) == 0)
+       if ((ops & BUS_DMASYNC_POSTREAD) == 0)
                return;
 
        /*



Home | Main Index | Thread Index | Old Index