Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Mar 2012 16:38:55 +0000 (UTC)
From:      Sean Bruno <sbruno@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r232397 - in stable/7/sys: amd64/amd64 i386/i386
Message-ID:  <201203021638.q22GctMk038514@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sbruno
Date: Fri Mar  2 16:38:54 2012
New Revision: 232397
URL: http://svn.freebsd.org/changeset/base/232397

Log:
  MFC r232267 via stable/8 MFC r232354
  Workaround for PCIe 4GB boundary issue
  
  Enforce a boundary of no more than 4GB - transfers crossing a 4GB
  boundary can lead to data corruption due to PCIe limitations.  This
  change is a less-intrusive workaround that can be quickly merged back
  to older branches; a cleaner implementation will arrive in HEAD later
  but may require KPI changes.
  
  This change is based on a suggestion by jhb@.

Modified:
  stable/7/sys/amd64/amd64/busdma_machdep.c
  stable/7/sys/i386/i386/busdma_machdep.c
Directory Properties:
  stable/7/sys/   (props changed)

Modified: stable/7/sys/amd64/amd64/busdma_machdep.c
==============================================================================
--- stable/7/sys/amd64/amd64/busdma_machdep.c	Fri Mar  2 16:35:18 2012	(r232396)
+++ stable/7/sys/amd64/amd64/busdma_machdep.c	Fri Mar  2 16:38:54 2012	(r232397)
@@ -215,6 +215,10 @@ bus_dma_tag_create(bus_dma_tag_t parent,
 	bus_dma_tag_t newtag;
 	int error = 0;
 
+	/* Always enforce at least a 4GB boundary. */
+	if (boundary == 0 || boundary > ((bus_addr_t)1 << 32))
+		boundary = (bus_size_t)1 << 32;
+
 	/* Basic sanity checking */
 	if (boundary != 0 && boundary < maxsegsz)
 		maxsegsz = boundary;

Modified: stable/7/sys/i386/i386/busdma_machdep.c
==============================================================================
--- stable/7/sys/i386/i386/busdma_machdep.c	Fri Mar  2 16:35:18 2012	(r232396)
+++ stable/7/sys/i386/i386/busdma_machdep.c	Fri Mar  2 16:38:54 2012	(r232397)
@@ -220,6 +220,12 @@ bus_dma_tag_create(bus_dma_tag_t parent,
 	bus_dma_tag_t newtag;
 	int error = 0;
 
+#if defined(PAE)
+	/* Need at least a 4GB boundary, PAE limitations require 2GB */
+	if (boundary == 0 || boundary > ((bus_addr_t)1 << 31))
+		boundary = (bus_size_t)1 << 31;
+#endif
+
 	/* Basic sanity checking */
 	if (boundary != 0 && boundary < maxsegsz)
 		maxsegsz = boundary;



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