Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

swiotlb-xen: add struct device * parameter to xen_dma_sync_for_cpu

No functional changes. The parameter is unused in this patch but will be
used by next patches.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Tested-by: Corey Minyard <cminyard@mvista.com>
Tested-by: Roman Shaposhnik <roman@zededa.com>
Link: https://lore.kernel.org/r/20200710223427.6897-5-sstabellini@kernel.org
Signed-off-by: Juergen Gross <jgross@suse.com>

authored by

Stefano Stabellini and committed by
Juergen Gross
297f7f82 d900781a

+8 -6
+3 -2
arch/arm/xen/mm.c
··· 71 71 * pfn_valid returns true the pages is local and we can use the native 72 72 * dma-direct functions, otherwise we call the Xen specific version. 73 73 */ 74 - void xen_dma_sync_for_cpu(dma_addr_t handle, phys_addr_t paddr, size_t size, 75 - enum dma_data_direction dir) 74 + void xen_dma_sync_for_cpu(struct device *dev, dma_addr_t handle, 75 + phys_addr_t paddr, size_t size, 76 + enum dma_data_direction dir) 76 77 { 77 78 if (pfn_valid(PFN_DOWN(handle))) 78 79 arch_sync_dma_for_cpu(paddr, size, dir);
+2 -2
drivers/xen/swiotlb-xen.c
··· 428 428 BUG_ON(dir == DMA_NONE); 429 429 430 430 if (!dev_is_dma_coherent(hwdev) && !(attrs & DMA_ATTR_SKIP_CPU_SYNC)) 431 - xen_dma_sync_for_cpu(dev_addr, paddr, size, dir); 431 + xen_dma_sync_for_cpu(hwdev, dev_addr, paddr, size, dir); 432 432 433 433 /* NOTE: We use dev_addr here, not paddr! */ 434 434 if (is_xen_swiotlb_buffer(dev_addr)) ··· 442 442 phys_addr_t paddr = xen_bus_to_phys(dev, dma_addr); 443 443 444 444 if (!dev_is_dma_coherent(dev)) 445 - xen_dma_sync_for_cpu(dma_addr, paddr, size, dir); 445 + xen_dma_sync_for_cpu(dev, dma_addr, paddr, size, dir); 446 446 447 447 if (is_xen_swiotlb_buffer(dma_addr)) 448 448 swiotlb_tbl_sync_single(dev, paddr, size, dir, SYNC_FOR_CPU);
+3 -2
include/xen/swiotlb-xen.h
··· 4 4 5 5 #include <linux/swiotlb.h> 6 6 7 - void xen_dma_sync_for_cpu(dma_addr_t handle, phys_addr_t paddr, size_t size, 8 - enum dma_data_direction dir); 7 + 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); 9 10 void xen_dma_sync_for_device(dma_addr_t handle, phys_addr_t paddr, size_t size, 10 11 enum dma_data_direction dir); 11 12