Skip to content

Commit 38ba51d

Browse files
Stefano Stabellinijgross1
authored andcommitted
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>
1 parent 995d355 commit 38ba51d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎drivers/xen/swiotlb-xen.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ static inline int range_straddles_page_boundary(phys_addr_t p, size_t size)
9797
return 0;
9898
}
9999

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)
101101
{
102102
unsigned long bfn = XEN_PFN_DOWN(dma_addr);
103103
unsigned long xen_pfn = bfn_to_local_pfn(bfn);
@@ -431,7 +431,7 @@ static void xen_swiotlb_unmap_page(struct device *hwdev, dma_addr_t dev_addr,
431431
xen_dma_sync_for_cpu(hwdev, dev_addr, paddr, size, dir);
432432

433433
/* 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))
435435
swiotlb_tbl_unmap_single(hwdev, paddr, size, size, dir, attrs);
436436
}
437437

@@ -444,7 +444,7 @@ xen_swiotlb_sync_single_for_cpu(struct device *dev, dma_addr_t dma_addr,
444444
if (!dev_is_dma_coherent(dev))
445445
xen_dma_sync_for_cpu(dev, dma_addr, paddr, size, dir);
446446

447-
if (is_xen_swiotlb_buffer(dma_addr))
447+
if (is_xen_swiotlb_buffer(dev, dma_addr))
448448
swiotlb_tbl_sync_single(dev, paddr, size, dir, SYNC_FOR_CPU);
449449
}
450450

@@ -454,7 +454,7 @@ xen_swiotlb_sync_single_for_device(struct device *dev, dma_addr_t dma_addr,
454454
{
455455
phys_addr_t paddr = xen_bus_to_phys(dev, dma_addr);
456456

457-
if (is_xen_swiotlb_buffer(dma_addr))
457+
if (is_xen_swiotlb_buffer(dev, dma_addr))
458458
swiotlb_tbl_sync_single(dev, paddr, size, dir, SYNC_FOR_DEVICE);
459459

460460
if (!dev_is_dma_coherent(dev))

0 commit comments

Comments
 (0)