Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Nov 2019 18:38:56 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r354712 - head/sys/arm64/arm64
Message-ID:  <201911141838.xAEIcuIn029148@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201911141838.xAEIcuIn029148>