diff options
author | Logan Gunthorpe <logang@deltatee.com> | 2019-08-12 11:30:43 -0600 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2019-08-16 08:41:26 -0500 |
commit | 7f73eac3a7137eabfb0c005c7ba55eb7994b9673 (patch) | |
tree | 71b1700c9f04a1a35c9abdc59a4b7104dff03901 /drivers/nvme | |
parent | 2b9f4bb2a4fb77da4862f9ddf5209de2bcdaa0c0 (diff) | |
download | linux-7f73eac3a7137eabfb0c005c7ba55eb7994b9673.tar.gz |
PCI/P2PDMA: Introduce pci_p2pdma_unmap_sg()
Add pci_p2pdma_unmap_sg() to the two places that call pci_p2pdma_map_sg().
This is a prep patch to introduce correct mappings for p2pdma transactions
that go through the root complex.
Link: https://lore.kernel.org/r/20190730163545.4915-10-logang@deltatee.com
Link: https://lore.kernel.org/r/20190812173048.9186-10-logang@deltatee.com
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme')
-rw-r--r-- | drivers/nvme/host/pci.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 7747712054cd..2348b15f6bd0 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -547,8 +547,10 @@ static void nvme_unmap_data(struct nvme_dev *dev, struct request *req) WARN_ON_ONCE(!iod->nents); - /* P2PDMA requests do not need to be unmapped */ - if (!is_pci_p2pdma_page(sg_page(iod->sg))) + if (is_pci_p2pdma_page(sg_page(iod->sg))) + pci_p2pdma_unmap_sg(dev->dev, iod->sg, iod->nents, + rq_dma_dir(req)); + else dma_unmap_sg(dev->dev, iod->sg, iod->nents, rq_dma_dir(req)); |