From mboxrd@z Thu Jan 1 00:00:00 1970 From: will.deacon@arm.com (Will Deacon) Date: Fri, 27 Sep 2013 09:35:24 +0100 Subject: [PATCH 3/9] ARM: dma-mapping: Always pass proper prot flags to iommu_map() In-Reply-To: <1380234982-1677-4-git-send-email-andreas.herrmann@calxeda.com> References: <1380234982-1677-1-git-send-email-andreas.herrmann@calxeda.com> <1380234982-1677-4-git-send-email-andreas.herrmann@calxeda.com> Message-ID: <20130927083523.GA8319@mudshark.cambridge.arm.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Thu, Sep 26, 2013 at 11:36:15PM +0100, Andreas Herrmann wrote: > ... 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 > Signed-off-by: Andreas Herrmann Acked-by: Will Deacon This one should go via the dma-mapping tree. Will