xen/arm: use dma-noncoherent.h calls for xen-swiotlb cache maintainance
Copy the arm64 code that uses the dma-direct/swiotlb helpers for DMA on-coherent devices. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
This commit is contained in:
@@ -557,11 +557,6 @@ xen_swiotlb_dma_mmap(struct device *dev, struct vm_area_struct *vma,
|
||||
void *cpu_addr, dma_addr_t dma_addr, size_t size,
|
||||
unsigned long attrs)
|
||||
{
|
||||
#ifdef CONFIG_ARM
|
||||
if (xen_get_dma_ops(dev)->mmap)
|
||||
return xen_get_dma_ops(dev)->mmap(dev, vma, cpu_addr,
|
||||
dma_addr, size, attrs);
|
||||
#endif
|
||||
return dma_common_mmap(dev, vma, cpu_addr, dma_addr, size, attrs);
|
||||
}
|
||||
|
||||
@@ -574,21 +569,6 @@ xen_swiotlb_get_sgtable(struct device *dev, struct sg_table *sgt,
|
||||
void *cpu_addr, dma_addr_t handle, size_t size,
|
||||
unsigned long attrs)
|
||||
{
|
||||
#ifdef CONFIG_ARM
|
||||
if (xen_get_dma_ops(dev)->get_sgtable) {
|
||||
#if 0
|
||||
/*
|
||||
* This check verifies that the page belongs to the current domain and
|
||||
* is not one mapped from another domain.
|
||||
* This check is for debug only, and should not go to production build
|
||||
*/
|
||||
unsigned long bfn = PHYS_PFN(dma_to_phys(dev, handle));
|
||||
BUG_ON (!page_is_ram(bfn));
|
||||
#endif
|
||||
return xen_get_dma_ops(dev)->get_sgtable(dev, sgt, cpu_addr,
|
||||
handle, size, attrs);
|
||||
}
|
||||
#endif
|
||||
return dma_common_get_sgtable(dev, sgt, cpu_addr, handle, size, attrs);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user