Re: [PATCH] dma-remap: fix dma_common_find_pages() page lookup for offsets
From: Andrei-Edward Popa
Date: Mon Dec 15 2025 - 15:50:14 EST
Hi Christoph, Marek, Robin,
Thanks for the detailed explanations, that clarified things a lot.
I now understand that dma_mmap_attrs() expects cpu_addr to be the exact
pointer returned by dma_alloc_attrs(), and that subdividing an allocation
(e.g. via gen_pool) requires the driver to keep track of offsets and
adjust the mmap parameters accordingly before calling into the DMA API.
My patch was effectively trying to make dma_common_find_pages() accept
offset cpu_addr values implicitly, which would change the DMA API
semantics and mask driver bugs rather than fixing them in the driver
itself.
Given this, I agree that the correct fix is in the driver using the API,
not in dma-remap, and I’ll drop this patch.
Thanks again for taking the time to explain the intended usage and
constraints of the DMA mmap helpers.
Best regards,
Andrei