]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
arm64: dma-mapping: Fix dma_mapping_error() when bypassing SWIOTLB
authorRobin Murphy <robin.murphy@arm.com>
Wed, 25 Jan 2017 18:31:31 +0000 (18:31 +0000)
committerWill Deacon <will.deacon@arm.com>
Thu, 26 Jan 2017 12:25:14 +0000 (12:25 +0000)
commitadbe7e26f4257f72817495b9bce114284060b0d7
tree0cd0d2d34090578eaa7b75b97c83e5386bb599cf
parent2e449048a25eb75d48dff12882b93f26d130a1c6
arm64: dma-mapping: Fix dma_mapping_error() when bypassing SWIOTLB

When bypassing SWIOTLB on small-memory systems, we need to avoid calling
into swiotlb_dma_mapping_error() in exactly the same way as we avoid
swiotlb_dma_supported(), because the former also relies on SWIOTLB state
being initialised.

Under the assumptions for which we skip SWIOTLB, dma_map_{single,page}()
will only ever return the DMA-offset-adjusted physical address of the
page passed in, thus we can report success unconditionally.

Fixes: b67a8b29df7e ("arm64: mm: only initialize swiotlb when necessary")
CC: stable@vger.kernel.org
CC: Jisheng Zhang <jszhang@marvell.com>
Reported-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/mm/dma-mapping.c