diff options
author | Logan Gunthorpe <logang@deltatee.com> | 2022-07-08 10:50:56 -0600 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2022-07-26 07:27:47 -0400 |
commit | f02ad36d4f76645e7e1c21f572260e9a2e61c26b (patch) | |
tree | 0e46523b735822b5db0e63e4afb0af0841a1e275 /mm | |
parent | 7c2645a2a30a45d3dc4c98b315a51be44ec69a67 (diff) | |
download | linux-stable-f02ad36d4f76645e7e1c21f572260e9a2e61c26b.tar.gz linux-stable-f02ad36d4f76645e7e1c21f572260e9a2e61c26b.tar.bz2 linux-stable-f02ad36d4f76645e7e1c21f572260e9a2e61c26b.zip |
dma-direct: support PCI P2PDMA pages in dma-direct map_sg
Add PCI P2PDMA support for dma_direct_map_sg() so that it can map
PCI P2PDMA pages directly without a hack in the callers. This allows
for heterogeneous SGLs that contain both P2PDMA and regular pages.
A P2PDMA page may have three possible outcomes when being mapped:
1) If the data path between the two devices doesn't go through the
root port, then it should be mapped with a PCI bus address
2) If the data path goes through the host bridge, it should be mapped
normally, as though it were a CPU physical address
3) It is not possible for the two devices to communicate and thus
the mapping operation should fail (and it will return -EREMOTEIO).
SGL segments that contain PCI bus addresses are marked with
sg_dma_mark_pci_p2pdma() and are ignored when unmapped.
P2PDMA mappings are also failed if swiotlb needs to be used on the
mapping.
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'mm')
0 files changed, 0 insertions, 0 deletions