Merge tag 'for-linus-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw...
[linux-2.6-microblaze.git] / drivers / pci / p2pdma.c
index bace041..1963826 100644 (file)
@@ -556,15 +556,6 @@ int pci_p2pdma_distance_many(struct pci_dev *provider, struct device **clients,
                return -1;
 
        for (i = 0; i < num_clients; i++) {
-#ifdef CONFIG_DMA_VIRT_OPS
-               if (clients[i]->dma_ops == &dma_virt_ops) {
-                       if (verbose)
-                               dev_warn(clients[i],
-                                        "cannot be used for peer-to-peer DMA because the driver makes use of dma_virt_ops\n");
-                       return -1;
-               }
-#endif
-
                pci_client = find_parent_pci_dev(clients[i]);
                if (!pci_client) {
                        if (verbose)
@@ -834,24 +825,10 @@ static int __pci_p2pdma_map_sg(struct pci_p2pdma_pagemap *p2p_pgmap,
                struct device *dev, struct scatterlist *sg, int nents)
 {
        struct scatterlist *s;
-       phys_addr_t paddr;
        int i;
 
-       /*
-        * p2pdma mappings are not compatible with devices that use
-        * dma_virt_ops. If the upper layers do the right thing
-        * this should never happen because it will be prevented
-        * by the check in pci_p2pdma_distance_many()
-        */
-#ifdef CONFIG_DMA_VIRT_OPS
-       if (WARN_ON_ONCE(dev->dma_ops == &dma_virt_ops))
-               return 0;
-#endif
-
        for_each_sg(sg, s, nents, i) {
-               paddr = sg_phys(s);
-
-               s->dma_address = paddr - p2p_pgmap->bus_offset;
+               s->dma_address = sg_phys(s) - p2p_pgmap->bus_offset;
                sg_dma_len(s) = s->length;
        }