diff options
| author | Aneesh Kumar K.V (Arm) <aneesh.kumar@kernel.org> | 2026-07-17 23:34:22 +0530 |
|---|---|---|
| committer | Marek Szyprowski <m.szyprowski@samsung.com> | 2026-07-31 08:40:58 +0200 |
| commit | 8a9dc4a028e726ff64f0a7b2931485c9ce87e2c0 (patch) | |
| tree | c9bfb5fb796d09d006e6835c2e5b828ef85bc376 /include/linux/timerqueue.h | |
| parent | af95a0ebc0a0db0762be75f51eadf770bad01aaa (diff) | |
dma: free atomic pool pages by physical address
dma_direct_alloc_pages() may satisfy atomic allocations from the coherent
atomic pools. The pool allocation is keyed by the virtual address stored in
the gen_pool, but the pages API returns only the backing struct page.
On architectures with CONFIG_DMA_DIRECT_REMAP, atomic pool chunks are added
to the gen_pool using their remapped virtual address.
dma_direct_free_pages() reconstructs a linear-map address with
page_address(page) and passes that to dma_free_from_pool(). That address
does not match the gen_pool virtual range, so the pool lookup can fail and
the code can fall through to freeing a pool-owned page through the normal
page allocator path.
Add a page-based pool free helper that looks up the owning pool chunk by
physical address, translates it back to the gen_pool virtual address, and
frees that address to the pool. Use it from dma_direct_free_pages() while
keeping the existing virtual-address helper for coherent allocation frees.
Tested-by: Michael Kelley <mhklinux@outlook.com>
Tested-by: Mostafa Saleh <smostafa@google.com>
Signed-off-by: Aneesh Kumar K.V (Arm) <aneesh.kumar@kernel.org>
Link: https://lore.kernel.org/r/20260717180442.110954-5-aneesh.kumar@kernel.org
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Diffstat (limited to 'include/linux/timerqueue.h')
0 files changed, 0 insertions, 0 deletions
