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_bus_to_phys

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

authored by

Stefano Stabellini and committed by
Juergen Gross
d900781a 2cf6a913

+5 -5
+5 -5
drivers/xen/swiotlb-xen.c
··· 67 67 return dma; 68 68 } 69 69 70 - static inline phys_addr_t xen_bus_to_phys(dma_addr_t baddr) 70 + static inline phys_addr_t xen_bus_to_phys(struct device *dev, dma_addr_t baddr) 71 71 { 72 72 unsigned long xen_pfn = bfn_to_pfn(XEN_PFN_DOWN(baddr)); 73 73 dma_addr_t dma = (dma_addr_t)xen_pfn << XEN_PAGE_SHIFT; ··· 339 339 340 340 /* do not use virt_to_phys because on ARM it doesn't return you the 341 341 * physical address */ 342 - phys = xen_bus_to_phys(dev_addr); 342 + phys = xen_bus_to_phys(hwdev, dev_addr); 343 343 344 344 /* Convert the size to actually allocated. */ 345 345 size = 1UL << (order + XEN_PAGE_SHIFT); ··· 423 423 static void xen_swiotlb_unmap_page(struct device *hwdev, dma_addr_t dev_addr, 424 424 size_t size, enum dma_data_direction dir, unsigned long attrs) 425 425 { 426 - phys_addr_t paddr = xen_bus_to_phys(dev_addr); 426 + phys_addr_t paddr = xen_bus_to_phys(hwdev, dev_addr); 427 427 428 428 BUG_ON(dir == DMA_NONE); 429 429 ··· 439 439 xen_swiotlb_sync_single_for_cpu(struct device *dev, dma_addr_t dma_addr, 440 440 size_t size, enum dma_data_direction dir) 441 441 { 442 - phys_addr_t paddr = xen_bus_to_phys(dma_addr); 442 + phys_addr_t paddr = xen_bus_to_phys(dev, dma_addr); 443 443 444 444 if (!dev_is_dma_coherent(dev)) 445 445 xen_dma_sync_for_cpu(dma_addr, paddr, size, dir); ··· 452 452 xen_swiotlb_sync_single_for_device(struct device *dev, dma_addr_t dma_addr, 453 453 size_t size, enum dma_data_direction dir) 454 454 { 455 - phys_addr_t paddr = xen_bus_to_phys(dma_addr); 455 + phys_addr_t paddr = xen_bus_to_phys(dev, dma_addr); 456 456 457 457 if (is_xen_swiotlb_buffer(dma_addr)) 458 458 swiotlb_tbl_sync_single(dev, paddr, size, dir, SYNC_FOR_DEVICE);