diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2012-10-15 13:19:44 -0400 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2012-10-30 09:32:07 -0400 |
commit | 61ca08c3220032dd88815b3465d56cb779258168 (patch) | |
tree | b126015d4fd76ff1e4b936097877e734aa19746b /drivers/xen/swiotlb-xen.c | |
parent | e05ed4d1fad9e730995abb08cb9bc3bffac5018b (diff) |
swiotlb: Use physical addresses for swiotlb_tbl_unmap_single
This change makes it so that the unmap functionality also uses physical
addresses. This helps to further reduce the use of virt_to_phys and
phys_to_virt functions.
In order to clarify things since we now have 2 physical addresses in use
inside of swiotlb_tbl_unmap_single I am renaming phys to orig_addr, and
dma_addr to tlb_addr. This way is should be clear that orig_addr is
contained within io_orig_addr and tlb_addr is an address within the
io_tlb_addr buffer.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/xen/swiotlb-xen.c')
-rw-r--r-- | drivers/xen/swiotlb-xen.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c index 8a6035aa69c9..4cedc284b5df 100644 --- a/drivers/xen/swiotlb-xen.c +++ b/drivers/xen/swiotlb-xen.c | |||
@@ -364,7 +364,7 @@ dma_addr_t xen_swiotlb_map_page(struct device *dev, struct page *page, | |||
364 | * Ensure that the address returned is DMA'ble | 364 | * Ensure that the address returned is DMA'ble |
365 | */ | 365 | */ |
366 | if (!dma_capable(dev, dev_addr, size)) { | 366 | if (!dma_capable(dev, dev_addr, size)) { |
367 | swiotlb_tbl_unmap_single(dev, phys_to_virt(map), size, dir); | 367 | swiotlb_tbl_unmap_single(dev, map, size, dir); |
368 | dev_addr = 0; | 368 | dev_addr = 0; |
369 | } | 369 | } |
370 | return dev_addr; | 370 | return dev_addr; |
@@ -388,7 +388,7 @@ static void xen_unmap_single(struct device *hwdev, dma_addr_t dev_addr, | |||
388 | 388 | ||
389 | /* NOTE: We use dev_addr here, not paddr! */ | 389 | /* NOTE: We use dev_addr here, not paddr! */ |
390 | if (is_xen_swiotlb_buffer(dev_addr)) { | 390 | if (is_xen_swiotlb_buffer(dev_addr)) { |
391 | swiotlb_tbl_unmap_single(hwdev, phys_to_virt(paddr), size, dir); | 391 | swiotlb_tbl_unmap_single(hwdev, paddr, size, dir); |
392 | return; | 392 | return; |
393 | } | 393 | } |
394 | 394 | ||