]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge remote-tracking branch 'dma-mapping/dma-mapping-next'
authorStephen Rothwell <sfr@canb.auug.org.au>
Wed, 21 May 2014 06:03:39 +0000 (16:03 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 21 May 2014 06:03:39 +0000 (16:03 +1000)
1  2 
arch/arm/mm/dma-mapping.c

index 18e98dfb73fc1918d5da9285ff25cee38e115d19,3d43c418e41bfa857a16e4237fa6ed9c51180511..b559c0629d98f418a44eba9b8b05cc7f6f1b1021
@@@ -885,7 -885,7 +885,7 @@@ static void dma_cache_maint_page(struc
  static void __dma_page_cpu_to_dev(struct page *page, unsigned long off,
        size_t size, enum dma_data_direction dir)
  {
 -      unsigned long paddr;
 +      phys_addr_t paddr;
  
        dma_cache_maint_page(page, off, size, dir, dmac_map_area);
  
  static void __dma_page_dev_to_cpu(struct page *page, unsigned long off,
        size_t size, enum dma_data_direction dir)
  {
 -      unsigned long paddr = page_to_phys(page) + off;
 +      phys_addr_t paddr = page_to_phys(page) + off;
  
        /* FIXME: non-speculating: not required */
        /* don't bother invalidating if DMA to device */
@@@ -1074,6 -1074,7 +1074,7 @@@ static inline dma_addr_t __alloc_iova(s
        unsigned int order = get_order(size);
        unsigned int align = 0;
        unsigned int count, start;
+       size_t mapping_size = mapping->bits << PAGE_SHIFT;
        unsigned long flags;
        dma_addr_t iova;
        int i;
        }
        spin_unlock_irqrestore(&mapping->lock, flags);
  
-       iova = mapping->base + (mapping->size * i);
+       iova = mapping->base + (mapping_size * i);
        iova += start << PAGE_SHIFT;
  
        return iova;
@@@ -1129,6 -1130,7 +1130,7 @@@ static inline void __free_iova(struct d
                               dma_addr_t addr, size_t size)
  {
        unsigned int start, count;
+       size_t mapping_size = mapping->bits << PAGE_SHIFT;
        unsigned long flags;
        dma_addr_t bitmap_base;
        u32 bitmap_index;
        if (!size)
                return;
  
-       bitmap_index = (u32) (addr - mapping->base) / (u32) mapping->size;
+       bitmap_index = (u32) (addr - mapping->base) / (u32) mapping_size;
        BUG_ON(addr < mapping->base || bitmap_index > mapping->extensions);
  
-       bitmap_base = mapping->base + mapping->size * bitmap_index;
+       bitmap_base = mapping->base + mapping_size * bitmap_index;
  
        start = (addr - bitmap_base) >> PAGE_SHIFT;
  
-       if (addr + size > bitmap_base + mapping->size) {
+       if (addr + size > bitmap_base + mapping_size) {
                /*
                 * The address range to be freed reaches into the iova
                 * range of the next bitmap. This should not happen as
@@@ -1964,7 -1966,6 +1966,6 @@@ arm_iommu_create_mapping(struct bus_typ
        mapping->extensions = extensions;
        mapping->base = base;
        mapping->bits = BITS_PER_BYTE * bitmap_size;
-       mapping->size = mapping->bits << PAGE_SHIFT;
  
        spin_lock_init(&mapping->lock);