]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branches 'core/iommu', 'x86/amd-iommu' and 'x86/iommu' into x86-v28-for-linus...
authorIngo Molnar <mingo@elte.hu>
Fri, 10 Oct 2008 17:47:12 +0000 (19:47 +0200)
committerIngo Molnar <mingo@elte.hu>
Fri, 10 Oct 2008 17:47:12 +0000 (19:47 +0200)
Conflicts:
arch/x86/kernel/pci-gart_64.c
include/asm-x86/dma-mapping.h

12 files changed:
1  2  3  4 
Documentation/kernel-parameters.txt
MAINTAINERS
arch/x86/Kconfig
arch/x86/kernel/amd_iommu.c
arch/x86/kernel/pci-dma.c
arch/x86/kernel/pci-gart_64.c
include/asm-x86/amd_iommu.h
include/asm-x86/amd_iommu_types.h
include/asm-x86/bitops.h
include/asm-x86/dma-mapping.h
include/asm-x86/gart.h
include/asm-x86/iommu.h

Simple merge
diff --cc MAINTAINERS
index 8dae4555f10e1b91f0c2eafb84f04fbf71812e55,cad81a24e83238b77c2966398cba65177de927a6,4c5e9fe0f7db5cd80b3fe2c4a76d38a3df1d7fcc,9ac82eab82ee11c85c25acd2e74fba8b03d4d978..3c124d7989e0d36edd4b549ba940b41e81374c6a
@@@@@ -2703,9 -2705,8 -2767,8 -2706,8 +2704,9 @@@@@ S:  Supporte
    MAN-PAGES: MANUAL PAGES FOR LINUX -- Sections 2, 3, 4, 5, and 7
    P:  Michael Kerrisk
    M:  mtk.manpages@gmail.com
  --W:     http://www.kernel.org/doc/man-pages
  --S:     Supported
  ++W:  http://www.kernel.org/doc/man-pages
 +++L:  linux-man@vger.kernel.org
  ++S:  Supported
    
    MARVELL LIBERTAS WIRELESS DRIVER
    P:  Dan Williams
Simple merge
index 042fdc27bc925cd5719c73b443a39b5a3c1456d9,69b4d060b21c4c32e8e40b45c9dc2171c1b56505,de39e1f2ede5f1c820f4abe9fa4f9ec07948419b,3b346c6f551491516329b522af166c0b296b3a53..34e4d112b1ef1bf54720a17f71756f8dd1394dfa
@@@@@ -1008,7 -998,7 -998,7 -1175,15 +1185,15 @@@@@ static void *alloc_coherent(struct devi
        struct protection_domain *domain;
        u16 devid;
        phys_addr_t paddr;
+++     u64 dma_mask = dev->coherent_dma_mask;
+++ 
+++     if (!check_device(dev))
+++             return NULL;
+   
+++     if (!get_device_resources(dev, &iommu, &domain, &devid))
+++             flag &= ~(__GFP_DMA | __GFP_HIGHMEM | __GFP_DMA32);
 ++ 
+++     flag |= __GFP_ZERO;
        virt_addr = (void *)__get_free_pages(flag, get_order(size));
        if (!virt_addr)
                return 0;
Simple merge
index 1a895a58253468e0cbba97b9aba7fb6d8d2fff8a,49285f8fd4d54005d5efb9a9fad6bc498420e6d6,49285f8fd4d54005d5efb9a9fad6bc498420e6d6,d077116fec1b5d3d57d10d3f84104b21a6a2d11b..145f1c83369f17a7e5696a7e241d1d28573606dc
@@@@@ -80,10 -80,9 -80,9 -80,10 +80,10 @@@@@ AGPEXTERN int agp_memory_reserved
    AGPEXTERN __u32 *agp_gatt_table;
    
    static unsigned long next_bit;  /* protected by iommu_bitmap_lock */
--- static int need_flush;              /* global flush state. set for each gart wrap */
+++ static bool need_flush;             /* global flush state. set for each gart wrap */
    
 -- static unsigned long alloc_iommu(struct device *dev, int size)
 ++ static unsigned long alloc_iommu(struct device *dev, int size,
 ++                              unsigned long align_mask)
    {
        unsigned long offset, flags;
        unsigned long boundary_size;
    
        spin_lock_irqsave(&iommu_bitmap_lock, flags);
        offset = iommu_area_alloc(iommu_gart_bitmap, iommu_pages, next_bit,
 --                               size, base_index, boundary_size, 0);
 ++                               size, base_index, boundary_size, align_mask);
        if (offset == -1) {
---             need_flush = 1;
+++             need_flush = true;
                offset = iommu_area_alloc(iommu_gart_bitmap, iommu_pages, 0,
 --                                       size, base_index, boundary_size, 0);
 ++                                       size, base_index, boundary_size,
 ++                                       align_mask);
        }
        if (offset != -1) {
                next_bit = offset+size;
@@@@@ -261,20 -259,16 -259,16 -252,6 +252,6 @@@@@ static dma_addr_t dma_map_area(struct d
        return iommu_bus_base + iommu_page*PAGE_SIZE + (phys_mem & ~PAGE_MASK);
    }
    
--- static dma_addr_t
--- gart_map_simple(struct device *dev, phys_addr_t paddr, size_t size, int dir)
--- {
-       dma_addr_t map;
-       unsigned long align_mask;
-   
-       align_mask = (1UL << get_order(size)) - 1;
-       map = dma_map_area(dev, paddr, size, dir, align_mask);
 --     dma_addr_t map = dma_map_area(dev, paddr, size, dir);
--- 
---     flush_gart();
--- 
---     return map;
--- }
--- 
    /* Map a single area into the IOMMU */
    static dma_addr_t
    gart_map_single(struct device *dev, phys_addr_t paddr, size_t size, int dir)
index 783f43e580523e0af5193807b9e670cace005c7d,30a12049353b1bc6c17d9811046f71096b9d6759,30a12049353b1bc6c17d9811046f71096b9d6759,2fd97cb250c7540f1606bef3cddbc2607fe176cd..041d0db7da272d42abe5d5659f38da6fe2b0e590
     * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
     */
    
 ---#ifndef _ASM_X86_AMD_IOMMU_H
 ---#define _ASM_X86_AMD_IOMMU_H
 +++#ifndef ASM_X86__AMD_IOMMU_H
 +++#define ASM_X86__AMD_IOMMU_H
 ++ 
+++ #include <linux/irqreturn.h>
+   
    #ifdef CONFIG_AMD_IOMMU
    extern int amd_iommu_init(void);
    extern int amd_iommu_init_dma_ops(void);
Simple merge
Simple merge
index 5d200e78bd81e18b7e315f8f2d9660cd13c23a1d,ad9cd6d49bfc9bc624747709da188301b35f5b55,ad9cd6d49bfc9bc624747709da188301b35f5b55,3b808e9bb72c3ac94ade3f0eb4f3b1a3533a91c7..219c33d6361cdfa640878431cd6e6523dc2a475a
@@@@@ -68,7 -68,7 -68,7 -65,7 +65,7 @@@@@ static inline struct dma_mapping_ops *g
                return dma_ops;
        else
                return dev->archdata.dma_ops;
----#endif
++++#endif /* ASM_X86__DMA_MAPPING_H */
    }
    
    /* Make sure we keep the same behaviour */
@@@@@ -247,7 -247,7 -247,7 -241,68 +241,68 @@@@@ static inline int dma_get_cache_alignme
        return boot_cpu_data.x86_clflush_size;
    }
    
--- #define dma_is_consistent(d, h)     (1)
+++ static inline unsigned long dma_alloc_coherent_mask(struct device *dev,
+++                                                 gfp_t gfp)
+++ {
+++     unsigned long dma_mask = 0;
 ++ 
-   #include <asm-generic/dma-coherent.h>
-   #endif /* ASM_X86__DMA_MAPPING_H */
+++     dma_mask = dev->coherent_dma_mask;
+++     if (!dma_mask)
+++             dma_mask = (gfp & GFP_DMA) ? DMA_24BIT_MASK : DMA_32BIT_MASK;
+++ 
+++     return dma_mask;
+++ }
+++ 
+++ static inline gfp_t dma_alloc_coherent_gfp_flags(struct device *dev, gfp_t gfp)
+++ {
+++ #ifdef CONFIG_X86_64
+++     unsigned long dma_mask = dma_alloc_coherent_mask(dev, gfp);
+++ 
+++     if (dma_mask <= DMA_32BIT_MASK && !(gfp & GFP_DMA))
+++             gfp |= GFP_DMA32;
+++ #endif
+++        return gfp;
+++ }
+++ 
+++ static inline void *
+++ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
+++             gfp_t gfp)
+++ {
+++     struct dma_mapping_ops *ops = get_dma_ops(dev);
+++     void *memory;
+++ 
+++     gfp &= ~(__GFP_DMA | __GFP_HIGHMEM | __GFP_DMA32);
+++ 
+++     if (dma_alloc_from_coherent(dev, size, dma_handle, &memory))
+++             return memory;
+++ 
+++     if (!dev) {
+++             dev = &x86_dma_fallback_dev;
+++             gfp |= GFP_DMA;
+++     }
+++ 
+++     if (!is_device_dma_capable(dev))
+++             return NULL;
+++ 
+++     if (!ops->alloc_coherent)
+++             return NULL;
+++ 
+++     return ops->alloc_coherent(dev, size, dma_handle,
+++                                dma_alloc_coherent_gfp_flags(dev, gfp));
+++ }
+++ 
+++ static inline void dma_free_coherent(struct device *dev, size_t size,
+++                                  void *vaddr, dma_addr_t bus)
+++ {
+++     struct dma_mapping_ops *ops = get_dma_ops(dev);
+++ 
+++     WARN_ON(irqs_disabled());       /* for portability */
+++ 
+++     if (dma_release_from_coherent(dev, get_order(size), vaddr))
+++             return;
+++ 
+++     if (ops->free_coherent)
+++             ops->free_coherent(dev, size, vaddr, bus);
+++ }
+   
 -- #include <asm-generic/dma-coherent.h>
+   #endif
Simple merge
Simple merge