X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fswiotlb.c;h=a7381d55663a9f219f8313a4801614309ba9d207;hb=8380770c842faef3001e44662953d64ad9a93663;hp=9970e55c90bd7b28d90c5912bf3f63da3a4c7dc2;hpb=ae5dd8e346efc25a5f9cc9d01bc0915c40eb38d9;p=linux-2.6-omap-h63xx.git diff --git a/lib/swiotlb.c b/lib/swiotlb.c index 9970e55c90b..a7381d55663 100644 --- a/lib/swiotlb.c +++ b/lib/swiotlb.c @@ -357,7 +357,8 @@ map_single(struct device *hwdev, char *buffer, size_t size, int dir) * This is needed when we sync the memory. Then we sync the buffer if * needed. */ - io_tlb_orig_addr[index] = buffer; + for (i = 0; i < nslots; i++) + io_tlb_orig_addr[index+i] = buffer + (i << IO_TLB_SHIFT); if (dir == DMA_TO_DEVICE || dir == DMA_BIDIRECTIONAL) memcpy(dma_addr, buffer, size); @@ -418,6 +419,8 @@ sync_single(struct device *hwdev, char *dma_addr, size_t size, int index = (dma_addr - io_tlb_start) >> IO_TLB_SHIFT; char *buffer = io_tlb_orig_addr[index]; + buffer += ((unsigned long)dma_addr & ((1 << IO_TLB_SHIFT) - 1)); + switch (target) { case SYNC_FOR_CPU: if (likely(dir == DMA_FROM_DEVICE || dir == DMA_BIDIRECTIONAL)) @@ -778,7 +781,6 @@ swiotlb_dma_supported(struct device *hwdev, u64 mask) return virt_to_bus(io_tlb_end - 1) <= mask; } -EXPORT_SYMBOL(swiotlb_init); EXPORT_SYMBOL(swiotlb_map_single); EXPORT_SYMBOL(swiotlb_unmap_single); EXPORT_SYMBOL(swiotlb_map_sg);