Re: [PATCH v3 2/2] alpha: enable contiguous memory allocation for coherent DMA
From: Matt Turner
Date: Sun Nov 15 2026 - 11:32:29 EST
On Sun, Nov 15, 2026 at 5:38 AM Magnus Lindholm <linmag7@xxxxxxxxx> wrote:
> Use dma_alloc_contiguous(), which rejects non-blocking callers, before
> falling back to alloc_pages_exact(). Pair both paths with
> dma_free_contiguous(), whose buddy fallback uses free_pages_exact().
Right, and the !CONFIG_DMA_CMA stub does the same since 641a9b9cc697
("dma-mapping: use exact allocation for DMA pages"), so the pairing
holds either way. Just something to keep in mind if this ever gets
backported past that commit.
> + size = PAGE_ALIGN(size);
> gfp &= ~GFP_DMA;
Thanks, this and the matching change in alpha_pci_free_coherent() look
right. The CMA alloc and release counts now agree, and the memset()
covers the whole aligned size.
> + if (__direct_map_size) {
> ...
> + }
Looks good. Every remaining core sets a nonzero __direct_map_size, so
the check is purely defensive today, which is fine.
I build-tested the series on top of 0b4cadbe7c39 with
ALPHA_GENERIC=y, SMP=y, CMA=y, DMA_CMA=y and W=1, and saw no new
warnings in pci_iommu.c or setup.c. I haven't booted it.
Reviewed-by: Matt Turner <mattst88@xxxxxxxxx>