From patchwork Wed Jan 16 15:31:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 14085 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 841F823E57 for ; Wed, 16 Jan 2013 15:32:07 +0000 (UTC) Received: from mail-vb0-f50.google.com (mail-vb0-f50.google.com [209.85.212.50]) by fiordland.canonical.com (Postfix) with ESMTP id 17E17A19339 for ; Wed, 16 Jan 2013 15:32:07 +0000 (UTC) Received: by mail-vb0-f50.google.com with SMTP id ft2so996704vbb.37 for ; Wed, 16 Jan 2013 07:32:06 -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:in-reply-to :references: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=k8fYswgIKsoU+JK2tJmGakbjAP6mNn73pTTLi4Vt3h0=; b=HMzCy3OoHwBTtoAyQXw8vq24OKF0+IrwvnHYaiFJm9H1JS3XxIfBSV3FdNWRF1QGig BWwK+X3ui1zXJw2SfDL2PSvbxRlX32BlJy65MFgnEYU3ktAI8KsWoHKhZqu0F6G78rQd Am7qvAkY+ekVzJG2MaB61MC129pkbZIJEvDKZgvmkpGPo/HzWfEshIzF47lLo/EAFusH KOGPsSX+YQvMu9CVsbghJSANw38xBm+CFWUU6EktUOFHEqJsmfpyHXYq2+RoDadJPHPE Z6ToJqYxIl6gvEe0PUkwWI/9drpG/jYKsV10tkoB0la3qwhJKkSHMT7WGhQcCoMgqkM3 dgLQ== X-Received: by 10.52.18.207 with SMTP id y15mr1416419vdd.8.1358350326574; Wed, 16 Jan 2013 07:32:06 -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.145.101 with SMTP id st5csp172792veb; Wed, 16 Jan 2013 07:32:05 -0800 (PST) X-Received: by 10.224.180.212 with SMTP id bv20mr2077585qab.6.1358350325290; Wed, 16 Jan 2013 07:32:05 -0800 (PST) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id wk8si34286923wjc.41.2013.01.16.07.32.02; Wed, 16 Jan 2013 07:32:05 -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 1TvUy4-0003Nn-MO; Wed, 16 Jan 2013 15:31:56 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TvUy3-0003NZ-4g for linaro-mm-sig@lists.linaro.org; Wed, 16 Jan 2013 15:31:55 +0000 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MGQ00FD45T2AD20@mailout1.samsung.com> for linaro-mm-sig@lists.linaro.org; Thu, 17 Jan 2013 00:31:54 +0900 (KST) X-AuditID: cbfee61b-b7f616d00000319b-00-50f6c7ea272a Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 56.98.12699.AE7C6F05; Thu, 17 Jan 2013 00:31:54 +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 <0MGQ00DNK5SNVP80@mmp1.samsung.com> for linaro-mm-sig@lists.linaro.org; Thu, 17 Jan 2013 00:31:54 +0900 (KST) From: Marek Szyprowski To: linux-arm-kernel@lists.infradead.org, linaro-mm-sig@lists.linaro.org Date: Wed, 16 Jan 2013 16:31:23 +0100 Message-id: <1358350284-6972-3-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1358350284-6972-1-git-send-email-m.szyprowski@samsung.com> References: <1358350284-6972-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrEJMWRmVeSWpSXmKPExsVy+t9jAd1Xx78FGGy/r2/x5cpDJgdGj9v/ HjMHMEZx2aSk5mSWpRbp2yVwZdz9d4K54CxHRce7ZrYGxk9sXYycHBICJhLT925igbDFJC7c Ww8U5+IQEljEKDH50zMoZxWTxLvZV5hAqtgEDCW63naBdYsIeEg8WXGOGcRmFjjMJDF9QgSI LSwQLXHzyw6wOIuAqsTvne/ANvAKuEv8m7kSyOYA2qYgMWeSDUiYE2jMlz33wUYKAZVMm9LL NoGRdwEjwypG0dSC5ILipPRcI73ixNzi0rx0veT83E2MYJ8/k97BuKrB4hCjAAejEg+vZ+HX ACHWxLLiytxDjBIczEoivDZ7vwUI8aYkVlalFuXHF5XmpBYfYpTmYFES52U89SRASCA9sSQ1 OzW1ILUIJsvEwSnVwBjt94pHieHDFG2xOw5S02Pvh0gmfJsUcW3hHpOFVUt3uy+ddjCg5JhJ u9m0w2ddvvumMPxamMom9lvT4trlhs7euepyS29PFzv2eddW2TvJbxpWhhkfMFxWMqFh9966 KaWvp0UEzmXjEAlra5nCKiFzJX51y88jV86HajAdXrvI4lzigd9bvQ4osRRnJBpqMRcVJwIA iZ5zYfUBAAA= Cc: Russell King - ARM Linux , Arnd Bergmann , Michal Nazarewicz , heesub.shin@samsung.com, Minchan Kim , Kyungmin Park , sj2202.park@samsung.com, lauraa@quicinc.com Subject: [Linaro-mm-sig] [PATCH 2/2] ARM: dma-mapping: use himem for DMA buffers for IOMMU-mapped devices 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: ALoCoQkSV96BQZ4VqhkjWzGsgFBFAjX7JHIapG3RxkxmcqXhRk6YG5gUDX1Aj607Na5+JvMAmogI IOMMU can provide access to any memory page, so there is no point in limiting the allocated pages only to lowmem, once other parts of dma-mapping subsystem correctly supports himem pages. Signed-off-by: Marek Szyprowski --- arch/arm/mm/dma-mapping.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 4080c37..9a6c8ce 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -1095,12 +1095,17 @@ static struct page **__iommu_alloc_buffer(struct device *dev, size_t size, return pages; } + /* + * IOMMU can map any pages, so himem can also be used here + */ + gfp |= __GFP_NOWARN | __GFP_HIGHMEM; + while (count) { int j, order = __fls(count); - pages[i] = alloc_pages(gfp | __GFP_NOWARN, order); + pages[i] = alloc_pages(gfp, order); while (!pages[i] && order) - pages[i] = alloc_pages(gfp | __GFP_NOWARN, --order); + pages[i] = alloc_pages(gfp, --order); if (!pages[i]) goto error;