Thread (1 message) 1 message, 1 author, 2014-08-12

[PATCH v5 1/1] iommu-api: Add map_sg/unmap_sg functions

From: Olav Haugan <hidden>
Date: 2014-08-12 16:53:44
Also in: linux-arm-msm, linux-iommu

On 8/11/2014 6:35 PM, Konrad Rzeszutek Wilk wrote:
On Mon, Aug 11, 2014 at 03:45:50PM -0700, Olav Haugan wrote:
.. snip..
quoted
+	for_each_sg(sg, s, nents, i) {
+		phys_addr_t phys = page_to_phys(sg_page(s));
+		size_t page_len = s->offset + s->length;
+
+		ret = iommu_map(domain, iova + offset, phys, page_len,
+				prot);
+		if (ret) {
+			/* undo mappings already done */
+			iommu_unmap(domain, iova, offset);
Don't we want then to unmap all of the scatter list instead of just
the last one?
It reverts all the mapping that was already done up until the error
occurred. "offset" contains the amount we have mapped so far.

Thanks,

Olav

-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help