ARM: dma-mapping: Always pass proper prot flags to iommu_map()
authorAndreas Herrmann <andreas.herrmann@calxeda.com>
Thu, 26 Sep 2013 22:36:15 +0000 (00:36 +0200)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Wed, 2 Oct 2013 11:23:11 +0000 (13:23 +0200)
... otherwise it is impossible for the low level iommu driver to
figure out which pte flags should be used.

In __map_sg_chunk we can derive the flags from dma_data_direction.

In __iommu_create_mapping we should treat the memory like
DMA_BIDIRECTIONAL and pass both IOMMU_READ and IOMMU_WRITE to
iommu_map.
__iommu_create_mapping is used during dma_alloc_coherent (via
arm_iommu_alloc_attrs).  AFAIK dma_alloc_coherent is responsible for
allocation _and_ mapping.  I think this implies that access to the
mapped pages should be allowed.

Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Andreas Herrmann <andreas.herrmann@calxeda.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

No differences found