Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc64/dev in iommu_remove() don't invalidate the ...



details:   https://anonhg.NetBSD.org/src/rev/9e51ab046a12
branches:  trunk
changeset: 755713:9e51ab046a12
user:      mrg <mrg%NetBSD.org@localhost>
date:      Thu Jun 17 06:48:46 2010 +0000

description:
in iommu_remove() don't invalidate the IOMMU mapping.  for reasons not
yet determined, some PCI devices (at least fxp(4) and re(4)) sometimes
appear to perform DMA operations while this is happening, and we get
uncorrectable DMA errors.  ideally, this "shouldn't happen", but none
of the investigation so far has reveal the problem, and my source
investigation of both opensolaris and linux show that their perform
the invaliation when unmapping.

"handles" PR#43274 as well as other issues...

XXX: candidate for netbsd-5

diffstat:

 sys/arch/sparc64/dev/iommu.c |  11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diffs (53 lines):

diff -r 85537e5c3f28 -r 9e51ab046a12 sys/arch/sparc64/dev/iommu.c
--- a/sys/arch/sparc64/dev/iommu.c      Thu Jun 17 06:41:05 2010 +0000
+++ b/sys/arch/sparc64/dev/iommu.c      Thu Jun 17 06:48:46 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: iommu.c,v 1.98 2010/03/11 03:54:56 mrg Exp $   */
+/*     $NetBSD: iommu.c,v 1.99 2010/06/17 06:48:46 mrg Exp $   */
 
 /*
  * Copyright (c) 1999, 2000 Matthew R. Green
@@ -59,7 +59,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: iommu.c,v 1.98 2010/03/11 03:54:56 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: iommu.c,v 1.99 2010/06/17 06:48:46 mrg Exp $");
 
 #include "opt_ddb.h"
 
@@ -213,6 +213,7 @@
        is->is_dvmamap = extent_create(name,
            is->is_dvmabase, is->is_dvmaend,
            M_DEVBUF, 0, 0, EX_NOWAIT);
+       /* XXXMRG Check is_dvmamap is valid. */
 }
 
 /*
@@ -349,6 +350,7 @@
                else
                        len -= PAGE_SIZE;
 
+#if 0
                /*
                 * XXX Zero-ing the entry would not require RMW
                 *
@@ -360,6 +362,7 @@
                 */
                is->is_tsb[IOTSBSLOT(va,is->is_tsbsize)] &= ~IOTTE_V;
                membar_storestore();
+#endif
                bus_space_write_8(is->is_bustag, is->is_iommu,
                        IOMMUREG(iommu_flush), va);
                va += PAGE_SIZE;
@@ -639,10 +642,6 @@
        /* Flush the caches */
        bus_dmamap_unload(t->_parent, map);
 
-       /* Mark the mappings as invalid. */
-       map->dm_mapsize = 0;
-       map->dm_nsegs = 0;
-
        s = splhigh();
        error = extent_free(is->is_dvmamap, map->_dm_dvmastart,
                map->_dm_dvmasize, EX_NOWAIT);



Home | Main Index | Thread Index | Old Index