From patchwork Fri Mar 8 15:59:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 2239121 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 588C3DF215 for ; Fri, 8 Mar 2013 16:03:53 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UDziS-0007Ts-7K; Fri, 08 Mar 2013 16:00:16 +0000 Received: from mailout2.samsung.com ([203.254.224.25]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UDzi3-0007Ly-Gz for linux-arm-kernel@lists.infradead.org; Fri, 08 Mar 2013 15:59:59 +0000 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MJC0048SN3JIPE0@mailout2.samsung.com> for linux-arm-kernel@lists.infradead.org; Sat, 09 Mar 2013 00:59:43 +0900 (KST) X-AuditID: cbfee61a-b7f7d6d000000f4e-34-513a0aefcca1 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id AB.D4.03918.FEA0A315; Sat, 09 Mar 2013 00:59:43 +0900 (KST) Received: from localhost.localdomain ([106.116.147.30]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MJC00CDGN3CWG30@mmp1.samsung.com> for linux-arm-kernel@lists.infradead.org; Sat, 09 Mar 2013 00:59:43 +0900 (KST) From: Marek Szyprowski To: linux-arm-kernel@lists.infradead.org, linaro-mm-sig@lists.linaro.org Subject: [PATCH] ARM: DMA-mapping: add missing GFP_DMA flag for atomic buffer allocation Date: Fri, 08 Mar 2013 16:59:17 +0100 Message-id: <1362758357-20872-1-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.7.9.5 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrJJMWRmVeSWpSXmKPExsVy+t9jAd33XFaBBrtualtsenyN1YHRY/OS +gDGKC6blNSczLLUIn27BK6Mxh/iBY1cFTdaJ7M1MPZydDFyckgImEhs/vmXGcIWk7hwbz1b FyMXh5DAIkaJnpdHoZwNTBJnzj1jB6liEzCU6HrbxQZiiwh4SDxZcY4ZpIhZ4DejxIZpq8AS wgJREjO75rKA2CwCqhItS66C2bwgDXc6mLoYOYDWKUjMmWQzgZF7ASPDKkbR1ILkguKk9FxD veLE3OLSvHS95PzcTYxgDz6T2sG4ssHiEKMAB6MSD++HP5aBQqyJZcWVuYcYJTiYlUR4b+wB CvGmJFZWpRblxxeV5qQWH2KU5mBREudlPPUkQEggPbEkNTs1tSC1CCbLxMEp1cDoW5O62Guj rZPtkfMW7LbtD/ezb7qTcnT6/MKO2B3TVvNdXbmjtkT0Ocum0Nx7z1VsrOcssJaaFbF9u/Cm r6rsmXt37ihimmfn9sr+N0vYBjfBbdvXLyr6xnxMXWPXGq2Uh+6frlxJ8rm6X/L9wW2fnGxX 3+LqTYuVvRYdMeW9wp+i1WEmO28aKbEUZyQaajEXFScCAPgTZp3cAQAA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130308_105954_088315_6D211164 X-CRM114-Status: GOOD ( 10.91 ) X-Spam-Score: -7.4 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [203.254.224.25 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.6 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 HDRS_LCASE Odd capitalization of message header Cc: Mikael Pettersson , Russell King - ARM Linux , Kyungmin Park , Marek Szyprowski , Imre Kaloz , Krzysztof Halasa X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Atomic pool should always be allocated from DMA zone if such zone is available in the system to avoid issues caused by limited dma mask of any of the devices used for making an atomic allocation. Reported-by: Krzysztof Halasa Signed-off-by: Marek Szyprowski --- arch/arm/mm/dma-mapping.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index c7e3759..e9db6b4 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -342,6 +342,7 @@ static int __init atomic_pool_init(void) { struct dma_pool *pool = &atomic_pool; pgprot_t prot = pgprot_dmacoherent(pgprot_kernel); + gfp_t gfp = GFP_KERNEL | GFP_DMA; unsigned long nr_pages = pool->size >> PAGE_SHIFT; unsigned long *bitmap; struct page *page; @@ -361,8 +362,8 @@ static int __init atomic_pool_init(void) ptr = __alloc_from_contiguous(NULL, pool->size, prot, &page, atomic_pool_init); else - ptr = __alloc_remap_buffer(NULL, pool->size, GFP_KERNEL, prot, - &page, atomic_pool_init); + ptr = __alloc_remap_buffer(NULL, pool->size, gfp, prot, &page, + atomic_pool_init); if (ptr) { int i;