]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
arm: move arm_dma_limit to setup_dma_zone
authorVladimir Murzin <murzin.v@gmail.com>
Thu, 24 Apr 2014 23:04:02 +0000 (09:04 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 30 Apr 2014 05:42:57 +0000 (15:42 +1000)
Since 4dcfa600 ("ARM: DMA-API: better handing of DMA masks for coherent
allocations") arm_dma_limit_pfn has almost substituted the arm_dma_limit.
The remaining user is dma_contiguous_reserve().  It is also referenced in
setup_dma_zone() to calculate arm_dma_limit_pfn.

Kill the global arm_dma_limit and equip setup_zone_dma with the local one.

Signed-off-by: Vladimir Murzin <murzin.v@gmail.com>
Reported-by: Vassili Karpov <av1474@comtv.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/arm/mm/init.c
arch/arm/mm/mm.h

index 2a77ba8796aeed0d6f6bf0e769422d557196ddba..d059bbdfdf9daabc150cda7edca2109d5f15bced 100644 (file)
@@ -153,7 +153,6 @@ EXPORT_SYMBOL(arm_dma_zone_size);
  * allocations.  This must be the smallest DMA mask in the system,
  * so a successful GFP_DMA allocation will always satisfy this.
  */
-phys_addr_t arm_dma_limit;
 unsigned long arm_dma_pfn_limit;
 
 static void __init arm_adjust_dma_zone(unsigned long *size, unsigned long *hole,
@@ -172,6 +171,8 @@ static void __init arm_adjust_dma_zone(unsigned long *size, unsigned long *hole,
 void __init setup_dma_zone(const struct machine_desc *mdesc)
 {
 #ifdef CONFIG_ZONE_DMA
+       phys_addr_t arm_dma_limit;
+
        if (mdesc->dma_zone_size) {
                arm_dma_zone_size = mdesc->dma_zone_size;
                arm_dma_limit = PHYS_OFFSET + arm_dma_zone_size - 1;
@@ -329,7 +330,8 @@ void __init arm_memblock_init(struct meminfo *mi,
         * reserve memory for DMA contigouos allocations,
         * must come from DMA area inside low memory
         */
-       dma_contiguous_reserve(min(arm_dma_limit, arm_lowmem_limit));
+       dma_contiguous_reserve(min((phys_addr_t)arm_dma_pfn_limit << PAGE_SHIFT,
+                                  arm_lowmem_limit));
 
        arm_memblock_steal_permitted = false;
        memblock_dump_all();
index 7ea641b7aa7d2b6ffd240b9fe0e7f7897a5a2d1a..64a40d63cad566bac60b5554d9da9d01c2c50dc1 100644 (file)
@@ -81,10 +81,8 @@ extern __init void add_static_vm_early(struct static_vm *svm);
 #endif
 
 #ifdef CONFIG_ZONE_DMA
-extern phys_addr_t arm_dma_limit;
 extern unsigned long arm_dma_pfn_limit;
 #else
-#define arm_dma_limit ((phys_addr_t)~0)
 #define arm_dma_pfn_limit (~0ul >> PAGE_SHIFT)
 #endif