]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
dma-mapping: convert dma_direct_*map_page to be phys_addr_t based
authorLeon Romanovsky <leonro@nvidia.com>
Tue, 9 Sep 2025 13:27:35 +0000 (16:27 +0300)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Thu, 11 Sep 2025 22:18:20 +0000 (00:18 +0200)
commite53d29f957b36ba1666331956c6ccb047bb157d2
tree4d0b5095ec7b23e80251c0a312039ea05cd82dfd
parentf9374de14c0e8c36cfb7c68618c07cb155e6f8e6
dma-mapping: convert dma_direct_*map_page to be phys_addr_t based

Convert the DMA direct mapping functions to accept physical addresses
directly instead of page+offset parameters. The functions were already
operating on physical addresses internally, so this change eliminates
the redundant page-to-physical conversion at the API boundary.

The functions dma_direct_map_page() and dma_direct_unmap_page() are
renamed to dma_direct_map_phys() and dma_direct_unmap_phys() respectively,
with their calling convention changed from (struct page *page,
unsigned long offset) to (phys_addr_t phys).

Architecture-specific functions arch_dma_map_page_direct() and
arch_dma_unmap_page_direct() are similarly renamed to
arch_dma_map_phys_direct() and arch_dma_unmap_phys_direct().

The is_pci_p2pdma_page() checks are replaced with DMA_ATTR_MMIO checks
to allow integration with dma_direct_map_resource and dma_direct_map_phys()
is extended to support MMIO path either.

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Link: https://lore.kernel.org/r/bb15a22f76dc2e26683333ff54e789606cfbfcf0.1757423202.git.leonro@nvidia.com
arch/powerpc/kernel/dma-iommu.c
include/linux/dma-map-ops.h
kernel/dma/direct.c
kernel/dma/direct.h
kernel/dma/mapping.c