From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Nazarewicz Date: Thu, 12 Jun 2014 10:02:38 +0000 Subject: Re: [PATCH v2 04/10] DMA, CMA: support alignment constraint on cma region Message-Id: List-Id: References: <1402543307-29800-1-git-send-email-iamjoonsoo.kim@lge.com> <1402543307-29800-5-git-send-email-iamjoonsoo.kim@lge.com> In-Reply-To: <1402543307-29800-5-git-send-email-iamjoonsoo.kim@lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit 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, Joonsoo Kim 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 “must be power of 2 or zero”. > * @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 = &cma_areas[cma_area_count]; > - phys_addr_t alignment; > int ret = 0; > > - 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); > > /* Sanity checks */ > if (cma_area_count = ARRAY_SIZE(cma_areas)) { -- Best regards, _ _ .o. | Liege of Serenely Enlightened Majesty of o' \,=./ `o ..o | Computer Science, Michał “mina86” Nazarewicz (o o) ooo +------ooO--(_)--Ooo-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-x235.google.com (mail-wi0-x235.google.com [IPv6:2a00:1450:400c:c05::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 26CC11A03CB for ; Thu, 12 Jun 2014 20:02:46 +1000 (EST) Received: by mail-wi0-f181.google.com with SMTP id n3so2645154wiv.14 for ; Thu, 12 Jun 2014 03:02:42 -0700 (PDT) Sender: Michal Nazarewicz From: Michal Nazarewicz To: Joonsoo Kim , Andrew Morton , "Aneesh Kumar K.V" , Marek Szyprowski 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 Cc: Russell King - ARM Linux , kvm@vger.kernel.org, linux-mm@kvack.org, Gleb Natapov , Greg Kroah-Hartman , Alexander Graf , kvm-ppc@vger.kernel.org, linux-kernel@vger.kernel.org, Minchan Kim , Paul Mackerras , Paolo Bonzini , Joonsoo Kim , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: mina86@mina86.com (Michal Nazarewicz) Date: Thu, 12 Jun 2014 12:02:38 +0200 Subject: [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> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.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 ?must be power of 2 or zero?. > * @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 = &cma_areas[cma_area_count]; > - phys_addr_t alignment; > int ret = 0; > > - 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); > > /* Sanity checks */ > if (cma_area_count == ARRAY_SIZE(cma_areas)) { -- Best regards, _ _ .o. | Liege of Serenely Enlightened Majesty of o' \,=./ `o ..o | Computer Science, Micha? ?mina86? Nazarewicz (o o) ooo +------ooO--(_)--Ooo-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Nazarewicz Subject: Re: [PATCH v2 04/10] DMA, CMA: support alignment constraint on cma region Date: Thu, 12 Jun 2014 12:02:38 +0200 Message-ID: References: <1402543307-29800-1-git-send-email-iamjoonsoo.kim@lge.com> <1402543307-29800-5-git-send-email-iamjoonsoo.kim@lge.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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, Joonsoo Kim To: Joonsoo Kim , Andrew Morton , "Aneesh Kumar K.V" , Marek Szyprowski Return-path: In-Reply-To: <1402543307-29800-5-git-send-email-iamjoonsoo.kim@lge.com> Sender: owner-linux-mm@kvack.org List-Id: kvm.vger.kernel.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 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933062AbaFLKCq (ORCPT ); Thu, 12 Jun 2014 06:02:46 -0400 Received: from mail-we0-f180.google.com ([74.125.82.180]:65170 "EHLO mail-we0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932885AbaFLKCn convert rfc822-to-8bit (ORCPT ); Thu, 12 Jun 2014 06:02:43 -0400 From: Michal Nazarewicz 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, Joonsoo Kim 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> Organization: http://mina86.com/ References: <1402543307-29800-1-git-send-email-iamjoonsoo.kim@lge.com> <1402543307-29800-5-git-send-email-iamjoonsoo.kim@lge.com> User-Agent: Notmuch/0.17+15~gb65ca8e (http://notmuchmail.org) Emacs/24.4.50.1 (x86_64-unknown-linux-gnu) X-Face: PbkBB1w#)bOqd`iCe"Ds{e+!C7`pkC9a|f)Qo^BMQvy\q5x3?vDQJeN(DS?|-^$uMti[3D*#^_Ts"pU$jBQLq~Ud6iNwAw_r_o_4]|JO?]}P_}Nc&"p#D(ZgUb4uCNPe7~a[DbPG0T~!&c.y$Ur,=N4RT>]dNpd;KFrfMCylc}gc??'U2j,!8%xdD Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJFBMVEWbfGlUPDDHgE57V0jUupKjgIObY0PLrom9mH4dFRK4gmjPs41MxjOgAAACQElEQVQ4jW3TMWvbQBQHcBk1xE6WyALX1069oZBMlq+ouUwpEQQ6uRjttkWP4CmBgGM0BQLBdPFZYPsyFUo6uEtKDQ7oy/U96XR2Ux8ehH/89Z6enqxBcS7Lg81jmSuujrfCZcLI/TYYvbGj+jbgFpHJ/bqQAUISj8iLyu4LuFHJTosxsucO4jSDNE0Hq3hwK/ceQ5sx97b8LcUDsILfk+ovHkOIsMbBfg43VuQ5Ln9YAGCkUdKJoXR9EclFBhixy3EGVz1K6eEkhxCAkeMMnqoAhAKwhoUJkDrCqvbecaYINlFKSRS1i12VKH1XpUd4qxL876EkMcDvHj3s5RBajHHMlA5iK32e0C7VgG0RlzFPvoYHZLRmAC0BmNcBruhkE0KsMsbEc62ZwUJDxWUdMsMhVqovoT96i/DnX/ASvz/6hbCabELLk/6FF/8PNpPCGqcZTGFcBhhAaZZDbQPaAB3+KrWWy2XgbYDNIinkdWAFcCpraDE/knwe5DBqGmgzESl1p2E4MWAz0VUPgYYzmfWb9yS4vCvgsxJriNTHoIBz5YteBvg+VGISQWUqhMiByPIPpygeDBE6elD973xWwKkEiHZAHKjhuPsFnBuArrzxtakRcISv+XMIPl4aGBUJm8Emk7qBYU8IlgNEIpiJhk/No24jHwkKTFHDWfPniR4iw5vJaw2nzSjfq2zffcE/GDjRC2dn0J0XwPAbDL84TvaFCJEU4Oml9pRyEUhR3Cl2t01AoEjRbs0sYugp14/4X5n4pU4EHHnMAAAAAElFTkSuQmCC X-PGP: 50751FF4 X-PGP-FP: AC1F 5F5C D418 88F8 CC84 5858 2060 4012 5075 1FF4 X-Hashcash: 1:20:140612:linux-kernel@vger.kernel.org::u4db67u3fs8DOLTY:0000000000000000000000000000000000KeC X-Hashcash: 1:20:140612:kvm-ppc@vger.kernel.org::DXNN9m6LibNmyV7c:000000000000000000000000000000000000001AwV X-Hashcash: 1:20:140612:paulus@samba.org::YgOR88nMCQmDAFJA:01BaI X-Hashcash: 1:20:140612:agraf@suse.de::iutFH72jnWSyS+cs:00001VRe X-Hashcash: 1:20:140612:iamjoonsoo.kim@lge.com::Ov4zc27ld0WTz5vB:0000000000000000000000000000000000000001CYw X-Hashcash: 1:20:140612:linux-arm-kernel@lists.infradead.org::t8fy0C2igwIH30kJ:00000000000000000000000001Wsa X-Hashcash: 1:20:140612:minchan@kernel.org::jGURMyBc4jxNhQmt:00000000000000000000000000000000000000000001nMi X-Hashcash: 1:20:140612:akpm@linux-foundation.org::QW5VdIUQupic6M2h:0000000000000000000000000000000000001q5e X-Hashcash: 1:20:140612:m.szyprowski@samsung.com::2tODIWEPA2L1qqz4:00000000000000000000000000000000000001fUR X-Hashcash: 1:20:140612:pbonzini@redhat.com::bM07xPGCA3sF4osE:0000000000000000000000000000000000000000004lCm X-Hashcash: 1:20:140612:benh@kernel.crashing.org::apVufpm+S7QNNtcL:000000000000000000000000000000000000056B+ X-Hashcash: 1:20:140612:linux@arm.linux.org.uk::v8iN6u/whHVmfrhl:00000000000000000000000000000000000000057iw X-Hashcash: 1:20:140612:linuxppc-dev@lists.ozlabs.org::lC1jgdOtuuoqpObA:000000000000000000000000000000004gXz X-Hashcash: 1:20:140612:gregkh@linuxfoundation.org::VWWe2V6g23aoz4fK:000000000000000000000000000000000006QP6 X-Hashcash: 1:20:140612:linux-mm@kvack.org::yW7b2v7cmdlRwDeB:00000000000000000000000000000000000000000005zLx X-Hashcash: 1:20:140612:aneesh.kumar@linux.vnet.ibm.com::4Ix0hZHb+KPq/1JN:0000000000000000000000000000006ELM X-Hashcash: 1:20:140612:iamjoonsoo.kim@lge.com::SjxyKidsi+B8VFYt:0000000000000000000000000000000000000007CyE X-Hashcash: 1:20:140612:kvm@vger.kernel.org::XR53/s4aw6utKivT:0000000000000000000000000000000000000000007zQU X-Hashcash: 1:20:140612:gleb@kernel.org::xyj7qvhRY5I0zycz:00DTEm 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: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 “must be power of 2 or zero”. > * @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 = &cma_areas[cma_area_count]; > - phys_addr_t alignment; > int ret = 0; > > - 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); > > /* Sanity checks */ > if (cma_area_count == ARRAY_SIZE(cma_areas)) { -- Best regards, _ _ .o. | Liege of Serenely Enlightened Majesty of o' \,=./ `o ..o | Computer Science, Michał “mina86” Nazarewicz (o o) ooo +------ooO--(_)--Ooo--