PCI/P2PDMA: Apply bus offset correctly in DMA address calculation
authorWang Lu <wanglu@dapustor.com>
Thu, 9 Sep 2021 03:25:28 +0000 (11:25 +0800)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 20 Sep 2021 19:46:02 +0000 (14:46 -0500)
commit3a19407913e8e43d6b799a59bc0f6cae889b5446
tree8e5776fb87a881e1671a396b4d102f566089e127
parente4e737bb5c170df6135a127739a9e6148ee3da82
PCI/P2PDMA: Apply bus offset correctly in DMA address calculation

The bus offset is bus address - physical address, so the calculation in
__pci_p2pdma_map_sg should be: bus address = physical address + bus offset.

Correct the dma_address computation in __pci_p2pdma_map_sg().

Link: https://lore.kernel.org/r/20210909032528.24517-1-wanglu@dapustor.com
Signed-off-by: Wang Lu <wanglu@dapustor.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
drivers/pci/p2pdma.c