From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932361AbbHGPlN (ORCPT ); Fri, 7 Aug 2015 11:41:13 -0400 Received: from mga03.intel.com ([134.134.136.65]:17266 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932077AbbHGPlL (ORCPT ); Fri, 7 Aug 2015 11:41:11 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,630,1432623600"; d="scan'208";a="621241383" Date: Fri, 7 Aug 2015 23:50:04 +0800 From: Feng Tang To: Michal Nazarewicz Cc: Greg Kroah-Hartman , John Stultz , Andrew Morton , Kyungmin Park , Marek Szyprowski , Joonsoo Kim , LKML Subject: Re: [PATCH v2] staging: ion: Add a default struct device for cma heap Message-ID: <20150807155004.GA22612@shbuild888> References: <1438919413-14440-1-git-send-email-feng.tang@intel.com> <20150807045404.GA26925@kroah.com> <20150807064601.GA9338@shbuild888> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 07, 2015 at 04:48:28PM +0200, Michal Nazarewicz wrote: > On Fri, Aug 07 2015, Feng Tang wrote: > > As I described above, the dummy struct device is only needed for > > dma request, its lifetime is align with the cma_heap itself. > > Again, this is from perspective of someone who is unfamiliar with ION, > but perhaps a viable solution is to bypass DMA API and just call > cma_alloc directly? For ion cma heap, the buffer allocation func ion_cma_allocate() will call dma_alloc_coherent(dev, ...). And dma_alloc_coherent() is implemented by each architeture(arm/m68k/x86 etc), and many Arch's implementation doesn't use cma, but use alloc_pages() like APIs. So I'm afraid we can't direcly call cma_alloc directly here. Thanks, Feng