]> git.ipfire.org Git - thirdparty/linux.git/commit
PCI/P2PDMA: Simplify bus address mapping API
authorLeon Romanovsky <leonro@nvidia.com>
Thu, 20 Nov 2025 09:28:21 +0000 (11:28 +0200)
committerAlex Williamson <alex@shazbot.org>
Thu, 20 Nov 2025 19:01:41 +0000 (12:01 -0700)
commitd4504262f745e48c1739c8b864f779b4b0f9de80
tree4d45f9dbd52249aa33106160d684742632bf9bb5
parentf58ef9d1d1355b15443719df95081f193067ab88
PCI/P2PDMA: Simplify bus address mapping API

Update the pci_p2pdma_bus_addr_map() function to take a direct pointer
to the p2pdma_provider structure instead of the pci_p2pdma_map_state.
This simplifies the API by removing the need for callers to extract
the provider from the state structure.

The change updates all callers across the kernel (block layer, IOMMU,
DMA direct, and HMM) to pass the provider pointer directly, making
the code more explicit and reducing unnecessary indirection. This
also removes the runtime warning check since callers now have direct
control over which provider they use.

Tested-by: Alex Mastro <amastro@fb.com>
Tested-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Acked-by: Ankit Agrawal <ankita@nvidia.com>
Link: https://lore.kernel.org/r/20251120-dmabuf-vfio-v9-2-d7f71607f371@nvidia.com
Signed-off-by: Alex Williamson <alex@shazbot.org>
block/blk-mq-dma.c
drivers/iommu/dma-iommu.c
include/linux/pci-p2pdma.h
kernel/dma/direct.c
mm/hmm.c