Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Apr 2011 00:03:14 +0200
From:      Marius Strobl <marius@alchemy.franken.de>
To:        sparc64@freebsd.org
Subject:   [marius@freebsd.org: svn commit: r220931 - head/sys/sparc64/sparc64]
Message-ID:  <20110421220314.GD63055@alchemy.franken.de>

next in thread | raw e-mail | index | archive | help

FYI, I've finally enabled the use of the IOMMU streaming caches (if
present). Theoretically, this actually may result in data corruption
in the worst case if a driver doesn't properly use bus_dmamap_sync(9)
when not specifying BUS_DMA_COHERENT, however, I believe that I've
thoroughly reviewed and fixed all drivers in GENERIC and tested the
critical ones. If nevertheless you encounter problems with this commit
please let me know ASAP.
Thanks to Michael Moll for testing some hardware combinations I don't
have access to myself.

Marius

----- Forwarded message from Marius Strobl <marius@freebsd.org> -----

Delivered-To: svn-src-all@freebsd.org
From: Marius Strobl <marius@freebsd.org>
Date: Thu, 21 Apr 2011 21:56:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
        svn-src-head@freebsd.org
X-SVN-Group: head
Cc: 
Subject: svn commit: r220931 - head/sys/sparc64/sparc64
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
	user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all>;
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
	<mailto:svn-src-all-request@freebsd.org?subject=subscribe>
Errors-To: owner-svn-src-all@freebsd.org

Author: marius
Date: Thu Apr 21 21:56:28 2011
New Revision: 220931
URL: http://svn.freebsd.org/changeset/base/220931

Log:
  - Use the streaming cache unless BUS_DMA_COHERENT is specified. Since
    r220375 all drivers enabled in the sparc64 GENERIC should be either
    correctly using bus_dmamap_sync(9) calls or supply BUS_DMA_COHERENT
    when appropriate or as a workaround for missing bus_dmamap_sync(9)
    calls (sound(4) drivers and partially sym(4)). In at least some
    configurations taking advantage of the streaming cache results in
    a modest performance improvement.
  - Remove the memory barrier for BUS_DMASYNC_PREREAD which as the
    comment already suggested is bogus.
  - Add my copyright for having implemented several things like support
    for the Fire and Oberon IOMMUs, taking over PROM IOMMU mappings etc.

Modified:
  head/sys/sparc64/sparc64/iommu.c

Modified: head/sys/sparc64/sparc64/iommu.c
==============================================================================
--- head/sys/sparc64/sparc64/iommu.c	Thu Apr 21 21:15:11 2011	(r220930)
+++ head/sys/sparc64/sparc64/iommu.c	Thu Apr 21 21:56:28 2011	(r220931)
@@ -28,6 +28,7 @@
 /*-
  * Copyright (c) 1999-2002 Eduardo Horvath
  * Copyright (c) 2001-2003 Thomas Moestl
+ * Copyright (c) 2007, 2009 Marius Strobl <marius@FreeBSD.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -77,7 +78,6 @@ __FBSDID("$FreeBSD$");
  * - When running out of DVMA space, return EINPROGRESS in the non-
  *   BUS_DMA_NOWAIT case and delay the callback until sufficient space
  *   becomes available.
- * - Use the streaming cache unless BUS_DMA_COHERENT is specified.
  */
 
 #include "opt_iommu.h"
@@ -564,17 +564,8 @@ static __inline int
 iommu_use_streaming(struct iommu_state *is, bus_dmamap_t map, bus_size_t size)
 {
 
-	/*
-	 * This cannot be enabled yet, as many driver are still missing
-	 * bus_dmamap_sync() calls.  As soon as there is a BUS_DMA_STREAMING
-	 * flag, this should be reenabled conditionally on it.
-	 */
-#ifdef notyet
 	return (size >= IOMMU_STREAM_THRESH && IOMMU_HAS_SB(is) &&
 	    (map->dm_flags & DMF_COHERENT) == 0);
-#else
-	return (0);
-#endif
 }
 
 /*
@@ -1182,9 +1173,6 @@ iommu_dvmamap_sync(bus_dma_tag_t dt, bus
 
 	if ((map->dm_flags & DMF_LOADED) == 0)
 		return;
-	/* XXX This is probably bogus. */
-	if ((op & BUS_DMASYNC_PREREAD) != 0)
-		membar(Sync);
 	if ((map->dm_flags & DMF_STREAMED) != 0 &&
 	    ((op & BUS_DMASYNC_POSTREAD) != 0 ||
 	    (op & BUS_DMASYNC_PREWRITE) != 0)) {
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"

----- End forwarded message -----



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110421220314.GD63055>