History

xen/arm: introduce phys/dma translations in xen_dma_sync_for_*

xen_dma_sync_for_cpu, xen_dma_sync_for_device, xen_arch_need_swiotlb are getting called passing dma addresses. On some platforms dma addresses could be different from physical addresses. Before doing any operations on these addresses we need to convert them back to physical addresses using dma_to_phys. Move the arch_sync_dma_for_cpu and arch_sync_dma_for_device calls from xen_dma_sync_for_cpu/device to swiotlb-xen.c, and add a call dma_to_phys to do address translations there. dma_cache_maint is fixed by the next patch.

Stefano Stabellini committed 6 years ago

Commit 63f06201 parent 91ffe4a3 files · +32 −23Browse files

Showing the changes to include (1 of 3 files). Show all

Unified · Split

include/xen/swiotlb-xen.h+2−4
@@ -5,11 +5,9 @@ · 4 unmodified lines
55 #include <linux/swiotlb.h>
66
77 void xen_dma_sync_for_cpu(struct device *dev, dma_addr_t handle,
8− phys_addr_t paddr, size_t size,
9− enum dma_data_direction dir);
8+ size_t size, enum dma_data_direction dir);
109 void xen_dma_sync_for_device(struct device *dev, dma_addr_t handle,
11− phys_addr_t paddr, size_t size,
12− enum dma_data_direction dir);
10+ size_t size, enum dma_data_direction dir);
1311
1412 extern int xen_swiotlb_init(int verbose, bool early);
1513 extern const struct dma_map_ops xen_swiotlb_dma_ops;