Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755115AbbGCL1w (ORCPT ); Fri, 3 Jul 2015 07:27:52 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:36660 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755036AbbGCL1n (ORCPT ); Fri, 3 Jul 2015 07:27:43 -0400 MIME-Version: 1.0 In-Reply-To: <20150703090305.GR7557@n2100.arm.linux.org.uk> References: <1435699746-21395-1-git-send-email-lorenx4@gmail.com> <20150701111251.GA21981@e104818-lin.cambridge.arm.com> <20150703090305.GR7557@n2100.arm.linux.org.uk> Date: Fri, 3 Jul 2015 13:27:42 +0200 Message-ID: Subject: Re: [PATCH v5] arm DMA: Fix allocation from CMA for coherent DMA From: Lorenzo Nava To: Russell King - ARM Linux Cc: Catalin Marinas , Arnd Bergmann , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1897 Lines: 43 On Fri, Jul 3, 2015 at 11:03 AM, Russell King - ARM Linux wrote: > On Wed, Jul 01, 2015 at 12:12:51PM +0100, Catalin Marinas wrote: >> On Tue, Jun 30, 2015 at 11:29:06PM +0200, Lorenzo Nava wrote: >> > This patch allows the use of CMA for DMA coherent memory allocation. >> > At the moment if the input parameter "is_coherent" is set to true >> > the allocation is not made using the CMA, which I think is not the >> > desired behaviour. >> > >> > Signed-off-by: Lorenzo Nava >> > Reviewed-by: Catalin Marinas >> >> If Russell doesn't have any objections, you can send the patch to >> his patch system. See here for more information: > > I'm left wondering whether this patch is really want Lorenzo wants. > From my reading of it, while this has the effect of allocating from > CMA for coherent devices, it's no different from the non-coherent > case, because by calling __alloc_from_contiguous(), we end up > remapping the allocated memory, removing the cacheability status > from the allocated pages. > > This brings up an interesting point: presumably, it's been tested, and > people are happy with the performance it's giving, inspite of it not > returning cacheable memory... or maybe it hasn't been tested that much? > As Catalin correctly pointed out, I always consider that this patch: https://lkml.org/lkml/2015/5/7/512 has been applied. The memory returned by mmap is then cacheable and preserve the attributes used during allocation. Of course, without that patch, mine is not working at all. (Sorry for the previous mail which has been sent accidentally). Lorenzo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/