From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754238AbcBWPaP (ORCPT ); Tue, 23 Feb 2016 10:30:15 -0500 Received: from mail-lf0-f49.google.com ([209.85.215.49]:34217 "EHLO mail-lf0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751544AbcBWPaJ (ORCPT ); Tue, 23 Feb 2016 10:30:09 -0500 Date: Tue, 23 Feb 2016 16:30:03 +0100 From: Rabin Vincent To: Michal Nazarewicz Cc: Rabin Vincent , linux@arm.linux.org.uk, akpm@linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] ARM: dma-mapping: fix alloc/free for coherent + CMA + gfp=0 Message-ID: <20160223153003.GB22447@lnxrabinv.se.axis.com> References: <1455869524-13874-1-git-send-email-rabin.vincent@axis.com> <1455869524-13874-2-git-send-email-rabin.vincent@axis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 19, 2016 at 02:50:52PM +0100, Michal Nazarewicz wrote: > I haven’t looked closely at the code, but why not: > > struct cma *cma = > if (!cma_release(dev_get_cma_area(dev), page, size >> PAGE_SHIFT)) { > // ... do whatever other non-CMA free > } The page tables changes need to be done before we release the area with cma_release(). With the v2 patchset which I've sent to LAKML we won't need a new in_cma() function since we'll now record how we allocated the buffer and use this information in the free routine.