]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mm/hmm: migrate to physical address-based DMA mapping API
authorLeon Romanovsky <leonro@nvidia.com>
Tue, 9 Sep 2025 13:27:40 +0000 (16:27 +0300)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Thu, 11 Sep 2025 22:18:21 +0000 (00:18 +0200)
commite1d69da24fb8ee02e13dcbc281f510f01332a7f8
treeb4981e48a90b6f6af2e4791e3be0e79c8a2b2a98
parentf7326196a781622b33bfbdabb00f5e72b5fb5679
mm/hmm: migrate to physical address-based DMA mapping API

Convert HMM DMA operations from the legacy page-based API to the new
physical address-based dma_map_phys() and dma_unmap_phys() functions.
This demonstrates the preferred approach for new code that should use
physical addresses directly rather than page+offset parameters.

The change replaces dma_map_page() and dma_unmap_page() calls with
dma_map_phys() and dma_unmap_phys() respectively, using the physical
address that was already available in the code. This eliminates the
redundant page-to-physical address conversion and aligns with the
DMA subsystem's move toward physical address-centric interfaces.

This serves as an example of how new code should be written to leverage
the more efficient physical address API, which provides cleaner interfaces
for drivers that already have access to physical addresses.

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/d45207f195b8f77d23cc2d571c83197328a86b04.1757423202.git.leonro@nvidia.com
mm/hmm.c