This reverts commit 6137e4166004e2ec383ac05d5ca15831f4668806.

We explicitly clear GFP_HIGHMEM from the allowed dma flags at the beginning
of the function (and the generic dma_alloc_attr function calling us does the
same!), so this code just adds dead wood.

Signed-off-by: Christoph Hellwig <[email protected]>
---
 arch/xtensa/kernel/pci-dma.c | 20 ++------------------
 1 file changed, 2 insertions(+), 18 deletions(-)

diff --git a/arch/xtensa/kernel/pci-dma.c b/arch/xtensa/kernel/pci-dma.c
index 1fc138b6bc0a..a764d894ffdd 100644
--- a/arch/xtensa/kernel/pci-dma.c
+++ b/arch/xtensa/kernel/pci-dma.c
@@ -171,20 +171,6 @@ void *arch_dma_alloc(struct device *dev, size_t size, 
dma_addr_t *handle,
                return page;
        }
 
-#ifdef CONFIG_MMU
-       if (PageHighMem(page)) {
-               void *p;
-
-               p = dma_common_contiguous_remap(page, size, VM_MAP,
-                                               pgprot_noncached(PAGE_KERNEL),
-                                               __builtin_return_address(0));
-               if (!p) {
-                       if (!dma_release_from_contiguous(dev, page, count))
-                               __free_pages(page, get_order(size));
-               }
-               return p;
-       }
-#endif
        BUG_ON(!platform_vaddr_cached(page_address(page)));
        __invalidate_dcache_range((unsigned long)page_address(page), size);
        return platform_vaddr_to_uncached(page_address(page));
@@ -201,10 +187,8 @@ void arch_dma_free(struct device *dev, size_t size, void 
*vaddr,
        } else if (platform_vaddr_uncached(vaddr)) {
                page = virt_to_page(platform_vaddr_to_cached(vaddr));
        } else {
-#ifdef CONFIG_MMU
-               dma_common_free_remap(vaddr, size, VM_MAP);
-#endif
-               page = pfn_to_page(PHYS_PFN(dma_to_phys(dev, dma_handle)));
+               WARN_ON_ONCE(1);
+               return;
        }
 
        if (!dma_release_from_contiguous(dev, page, count))
-- 
2.18.0

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Reply via email to