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_phys_to_bus

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

authored by

Stefano Stabellini and committed by
Juergen Gross
2cf6a913 ae4f0a17

+7 -7
+7 -7
drivers/xen/swiotlb-xen.c
··· 57 57 * can be 32bit when dma_addr_t is 64bit leading to a loss in 58 58 * information if the shift is done before casting to 64bit. 59 59 */ 60 - static inline dma_addr_t xen_phys_to_bus(phys_addr_t paddr) 60 + static inline dma_addr_t xen_phys_to_bus(struct device *dev, phys_addr_t paddr) 61 61 { 62 62 unsigned long bfn = pfn_to_bfn(XEN_PFN_DOWN(paddr)); 63 63 dma_addr_t dma = (dma_addr_t)bfn << XEN_PAGE_SHIFT; ··· 78 78 return paddr; 79 79 } 80 80 81 - static inline dma_addr_t xen_virt_to_bus(void *address) 81 + static inline dma_addr_t xen_virt_to_bus(struct device *dev, void *address) 82 82 { 83 - return xen_phys_to_bus(virt_to_phys(address)); 83 + return xen_phys_to_bus(dev, virt_to_phys(address)); 84 84 } 85 85 86 86 static inline int range_straddles_page_boundary(phys_addr_t p, size_t size) ··· 309 309 * Do not use virt_to_phys(ret) because on ARM it doesn't correspond 310 310 * to *dma_handle. */ 311 311 phys = *dma_handle; 312 - dev_addr = xen_phys_to_bus(phys); 312 + dev_addr = xen_phys_to_bus(hwdev, phys); 313 313 if (((dev_addr + size - 1 <= dma_mask)) && 314 314 !range_straddles_page_boundary(phys, size)) 315 315 *dma_handle = dev_addr; ··· 370 370 unsigned long attrs) 371 371 { 372 372 phys_addr_t map, phys = page_to_phys(page) + offset; 373 - dma_addr_t dev_addr = xen_phys_to_bus(phys); 373 + dma_addr_t dev_addr = xen_phys_to_bus(dev, phys); 374 374 375 375 BUG_ON(dir == DMA_NONE); 376 376 /* ··· 395 395 return DMA_MAPPING_ERROR; 396 396 397 397 phys = map; 398 - dev_addr = xen_phys_to_bus(map); 398 + dev_addr = xen_phys_to_bus(dev, map); 399 399 400 400 /* 401 401 * Ensure that the address returned is DMA'ble ··· 539 539 static int 540 540 xen_swiotlb_dma_supported(struct device *hwdev, u64 mask) 541 541 { 542 - return xen_virt_to_bus(xen_io_tlb_end - 1) <= mask; 542 + return xen_virt_to_bus(hwdev, xen_io_tlb_end - 1) <= mask; 543 543 } 544 544 545 545 const struct dma_map_ops xen_swiotlb_dma_ops = {