public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: m.szyprowski@samsung.com (Marek Szyprowski)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] ARM: dma-mapping: use himem for DMA buffers for IOMMU-mapped devices
Date: Wed, 16 Jan 2013 16:31:23 +0100	[thread overview]
Message-ID: <1358350284-6972-3-git-send-email-m.szyprowski@samsung.com> (raw)
In-Reply-To: <1358350284-6972-1-git-send-email-m.szyprowski@samsung.com>

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 <m.szyprowski@samsung.com>
---
 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;
 
-- 
1.7.9.5

      parent reply	other threads:[~2013-01-16 15:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-16 15:31 [PATCH 0/2] ARM: dma-mapping: add highmem support for coherent allocation Marek Szyprowski
2013-01-16 15:31 ` [PATCH 1/2] ARM: dma-mapping: add support for CMA regions placed in highmem zone Marek Szyprowski
2013-02-04 13:23   ` [PATCHv2 " Marek Szyprowski
2013-02-04 13:51     ` Michal Nazarewicz
2013-02-04 14:10       ` Russell King - ARM Linux
2013-02-04 14:24         ` Michal Nazarewicz
2013-02-04 14:34           ` Russell King - ARM Linux
2013-02-04 14:42             ` Michal Nazarewicz
2013-02-04 15:11               ` Russell King - ARM Linux
2013-02-04 14:41     ` Michal Nazarewicz
2013-02-07 14:59     ` [PATCHv3 " Marek Szyprowski
2013-01-16 15:31 ` Marek Szyprowski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1358350284-6972-3-git-send-email-m.szyprowski@samsung.com \
    --to=m.szyprowski@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox