svn commit: r355354 - in stable: 11/sys/arm64/arm64 12/sys/arm64/arm64

Kyle Evans kevans at FreeBSD.org
Tue Dec 3 19:00:13 UTC 2019


Author: kevans
Date: Tue Dec  3 19:00:12 2019
New Revision: 355354
URL: https://svnweb.freebsd.org/changeset/base/355354

Log:
  MFC r354712: arm64: 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.

Modified:
  stable/11/sys/arm64/arm64/busdma_bounce.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/12/sys/arm64/arm64/busdma_bounce.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/11/sys/arm64/arm64/busdma_bounce.c
==============================================================================
--- stable/11/sys/arm64/arm64/busdma_bounce.c	Tue Dec  3 18:58:45 2019	(r355353)
+++ stable/11/sys/arm64/arm64/busdma_bounce.c	Tue Dec  3 19:00:12 2019	(r355354)
@@ -214,7 +214,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-all mailing list