|
@@ -334,9 +334,6 @@ int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
|
|
|
|
|
|
spin_unlock_irqrestore(&(tbl->it_lock), flags);
|
|
spin_unlock_irqrestore(&(tbl->it_lock), flags);
|
|
|
|
|
|
- /* Make sure updates are seen by hardware */
|
|
|
|
- mb();
|
|
|
|
-
|
|
|
|
DBG("mapped %d elements:\n", outcount);
|
|
DBG("mapped %d elements:\n", outcount);
|
|
|
|
|
|
/* For the sake of iommu_unmap_sg, we clear out the length in the
|
|
/* For the sake of iommu_unmap_sg, we clear out the length in the
|
|
@@ -347,6 +344,10 @@ int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
|
|
outs->dma_address = DMA_ERROR_CODE;
|
|
outs->dma_address = DMA_ERROR_CODE;
|
|
outs->dma_length = 0;
|
|
outs->dma_length = 0;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /* Make sure updates are seen by hardware */
|
|
|
|
+ mb();
|
|
|
|
+
|
|
return outcount;
|
|
return outcount;
|
|
|
|
|
|
failure:
|
|
failure:
|
|
@@ -358,6 +359,8 @@ int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
|
|
npages = (PAGE_ALIGN(s->dma_address + s->dma_length) - vaddr)
|
|
npages = (PAGE_ALIGN(s->dma_address + s->dma_length) - vaddr)
|
|
>> PAGE_SHIFT;
|
|
>> PAGE_SHIFT;
|
|
__iommu_free(tbl, vaddr, npages);
|
|
__iommu_free(tbl, vaddr, npages);
|
|
|
|
+ s->dma_address = DMA_ERROR_CODE;
|
|
|
|
+ s->dma_length = 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
spin_unlock_irqrestore(&(tbl->it_lock), flags);
|
|
spin_unlock_irqrestore(&(tbl->it_lock), flags);
|