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)
This commit is contained in:
mhorne 2019-11-16 01:25:51 +00:00
parent 3a09fa0468
commit bfc168b30e

View File

@ -214,7 +214,7 @@ bounce_bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment,
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)