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/12/sys/arm64/arm64/busdma_bounce.c
Directory Properties:
  stable/12/   (props changed)

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

Modified: stable/12/sys/arm64/arm64/busdma_bounce.c
==============================================================================
--- stable/12/sys/arm64/arm64/busdma_bounce.c   Tue Dec  3 18:58:45 2019        
(r355353)
+++ stable/12/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)
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to