]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.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)
committerTim Gardner <tim.gardner@canonical.com>
Mon, 13 Mar 2017 21:20:54 +0000 (15:20 -0600)
commitf0c6fc65265722ccf373faf64f3c70f7ce88efa8
treeb1172e67f232cd8a70024e4558e6efe911bc7d9a
parentd2c01f929996f6b9462c457cabde878fad065859
arm64: dma-mapping: Fix dma_mapping_error() when bypassing SWIOTLB

BugLink: http://bugs.launchpad.net/bugs/1672544
commit adbe7e26f4257f72817495b9bce114284060b0d7 upstream.

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: 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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
arch/arm64/mm/dma-mapping.c