[PATCH v2] arm64: dma-mapping: Fix dma_mapping_error() when bypassing SWIOTLB
Michael Zoran
mzoran at crowfest.net
Wed Jan 25 11:31:08 PST 2017
On Wed, 2017-01-25 at 19:14 +0000, Robin Murphy wrote:
> [ +Michael - FYI this is straight on top of 4.10-rc5 ]
>
> On 25/01/17 18:31, Robin Murphy wrote:
> > 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 at vger.kernel.org
> > CC: Jisheng Zhang <jszhang at marvell.com>
> > Reported-by: Aaro Koskinen <aaro.koskinen at iki.fi>
> > Signed-off-by: Robin Murphy <robin.murphy at arm.com>
> > ---
> >
> > v2: Get the return value the right way round this time... After
> > some
> > careful reasoning it really is that simple.
> >
> > arch/arm64/mm/dma-mapping.c | 9 ++++++++-
> > 1 file changed, 8 insertions(+), 1 deletion(-)
> >
I was able to build it and it works. Cool.
More information about the linux-arm-kernel
mailing list