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)
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to