From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f45.google.com (mail-wg0-f45.google.com [74.125.82.45]) by kanga.kvack.org (Postfix) with ESMTP id 1A7ED6B00DB for ; Thu, 12 Jun 2014 06:02:44 -0400 (EDT) Received: by mail-wg0-f45.google.com with SMTP id l18so1002550wgh.16 for ; Thu, 12 Jun 2014 03:02:43 -0700 (PDT) Received: from mail-we0-x22a.google.com (mail-we0-x22a.google.com [2a00:1450:400c:c03::22a]) by mx.google.com with ESMTPS id dl5si26154157wib.12.2014.06.12.03.02.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 12 Jun 2014 03:02:42 -0700 (PDT) Received: by mail-we0-f170.google.com with SMTP id w61so1012116wes.29 for ; Thu, 12 Jun 2014 03:02:42 -0700 (PDT) From: Michal Nazarewicz Subject: Re: [PATCH v2 04/10] DMA, CMA: support alignment constraint on cma region In-Reply-To: <1402543307-29800-5-git-send-email-iamjoonsoo.kim@lge.com> References: <1402543307-29800-1-git-send-email-iamjoonsoo.kim@lge.com> <1402543307-29800-5-git-send-email-iamjoonsoo.kim@lge.com> Date: Thu, 12 Jun 2014 12:02:38 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Sender: owner-linux-mm@kvack.org List-ID: To: Joonsoo Kim , Andrew Morton , "Aneesh Kumar K.V" , Marek Szyprowski Cc: Minchan Kim , Russell King - ARM Linux , Greg Kroah-Hartman , Paolo Bonzini , Gleb Natapov , Alexander Graf , Benjamin Herrenschmidt , Paul Mackerras , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org On Thu, Jun 12 2014, Joonsoo Kim wrote: > ppc kvm's cma area management needs alignment constraint on I've noticed it earlier and cannot seem to get to terms with this. It should IMO be PPC, KVM and CMA since those are acronyms. But if you have strong feelings, it's not a big issue. > cma region. So support it to prepare generalization of cma area > management functionality. > > Additionally, add some comments which tell us why alignment > constraint is needed on cma region. > > Signed-off-by: Joonsoo Kim Acked-by: Michal Nazarewicz > diff --git a/drivers/base/dma-contiguous.c b/drivers/base/dma-contiguous.c > index 8a44c82..bc4c171 100644 > --- a/drivers/base/dma-contiguous.c > +++ b/drivers/base/dma-contiguous.c > @@ -219,6 +220,7 @@ core_initcall(cma_init_reserved_areas); > * @size: Size of the reserved area (in bytes), > * @base: Base address of the reserved area optional, use 0 for any > * @limit: End address of the reserved memory (optional, 0 for any). > + * @alignment: Alignment for the contiguous memory area, should be > power of 2 =E2=80=9Cmust be power of 2 or zero=E2=80=9D. > * @res_cma: Pointer to store the created cma region. > * @fixed: hint about where to place the reserved area > * > @@ -233,15 +235,15 @@ core_initcall(cma_init_reserved_areas); > */ > static int __init __dma_contiguous_reserve_area(phys_addr_t size, > phys_addr_t base, phys_addr_t limit, > + phys_addr_t alignment, > struct cma **res_cma, bool fixed) > { > struct cma *cma =3D &cma_areas[cma_area_count]; > - phys_addr_t alignment; > int ret =3D 0; >=20=20 > - pr_debug("%s(size %lx, base %08lx, limit %08lx)\n", __func__, > - (unsigned long)size, (unsigned long)base, > - (unsigned long)limit); > + pr_debug("%s(size %lx, base %08lx, limit %08lx align_order %08lx)\n", > + __func__, (unsigned long)size, (unsigned long)base, > + (unsigned long)limit, (unsigned long)alignment); Nit: Align with the rest of the arguments, i.e.: + pr_debug("%s(size %lx, base %08lx, limit %08lx align_order %08lx)\n", + __func__, (unsigned long)size, (unsigned long)base, + (unsigned long)limit, (unsigned long)alignment); >=20=20 > /* Sanity checks */ > if (cma_area_count =3D=3D ARRAY_SIZE(cma_areas)) { --=20 Best regards, _ _ .o. | Liege of Serenely Enlightened Majesty of o' \,=3D./ `o ..o | Computer Science, Micha=C5=82 =E2=80=9Cmina86=E2=80=9D Nazarewicz = (o o) ooo +------ooO--(_)--Ooo-- -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org