]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ARM: dma-mapping: use himem for DMA buffers for IOMMU-mapped devices
authorMarek Szyprowski <m.szyprowski@samsung.com>
Wed, 16 Jan 2013 14:41:02 +0000 (15:41 +0100)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Wed, 6 Feb 2013 09:20:59 +0000 (10:20 +0100)
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

index 5f79361bd77ceead10fb1cb633cda5d15006875c..5626a57657da6b427373f4c48bf50c07ef2358c7 100644 (file)
@@ -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;