]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
dma-debug: refactor to use physical addresses for page mapping
authorLeon Romanovsky <leonro@nvidia.com>
Tue, 9 Sep 2025 13:27:31 +0000 (16:27 +0300)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Thu, 11 Sep 2025 22:09:51 +0000 (00:09 +0200)
commite9e81d86fee63c6d5757841ab557019ddf73786f
tree00e3c471c0b7d77c8a3f2362f91222c09a27227b
parentc288d657dd5151199d6629c11a940fee33fdd0bd
dma-debug: refactor to use physical addresses for page mapping

Convert the DMA debug infrastructure from page-based to physical address-based
mapping as a preparation to rely on physical address for DMA mapping routines.

The refactoring renames debug_dma_map_page() to debug_dma_map_phys() and
changes its signature to accept a phys_addr_t parameter instead of struct page
and offset. Similarly, debug_dma_unmap_page() becomes debug_dma_unmap_phys().
A new dma_debug_phy type is introduced to distinguish physical address mappings
from other debug entry types. All callers throughout the codebase are updated
to pass physical addresses directly, eliminating the need for page-to-physical
conversion in the debug layer.

This refactoring eliminates the need to convert between page pointers and
physical addresses in the debug layer, making the code more efficient and
consistent with the DMA mapping API's physical address focus.

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
[mszyprow: added a fixup]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Link: https://lore.kernel.org/r/56d1a6769b68dfcbf8b26a75a7329aeb8e3c3b6a.1757423202.git.leonro@nvidia.com
Link: https://lore.kernel.org/all/20250910052618.GH341237@unreal/
Documentation/core-api/dma-api.rst
include/linux/page-flags.h
kernel/dma/debug.c
kernel/dma/debug.h
kernel/dma/mapping.c