Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Dec 2019 19:00:12 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r355354 - in stable: 11/sys/arm64/arm64 12/sys/arm64/arm64
Message-ID:  <201912031900.xB3J0CKG067986@repo.freebsd.org>

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



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