Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Feb 2012 19:42:40 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r232267 - head/sys/x86/x86
Message-ID:  <201202281942.q1SJgeed084974@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Tue Feb 28 19:42:40 2012
New Revision: 232267
URL: http://svn.freebsd.org/changeset/base/232267

Log:
  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@.
  
  Reviewed by:    scottl, jhb
  Sponsored by:   Sandvine Incorporated
  MFC after:      3 days

Modified:
  head/sys/x86/x86/busdma_machdep.c

Modified: head/sys/x86/x86/busdma_machdep.c
==============================================================================
--- head/sys/x86/x86/busdma_machdep.c	Tue Feb 28 19:39:54 2012	(r232266)
+++ head/sys/x86/x86/busdma_machdep.c	Tue Feb 28 19:42:40 2012	(r232267)
@@ -227,6 +227,14 @@ bus_dma_tag_create(bus_dma_tag_t parent,
 	bus_dma_tag_t newtag;
 	int error = 0;
 
+	/* Always enforce at least a 4GB (2GB for PAE) boundary. */
+#if defined(__amd64__)
+	if (boundary == 0 || boundary > ((bus_addr_t)1 << 32))
+		boundary = (bus_size_t)1 << 32;
+#elif defined(PAE)
+	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?201202281942.q1SJgeed084974>