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

swiotlb-xen: add struct device * parameter to is_xen_swiotlb_buffer

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-7-sstabellini@kernel.org
Signed-off-by: Juergen Gross <jgross@suse.com>

authored by

Stefano Stabellini and committed by
Juergen Gross
38ba51de 995d3556

+4 -4
+4 -4
drivers/xen/swiotlb-xen.c
··· 97 97 return 0; 98 98 } 99 99 100 - static int is_xen_swiotlb_buffer(dma_addr_t dma_addr) 100 + static int is_xen_swiotlb_buffer(struct device *dev, dma_addr_t dma_addr) 101 101 { 102 102 unsigned long bfn = XEN_PFN_DOWN(dma_addr); 103 103 unsigned long xen_pfn = bfn_to_local_pfn(bfn); ··· 431 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 - if (is_xen_swiotlb_buffer(dev_addr)) 434 + if (is_xen_swiotlb_buffer(hwdev, dev_addr)) 435 435 swiotlb_tbl_unmap_single(hwdev, paddr, size, size, dir, attrs); 436 436 } 437 437 ··· 444 444 if (!dev_is_dma_coherent(dev)) 445 445 xen_dma_sync_for_cpu(dev, dma_addr, paddr, size, dir); 446 446 447 - if (is_xen_swiotlb_buffer(dma_addr)) 447 + if (is_xen_swiotlb_buffer(dev, dma_addr)) 448 448 swiotlb_tbl_sync_single(dev, paddr, size, dir, SYNC_FOR_CPU); 449 449 } 450 450 ··· 454 454 { 455 455 phys_addr_t paddr = xen_bus_to_phys(dev, dma_addr); 456 456 457 - if (is_xen_swiotlb_buffer(dma_addr)) 457 + if (is_xen_swiotlb_buffer(dev, dma_addr)) 458 458 swiotlb_tbl_sync_single(dev, paddr, size, dir, SYNC_FOR_DEVICE); 459 459 460 460 if (!dev_is_dma_coherent(dev))