From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751390AbdCQT7j (ORCPT ); Fri, 17 Mar 2017 15:59:39 -0400 Received: from mail-qk0-f181.google.com ([209.85.220.181]:33711 "EHLO mail-qk0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751101AbdCQT7h (ORCPT ); Fri, 17 Mar 2017 15:59:37 -0400 Subject: Re: [RFC PATCH 08/12] cma: Store a name in the cma structure To: Sumit Semwal References: <1488491084-17252-1-git-send-email-labbott@redhat.com> <1488491084-17252-9-git-send-email-labbott@redhat.com> Cc: Riley Andrews , =?UTF-8?B?QXJ2ZSBIau+/vW5uZXY=?= =?UTF-8?B?77+9Zw==?= , Rom Lemarchand , devel@driverdev.osuosl.org, LKML , Linaro MM SIG , Greg Kroah-Hartman , "linux-arm-kernel@lists.infradead.org" , "linux-media@vger.kernel.org" , DRI mailing list , Brian Starkey , Daniel Vetter , Mark Brown , Benjamin Gaignard , "linux-mm@kvack.org" From: Laura Abbott Message-ID: <7c750fb1-d019-03c1-a682-3bc04c6730ac@redhat.com> Date: Fri, 17 Mar 2017 11:02:34 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/10/2017 12:53 AM, Sumit Semwal wrote: > Hi Laura, > > Thanks for the patch. > > On 3 March 2017 at 03:14, Laura Abbott wrote: >> >> Frameworks that may want to enumerate CMA heaps (e.g. Ion) will find it >> useful to have an explicit name attached to each region. Store the name >> in each CMA structure. >> >> Signed-off-by: Laura Abbott >> --- >> drivers/base/dma-contiguous.c | 5 +++-- >> include/linux/cma.h | 4 +++- >> mm/cma.c | 11 +++++++++-- >> mm/cma.h | 1 + >> mm/cma_debug.c | 2 +- >> 5 files changed, 17 insertions(+), 6 deletions(-) >> > >> +const char *cma_get_name(const struct cma *cma) >> +{ >> + return cma->name ? cma->name : "(undefined)"; >> +} >> + > Would it make sense to perhaps have the idx stored as the name, > instead of 'undefined'? That would make sure that the various cma > names are still unique. > Good suggestion. I'll see about cleaning that up. >> static unsigned long cma_bitmap_aligned_mask(const struct cma *cma, >> int align_order) >> { >> @@ -168,6 +173,7 @@ core_initcall(cma_init_reserved_areas); >> */ >> int __init cma_init_reserved_mem(phys_addr_t base, phys_addr_t size, >> unsigned int order_per_bit, >> + const char *name, >> struct cma **res_cma) >> { > > Best regards, > Sumit. >