From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ig0-f198.google.com (mail-ig0-f198.google.com [209.85.213.198]) by kanga.kvack.org (Postfix) with ESMTP id CCE826B0005 for ; Mon, 6 Jun 2016 22:16:58 -0400 (EDT) Received: by mail-ig0-f198.google.com with SMTP id q18so131410228igr.2 for ; Mon, 06 Jun 2016 19:16:58 -0700 (PDT) Received: from mailout3.samsung.com (mailout3.samsung.com. [203.254.224.33]) by mx.google.com with ESMTPS id p15si19862619iod.80.2016.06.06.19.16.57 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 06 Jun 2016 19:16:58 -0700 (PDT) Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O8D010IYQC8H540@mailout3.samsung.com> for linux-mm@kvack.org; Tue, 07 Jun 2016 11:16:56 +0900 (KST) From: Jaewon Kim Subject: Re: Re: [RESEND][PATCH] drivers: of: of_reserved_mem: fixup the CMA alignment not to affect dma-coherent Message-id: <57562EA9.3030201@samsung.com> Date: Tue, 07 Jun 2016 11:17:13 +0900 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: robh+dt@kernel.org, m.szyprowski@samsung.com Cc: r64343@freescale.com, grant.likely@linaro.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, jaewon31.kim@gmail.com >> From: Jaewon >> >> There was an alignment mismatch issue for CMA and it was fixed by >> commit 1cc8e3458b51 ("drivers: of: of_reserved_mem: fixup the alignment with CMA setup"). >> However the way of the commit considers not only dma-contiguous(CMA) but also >> dma-coherent which has no that requirement. >> >> This patch checks more to distinguish dma-contiguous(CMA) from dma-coherent. >> >> Signed-off-by: Jaewon Kim >> --- >> drivers/of/of_reserved_mem.c | 5 ++++- >> 1 file changed, 4 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c >> index ed01c01..45b873e 100644 >> --- a/drivers/of/of_reserved_mem.c >> +++ b/drivers/of/of_reserved_mem.c >> @@ -127,7 +127,10 @@ static int __init __reserved_mem_alloc_size(unsigned long node, >> } >> >> /* Need adjust the alignment to satisfy the CMA requirement */ >> - if (IS_ENABLED(CONFIG_CMA) && of_flat_dt_is_compatible(node, "shared-dma-pool")) >> + if (IS_ENABLED(CONFIG_CMA) >> + && of_flat_dt_is_compatible(node, "shared-dma-pool") >> + && of_get_flat_dt_prop(node, "reusable", NULL) >> + && !of_get_flat_dt_prop(node, "no-map", NULL)) { > >This won't actually compile as you add a bracket here, but no closing bracket... > >I've fixed up and applied. Thank you very much for your correction. I might add debug code with the bracket. Please let me know if any issue in submitting this patch > >> align = max(align, (phys_addr_t)PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order)); >> >> prop = of_get_flat_dt_prop(node, "alloc-ranges", &len); >> -- >> 1.9.1 >> -- 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 S1752367AbcFGCRA (ORCPT ); Mon, 6 Jun 2016 22:17:00 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:51469 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750886AbcFGCQ6 (ORCPT ); Mon, 6 Jun 2016 22:16:58 -0400 X-AuditID: cbfee68d-f79646d000001386-63-57562e98010f From: Jaewon Kim Subject: Re: Re: [RESEND][PATCH] drivers: of: of_reserved_mem: fixup the CMA alignment not to affect dma-coherent To: robh+dt@kernel.org, m.szyprowski@samsung.com Cc: r64343@freescale.com, grant.likely@linaro.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, jaewon31.kim@gmail.com Message-id: <57562EA9.3030201@samsung.com> Date: Tue, 07 Jun 2016 11:17:13 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprMIsWRmVeSWpSXmKPExsVy+t8zbd0ZemHhBlPf8lgc+LOD0aJ780xG i8u75rBZ3Fvzn9Vi7ZG77BZvTh9msmjde4Tdgd3j3+F+Jo+ds+6ye2xa1cnmsenTJHaPO9f2 sHn0bVnF6PF5k1wAexSXTUpqTmZZapG+XQJXxqsH+xkLbvNWLL79mK2B8R9XFyMnh4SAicSC 1mtsELaYxIV764FsLg4hgZWMEpdXnmKFKXr34xsrRGIpo8Tzm4sYIZyHQM7BLywgVWwC2hLv F0wC6xAWKJaYc62VGcQWETCQWNdwlgnEZhaolThy4RwjiM0roCUxaXc/mM0ioCrx7sIXMFtU IEJi9bprzBA1ghI/Jt8Dms8B1KsuMWVKLsQYeYnNa94yQxx3jF2i87wWxBgBiW+TD4GVSwjI Smw6AFUiKXFwxQ2WCYwis5AMnYUwdBaSoQsYmVcxiqYWJBcUJ6UXGeoVJ+YWl+al6yXn525i hMRV7w7G2wesDzEKcDAq8fDu+BIaLsSaWFZcmXuI0RToiInMUqLJ+cDozSuJNzQ2M7IwNTE1 NjK3NFMS51WU+hksJJCeWJKanZpakFoUX1Sak1p8iJGJg1OqgXFhIudM8cfPDqcds1VcOlNO 41G3mvGEg/oORbGnxJn2TO5VWbUt/G/d5IAstbmfXja93PmU02JT4P6uICVFt/ag/d7Tqx/n qoWlac9tev2lav7mda2Ct7Z57avcO0d/lpjqNV+jZYlPsp61+u+XEvzJyKazZ9m5Ly3Nxkef HTu+p7Yyg1Hqt4ASS3FGoqEWc1FxIgAvb5x4pgIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrIIsWRmVeSWpSXmKPExsVy+t9jAd0ZemHhBpuOcFgc+LOD0aJ780xG i8u75rBZ3Fvzn9Vi7ZG77BZvTh9msmjde4Tdgd3j3+F+Jo+ds+6ye2xa1cnmsenTJHaPO9f2 sHn0bVnF6PF5k1wAe1QDo01GamJKapFCal5yfkpmXrqtkndwvHO8qZmBoa6hpYW5kkJeYm6q rZKLT4CuW2YO0EVKCmWJOaVAoYDE4mIlfTtME0JD3HQtYBojdH1DguB6jAzQQMI6xoxXD/Yz FtzmrVh8+zFbA+M/ri5GTg4JAROJdz++sULYYhIX7q1n62Lk4hASWMoo8fzmIkYI5yGQc/AL C0gVm4C2xPsFk8A6hAWKJeZca2UGsUUEDCTWNZxlArGZBWoljlw4xwhi8wpoSUza3Q9mswio Sry78AXMFhWIkFi97hozRI2gxI/J94DmcwD1qktMmZILMUZeYvOat8wTGPlmIamahVA1C0nV AkbmVYwSqQXJBcVJ6bmGeanlesWJucWleel6yfm5mxjB0ftMagfjwV3uhxgFOBiVeHh3fAkN F2JNLCuuzD3EKMHBrCTCu18zLFyINyWxsiq1KD++qDQntfgQoynQ6ROZpUST84GJJa8k3tDY xMzI0sjM2MTc2FhJnPfx/3VhQgLpiSWp2ampBalFMH1MHJxSDYxLlPJv+jWePvZv+jOXJf2S WrcPrZK9WFd5SqbP87Eh7+TtFUzHu7/FTQhZL/HBfs9ZFVWfFy1P/qiVvkleundHBnfCrSnP F/594dqlZ3w+VPvy8ild37c/K6m0zltvtrSofNY1ttD6led3X3kSWMaSFjr9zYcbZmdOpka/ krn/7DDjvONOklOfK7EUZyQaajEXFScCAH0JkiL0AgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> From: Jaewon >> >> There was an alignment mismatch issue for CMA and it was fixed by >> commit 1cc8e3458b51 ("drivers: of: of_reserved_mem: fixup the alignment with CMA setup"). >> However the way of the commit considers not only dma-contiguous(CMA) but also >> dma-coherent which has no that requirement. >> >> This patch checks more to distinguish dma-contiguous(CMA) from dma-coherent. >> >> Signed-off-by: Jaewon Kim >> --- >> drivers/of/of_reserved_mem.c | 5 ++++- >> 1 file changed, 4 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c >> index ed01c01..45b873e 100644 >> --- a/drivers/of/of_reserved_mem.c >> +++ b/drivers/of/of_reserved_mem.c >> @@ -127,7 +127,10 @@ static int __init __reserved_mem_alloc_size(unsigned long node, >> } >> >> /* Need adjust the alignment to satisfy the CMA requirement */ >> - if (IS_ENABLED(CONFIG_CMA) && of_flat_dt_is_compatible(node, "shared-dma-pool")) >> + if (IS_ENABLED(CONFIG_CMA) >> + && of_flat_dt_is_compatible(node, "shared-dma-pool") >> + && of_get_flat_dt_prop(node, "reusable", NULL) >> + && !of_get_flat_dt_prop(node, "no-map", NULL)) { > >This won't actually compile as you add a bracket here, but no closing bracket... > >I've fixed up and applied. Thank you very much for your correction. I might add debug code with the bracket. Please let me know if any issue in submitting this patch > >> align = max(align, (phys_addr_t)PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order)); >> >> prop = of_get_flat_dt_prop(node, "alloc-ranges", &len); >> -- >> 1.9.1 >>