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: 15276 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id BF65023E64 for ; Fri, 8 Mar 2013 15:59:55 +0000 (UTC) Received: from mail-ve0-f179.google.com (mail-ve0-f179.google.com [209.85.128.179]) by fiordland.canonical.com (Postfix) with ESMTP id 5DEFEA18524 for ; Fri, 8 Mar 2013 15:59:55 +0000 (UTC) Received: by mail-ve0-f179.google.com with SMTP id da11so1337434veb.24 for ; Fri, 08 Mar 2013 07:59:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-auditid:from:to:date:message-id:x-mailer :x-brightmail-tracker:cc:subject:x-beenthere:x-mailman-version :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:sender:errors-to:x-gm-message-state; bh=JbuGZ0+9YYBOcrI7kcVOmGbix1F4pHKGMtQWcS5CvaI=; b=M33q5HWZ5nVvgKZstS6FcHqncP69XObVdtvsPvhBP1mUFIifQHFlNPuUYCWVuoX6e/ NNBeEskfmZDzZD3D2HPy+clDYZZCDnRVS7QtcNr+IpWv9aXr7dAfJ8DDZnnMcKy7eAyo helbow0QSp++HLCr0lWR/o2OeBZBOhy/xYiAa34YMZfySPwvqs//NCl8Yo1bcQCad5rb J7x23Ki+QHx3C8mwgGXFShtgDsgQr7VhuQi3vfjIgNySLbzn+ox/z9DA4CwxsxVdxhoY QjNDQmgUWP5APEJ7aAlsmlb9WM106Oe1gefMuhp29HAy1uqJwxdIfyxXYKe52aQnJtGz 4oNg== X-Received: by 10.52.177.163 with SMTP id cr3mr952526vdc.94.1362758394736; Fri, 08 Mar 2013 07:59:54 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp2876veb; Fri, 8 Mar 2013 07:59:54 -0800 (PST) X-Received: by 10.205.127.11 with SMTP id gy11mr1109230bkc.54.1362758393482; Fri, 08 Mar 2013 07:59:53 -0800 (PST) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id gs7si2355724bkc.135.2013.03.08.07.59.52; Fri, 08 Mar 2013 07:59:53 -0800 (PST) Received-SPF: neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) client-ip=91.189.95.16; Authentication-Results: mx.google.com; spf=neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) smtp.mail=linaro-mm-sig-bounces@lists.linaro.org Received: from localhost ([127.0.0.1] helo=mombin.canonical.com) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1UDzi0-0005Pp-AC; Fri, 08 Mar 2013 15:59:48 +0000 Received: from mailout3.samsung.com ([203.254.224.33]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1UDzhy-0005Pe-Vz for linaro-mm-sig@lists.linaro.org; Fri, 08 Mar 2013 15:59:47 +0000 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MJC00LU8N3J3A90@mailout3.samsung.com> for linaro-mm-sig@lists.linaro.org; Sat, 09 Mar 2013 00:59:43 +0900 (KST) X-AuditID: cbfee61b-b7fb06d000000f28-b5-513a0aef263d Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 72.99.03880.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 linaro-mm-sig@lists.linaro.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 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+t9jAd33XFaBBi+/6Fh8ufKQyYHR4/a/ x8wBjFFcNimpOZllqUX6dglcGY0/xAsauSputE5ma2Ds5ehi5OCQEDCRWHjeo4uRE8gUk7hw bz1bFyMXh5DAIkaJGyfPMUI4q5gkDrfOYwWpYhMwlOh628UGYosIeEg8WXGOGaSIWeA3o8SG aavAEsICURIzu+aygNgsAqoSLUuugtm8IA13OpggNitIzJlkM4GRewEjwypG0dSC5ILipPRc I73ixNzi0rx0veT83E2MYA8+k97BuKrB4hCjAAejEg+vx3/LQCHWxLLiytxDjBIczEoivDf2 AIV4UxIrq1KL8uOLSnNSiw8xSnOwKInzMp56EiAkkJ5YkpqdmlqQWgSTZeLglGpglPCZu/X3 on/FUvtljT6f1o4v1AhQOPP5iGxNCA/fQ8Umm8qip8cz0hRPNrGGndx5ac1H/w7GrLite1Tv flr4JtZu+bGJvFkOzao1bZUZ0WV3NyyqbVh34nVG3A/VlXEhXEtPeN7u3/yoccsPFT3j8Chz 7l9vnvYfe6BQm+/9RODI+u+rhAK+KrEUZyQaajEXFScCABCECRrcAQAA Cc: Mikael Pettersson , Russell King - ARM Linux , Kyungmin Park , Imre Kaloz , Krzysztof Halasa Subject: [Linaro-mm-sig] [PATCH] ARM: DMA-mapping: add missing GFP_DMA flag for atomic buffer allocation X-BeenThere: linaro-mm-sig@lists.linaro.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Unified memory management interest group." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linaro-mm-sig-bounces@lists.linaro.org Errors-To: linaro-mm-sig-bounces@lists.linaro.org X-Gm-Message-State: ALoCoQklqZ4adJJlFiJd24kmnj0/8DtMk/ihYXPl3G6ago/4mcIVJ2Uz3oqct0UTQo0O+QbGiRJs 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;