Skip to content
Unverified Commit d01501f8 authored by Maciej W. Rozycki's avatar Maciej W. Rozycki Committed by Paul Burton
Browse files

MIPS: Fix `dma_alloc_coherent' returning a non-coherent allocation



Fix a MIPS `dma_alloc_coherent' regression from commit bc3ec75d
("dma-mapping: merge direct and noncoherent ops") that causes a cached
allocation to be returned on noncoherent cache systems.

This is due to an inverted check now used in the MIPS implementation of
`arch_dma_alloc' on the result from `dma_direct_alloc_pages' before
doing the cached-to-uncached mapping of the allocation address obtained.
The mapping has to be done for a non-NULL rather than NULL result,
because a NULL result means the allocation has failed.

Invert the check for correct operation then.

Signed-off-by: default avatarMaciej W. Rozycki <macro@linux-mips.org>
Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Fixes: bc3ec75d ("dma-mapping: merge direct and noncoherent ops")
Patchwork: https://patchwork.linux-mips.org/patch/20965/
parent c0fae7e2
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment