lkml.org 
[lkml]   [2018]   [Nov]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] MIPS: Fix `dma_alloc_coherent' returning a non-coherent allocation
Date
Hi Maciej,

On Thu, Nov 01, 2018 at 07:54:24AM +0000, Maciej W. Rozycki wrote:
> Fix a MIPS `dma_alloc_coherent' regression from commit bc3ec75de545
> ("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: Maciej W. Rozycki <macro@linux-mips.org>
> Fixes: bc3ec75de545 ("dma-mapping: merge direct and noncoherent ops")
> Cc: stable@vger.kernel.org # 4.19+
> ---
> arch/mips/mm/dma-noncoherent.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Thanks, nice catch! Applied to mips-fixes.

Paul

\
 
 \ /
  Last update: 2018-11-05 19:11    [W:0.133 / U:8.788 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site