From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752657AbbHEKhS (ORCPT ); Wed, 5 Aug 2015 06:37:18 -0400 Received: from mga01.intel.com ([192.55.52.88]:49965 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752340AbbHEKhP (ORCPT ); Wed, 5 Aug 2015 06:37:15 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,615,1432623600"; d="scan'208";a="778205762" Date: Wed, 5 Aug 2015 18:46:27 +0800 From: Feng Tang To: Michal Nazarewicz Cc: "linux-kernel@vger.kernel.org" , "m.szyprowski@samsung.com" , "kyungmin.park@samsung.com" , "akpm@linux-foundation.org" , "iamjoonsoo.kim@lge.com" , "john.stultz@linaro.org" Subject: Re: [PATCH] CMA: Don't return a valid cma for non-cma dev Message-ID: <20150805104627.GB27241@shbuild888> References: <1438223828-26140-1-git-send-email-feng.tang@intel.com> <1438311070.4299.1.camel@intel.com> <20150731151816.GA18347@shbuild888> <20150805091917.GA27241@shbuild888> 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.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 05, 2015 at 12:28:03PM +0200, Michal Nazarewicz wrote: > On Wed, Aug 05 2015, Feng Tang wrote: > > that for a system which needs multiple cma heaps (like for security > > reason), they may have to share one struct device *dev, as in > > ion_cma_heap_create() > > If you need several CMA areas to allocate from, create multiple struct > devices. Yes, that's my thought too. The normal cma case for SOCs are one platform device is created in drivers/staging/android/ion/xxx_ion.c, then that device's pointer will be transferred into ion_cma_heap_create() inside of the struct ion_platform_heap data. And it's not easy to create multiple platform devices. And it may be better to give each cma_heap one dedicated device in struct ion_cma_heap which could be used as a parameter for dma_alloc_from_contigous() --> cma_alloc() Thanks, Feng > -- > Best regards, _ _ > .o. | Liege of Serenely Enlightened Majesty of o' \,=./ `o > ..o | Computer Science, Michał “mina86” Nazarewicz (o o) > ooo +------ooO--(_)--Ooo--