]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
swiotlb-xen: remove start_dma_addr
authorStefano Stabellini <stefano.stabellini@xilinx.com>
Fri, 10 Jul 2020 22:34:18 +0000 (15:34 -0700)
committerJuergen Gross <jgross@suse.com>
Tue, 4 Aug 2020 05:43:17 +0000 (07:43 +0200)
It is not strictly needed. Call virt_to_phys on xen_io_tlb_start
instead. It will be useful not to have a start_dma_addr around with the
next patches.

Note that virt_to_phys is not the same as xen_virt_to_bus but actually
it is used to compared again __pa(xen_io_tlb_start) as passed to
swiotlb_init_with_tbl, so virt_to_phys is actually what we want.

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-2-sstabellini@kernel.org
Signed-off-by: Juergen Gross <jgross@suse.com>
drivers/xen/swiotlb-xen.c

index 5fbadd07819bdda53a473a8ef97b67ecf2ff9822..89a775948a02c75e7a4e8491e230e8f4119f5f10 100644 (file)
@@ -52,8 +52,6 @@ static unsigned long xen_io_tlb_nslabs;
  * Quick lookup value of the bus address of the IOTLB.
  */
 
-static u64 start_dma_addr;
-
 /*
  * Both of these functions should avoid XEN_PFN_PHYS because phys_addr_t
  * can be 32bit when dma_addr_t is 64bit leading to a loss in
@@ -241,7 +239,6 @@ retry:
                m_ret = XEN_SWIOTLB_EFIXUP;
                goto error;
        }
-       start_dma_addr = xen_virt_to_bus(xen_io_tlb_start);
        if (early) {
                if (swiotlb_init_with_tbl(xen_io_tlb_start, xen_io_tlb_nslabs,
                         verbose))
@@ -392,8 +389,8 @@ static dma_addr_t xen_swiotlb_map_page(struct device *dev, struct page *page,
         */
        trace_swiotlb_bounced(dev, dev_addr, size, swiotlb_force);
 
-       map = swiotlb_tbl_map_single(dev, start_dma_addr, phys,
-                                    size, size, dir, attrs);
+       map = swiotlb_tbl_map_single(dev, virt_to_phys(xen_io_tlb_start),
+                                    phys, size, size, dir, attrs);
        if (map == (phys_addr_t)DMA_MAPPING_ERROR)
                return DMA_MAPPING_ERROR;