svn commit: r354765 - head/sys/riscv/riscv

Mitchell Horne mhorne at FreeBSD.org
Sat Nov 16 01:25:52 UTC 2019


Author: mhorne
Date: Sat Nov 16 01:25:51 2019
New Revision: 354765
URL: https://svnweb.freebsd.org/changeset/base/354765

Log:
  RISC-V: busdma_bounce: fix BUS_DMA_ALLOCNOW for non-paged aligned sizes
  
  RISC-V inherited this code from arm64, so implement the fix from r354712.
  See the revision for the full description.
  
  Submitted by:	kevans (arm64 version)

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

Modified: head/sys/riscv/riscv/busdma_bounce.c
==============================================================================
--- head/sys/riscv/riscv/busdma_bounce.c	Sat Nov 16 00:52:04 2019	(r354764)
+++ head/sys/riscv/riscv/busdma_bounce.c	Sat Nov 16 01:25:51 2019	(r354765)
@@ -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-head mailing list