]> git.baikalelectronics.ru Git - kernel.git/commit
arm64/dma-mapping: Fix sizes in __iommu_{alloc,free}_attrs
authorRobin Murphy <robin.murphy@arm.com>
Wed, 4 Nov 2015 13:23:52 +0000 (13:23 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Mon, 16 Nov 2015 10:05:35 +0000 (10:05 +0000)
commit4e1e5484d055996928be3b0f71ba299af9dc915f
treec9077a8f5382b8c535779396e67d44ff30c0f3fb
parent837e0eb1c9d194f0eb3cf87d97b2235de146c9fe
arm64/dma-mapping: Fix sizes in __iommu_{alloc,free}_attrs

The iommu-dma layer does its own size-alignment for coherent DMA
allocations based on IOMMU page sizes, but we still need to consider
CPU page sizes for the cases where a non-cacheable CPU mapping is
created. Whilst everything on the alloc/map path seems to implicitly
align things enough to make it work, some functions used by the
corresponding unmap/free path do not, which leads to problems freeing
odd-sized allocations. Either way it's something we really should be
handling explicitly, so do that to make both paths suitably robust.

Reported-by: Yong Wu <yong.wu@mediatek.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/mm/dma-mapping.c