svn commit: r354712 - head/sys/arm64/arm64

Kyle Evans kevans at FreeBSD.org
Thu Nov 14 18:38:57 UTC 2019


Author: kevans
Date: Thu Nov 14 18:38:56 2019
New Revision: 354712
URL: https://svnweb.freebsd.org/changeset/base/354712

Log:
  arm64: busdma_bounce: fix BUS_DMA_ALLOCNOW for non-paged aligned sizes
  
  For any size that isn't page-aligned, we end up not pre-allocating enough
  for a single mapping because we truncate the size instead of rounding up to
  make sure the last bit is accounted for, leaving us one page shy of what we
  need to fulfill a request.
  
  Differential Revision:	https://reviews.freebsd.org/D22288

Modified:
  head/sys/arm64/arm64/busdma_bounce.c

Modified: head/sys/arm64/arm64/busdma_bounce.c
==============================================================================
--- head/sys/arm64/arm64/busdma_bounce.c	Thu Nov 14 17:11:52 2019	(r354711)
+++ head/sys/arm64/arm64/busdma_bounce.c	Thu Nov 14 18:38:56 2019	(r354712)
@@ -216,7 +216,7 @@ bounce_bus_dma_tag_create(bus_dma_tag_t parent, bus_si
 		if (ptoa(bz->total_bpages) < maxsize) {
 			int pages;
 
-			pages = atop(maxsize) - bz->total_bpages;
+			pages = atop(round_page(maxsize)) - bz->total_bpages;
 
 			/* Add pages to our bounce pool */
 			if (alloc_bounce_pages(newtag, pages) < pages)


More information about the svn-src-head mailing list