]> Git Repo - linux.git/commitdiff
Merge branch 'linus' into core/generic-dma-coherent
authorIngo Molnar <[email protected]>
Mon, 28 Jul 2008 22:07:55 +0000 (00:07 +0200)
committerIngo Molnar <[email protected]>
Mon, 28 Jul 2008 22:07:55 +0000 (00:07 +0200)
Conflicts:

arch/x86/Kconfig

Signed-off-by: Ingo Molnar <[email protected]>
1  2 
arch/arm/Kconfig
arch/sh/Kconfig
arch/sh/mm/consistent.c
arch/x86/Kconfig
arch/x86/kernel/pci-dma.c
include/asm-arm/dma-mapping.h
include/asm-cris/dma-mapping.h
include/asm-sh/dma-mapping.h
include/asm-x86/dma-mapping.h
init/Kconfig
kernel/Makefile

diff --combined arch/arm/Kconfig
index ea8b9be02b605d72b8bd1074221f1055c7fda6d3,c8f528284a94e3efa98dc5f3dcd4fa4ca11a8c3e..652cd32a09c57d33afea25ab83399b199a46b46e
@@@ -12,11 -12,11 +12,12 @@@ config AR
        select RTC_LIB
        select SYS_SUPPORTS_APM_EMULATION
        select HAVE_OPROFILE
+       select HAVE_ARCH_KGDB
        select HAVE_KPROBES if (!XIP_KERNEL)
        select HAVE_KRETPROBES if (HAVE_KPROBES)
        select HAVE_FTRACE if (!XIP_KERNEL)
        select HAVE_DYNAMIC_FTRACE if (HAVE_FTRACE)
 +      select HAVE_GENERIC_DMA_COHERENT
        help
          The ARM series is a line of low-power-consumption RISC chip designs
          licensed by ARM Ltd and targeted at embedded applications and
@@@ -198,12 -198,14 +199,14 @@@ choic
  config ARCH_AAEC2000
        bool "Agilent AAEC-2000 based"
        select ARM_AMBA
+       select HAVE_CLK
        help
          This enables support for systems based on the Agilent AAEC-2000
  
  config ARCH_INTEGRATOR
        bool "ARM Ltd. Integrator family"
        select ARM_AMBA
+       select HAVE_CLK
        select ICST525
        help
          Support for ARM's Integrator platform.
  config ARCH_REALVIEW
        bool "ARM Ltd. RealView family"
        select ARM_AMBA
+       select HAVE_CLK
        select ICST307
        select GENERIC_TIME
        select GENERIC_CLOCKEVENTS
@@@ -221,6 -224,7 +225,7 @@@ config ARCH_VERSATIL
        bool "ARM Ltd. Versatile family"
        select ARM_AMBA
        select ARM_VIC
+       select HAVE_CLK
        select ICST307
        select GENERIC_TIME
        select GENERIC_CLOCKEVENTS
@@@ -262,7 -266,9 +267,9 @@@ config ARCH_EP93X
        select ARM_AMBA
        select ARM_VIC
        select GENERIC_GPIO
-       select HAVE_GPIO_LIB
+       select HAVE_CLK
+       select HAVE_CLK
+       select ARCH_REQUIRE_GPIOLIB
        help
          This enables support for the Cirrus EP93xx series of CPUs.
  
@@@ -308,7 -314,7 +315,7 @@@ config ARCH_IOP32
        select PLAT_IOP
        select PCI
        select GENERIC_GPIO
-       select HAVE_GPIO_LIB
+       select ARCH_REQUIRE_GPIOLIB
        help
          Support for Intel's 80219 and IOP32X (XScale) family of
          processors.
@@@ -319,7 -325,7 +326,7 @@@ config ARCH_IOP33
        select PLAT_IOP
        select PCI
        select GENERIC_GPIO
-       select HAVE_GPIO_LIB
+       select ARCH_REQUIRE_GPIOLIB
        help
          Support for Intel's IOP33X (XScale) family of processors.
  
@@@ -381,6 -387,7 +388,7 @@@ config ARCH_NS9XX
        select GENERIC_GPIO
        select GENERIC_TIME
        select GENERIC_CLOCKEVENTS
+       select HAVE_CLK
        help
          Say Y here if you intend to run this kernel on a NetSilicon NS9xxx
          System.
@@@ -411,7 -418,7 +419,7 @@@ config ARCH_MX
        select GENERIC_CLOCKEVENTS
        select ARCH_MTD_XIP
        select GENERIC_GPIO
-       select HAVE_GPIO_LIB
+       select ARCH_REQUIRE_GPIOLIB
        help
          Support for Freescale MXC/iMX-based family of processors
  
@@@ -430,6 -437,7 +438,7 @@@ config ARCH_ORION5
  
  config ARCH_PNX4008
        bool "Philips Nexperia PNX4008 Mobile"
+       select HAVE_CLK
        help
          This enables support for Philips PNX4008 mobile platform.
  
@@@ -438,7 -446,8 +447,8 @@@ config ARCH_PX
        depends on MMU
        select ARCH_MTD_XIP
        select GENERIC_GPIO
-       select HAVE_GPIO_LIB
+       select HAVE_CLK
+       select ARCH_REQUIRE_GPIOLIB
        select GENERIC_TIME
        select GENERIC_CLOCKEVENTS
        select TICK_ONESHOT
@@@ -468,14 -477,16 +478,16 @@@ config ARCH_SA110
        select GENERIC_GPIO
        select GENERIC_TIME
        select GENERIC_CLOCKEVENTS
+       select HAVE_CLK
        select TICK_ONESHOT
-       select HAVE_GPIO_LIB
+       select ARCH_REQUIRE_GPIOLIB
        help
          Support for StrongARM 11x0 based boards.
  
  config ARCH_S3C2410
        bool "Samsung S3C2410, S3C2412, S3C2413, S3C2440, S3C2442, S3C2443"
        select GENERIC_GPIO
+       select HAVE_CLK
        help
          Samsung S3C2410X CPU based systems, such as the Simtec Electronics
          BAST (<http://www.simtec.co.uk/products/EB110ITX/>), the IPAQ 1940 or
@@@ -503,13 -514,15 +515,15 @@@ config ARCH_DAVINC
        select GENERIC_TIME
        select GENERIC_CLOCKEVENTS
        select GENERIC_GPIO
+       select HAVE_CLK
        help
          Support for TI's DaVinci platform.
  
  config ARCH_OMAP
        bool "TI OMAP"
        select GENERIC_GPIO
-       select HAVE_GPIO_LIB
+       select HAVE_CLK
+       select ARCH_REQUIRE_GPIOLIB
        select GENERIC_TIME
        select GENERIC_CLOCKEVENTS
        help
diff --combined arch/sh/Kconfig
index 81894f0985aad0cf8440c44e7d42c88043444d82,7bfb0d219d67fadb87080a07364a4e45c59f78e9..0b88dc462d731c7c8c46525e3fa71eeb53e46cfd
@@@ -8,9 -8,9 +8,10 @@@ mainmenu "Linux/SuperH Kernel Configura
  config SUPERH
        def_bool y
        select EMBEDDED
+       select HAVE_CLK
        select HAVE_IDE
        select HAVE_OPROFILE
 +      select HAVE_GENERIC_DMA_COHERENT
        help
          The SuperH is a RISC processor targeted for use in embedded systems
          and consumer electronics; it was also used in the Sega Dreamcast
@@@ -477,6 -477,10 +478,10 @@@ config SH_RTS7751R2
          Select RTS7751R2D if configuring for a Renesas Technology
          Sales SH-Graphics board.
  
+ config SH_RSK7203
+       bool "RSK7203"
+       depends on CPU_SUBTYPE_SH7203
  config SH_SDK7780
        bool "SDK7780R3"
        depends on CPU_SUBTYPE_SH7780
@@@ -491,6 -495,21 +496,21 @@@ config SH_HIGHLANDE
        select SYS_SUPPORTS_PCI
        select IO_TRAPPED
  
+ config SH_SH7785LCR
+       bool "SH7785LCR"
+       depends on CPU_SUBTYPE_SH7785
+       select SYS_SUPPORTS_PCI
+       select IO_TRAPPED
+ config SH_SH7785LCR_29BIT_PHYSMAPS
+       bool "SH7785LCR 29bit physmaps"
+       depends on SH_SH7785LCR
+       default y
+       help
+         This board has 2 physical memory maps. It can be changed with
+         DIP switch(S2-5). If you set the DIP switch for S2-5 = ON,
+         you can access all on-board device in 29bit address mode.
  config SH_MIGOR
        bool "Migo-R"
        depends on CPU_SUBTYPE_SH7722
          Select Migo-R if configuring for the SH7722 Migo-R platform
            by Renesas System Solutions Asia Pte. Ltd.
  
+ config SH_AP325RXA
+       bool "AP-325RXA"
+       depends on CPU_SUBTYPE_SH7723
+       help
+         Renesas "AP-325RXA" support.
+         Compatible with ALGO SYSTEM CO.,LTD. "AP-320A"
+ config SH_SH7763RDP
+       bool "SH7763RDP"
+       depends on CPU_SUBTYPE_SH7763
+       help
+         Select SH7763RDP if configuring for a Renesas SH7763
+         evaluation board.
  config SH_EDOSK7705
        bool "EDOSK7705"
        depends on CPU_SUBTYPE_SH7705
@@@ -559,6 -592,7 +593,7 @@@ endmen
  source "arch/sh/boards/renesas/rts7751r2d/Kconfig"
  source "arch/sh/boards/renesas/r7780rp/Kconfig"
  source "arch/sh/boards/renesas/sdk7780/Kconfig"
+ source "arch/sh/boards/renesas/migor/Kconfig"
  source "arch/sh/boards/magicpanelr2/Kconfig"
  
  menu "Timer and clock configuration"
diff --combined arch/sh/mm/consistent.c
index 3095d958147564a27fdc198652c0dcd512e73466,8277982d0938d06aa390e6cdaa7af3d4d9d4e5bb..b2ce014401b5516ed8ae51c4ca98cf5d0c4a026e
@@@ -10,6 -10,7 +10,7 @@@
   * for more details.
   */
  #include <linux/mm.h>
+ #include <linux/platform_device.h>
  #include <linux/dma-mapping.h>
  #include <asm/cacheflush.h>
  #include <asm/addrspace.h>
@@@ -27,10 -28,21 +28,10 @@@ void *dma_alloc_coherent(struct device 
                           dma_addr_t *dma_handle, gfp_t gfp)
  {
        void *ret, *ret_nocache;
 -      struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL;
        int order = get_order(size);
  
 -      if (mem) {
 -              int page = bitmap_find_free_region(mem->bitmap, mem->size,
 -                                                   order);
 -              if (page >= 0) {
 -                      *dma_handle = mem->device_base + (page << PAGE_SHIFT);
 -                      ret = mem->virt_base + (page << PAGE_SHIFT);
 -                      memset(ret, 0, size);
 -                      return ret;
 -              }
 -              if (mem->flags & DMA_MEMORY_EXCLUSIVE)
 -                      return NULL;
 -      }
 +      if (dma_alloc_from_coherent(dev, size, dma_handle, &ret))
 +              return ret;
  
        ret = (void *)__get_free_pages(gfp, order);
        if (!ret)
@@@ -60,7 -72,11 +61,7 @@@ void dma_free_coherent(struct device *d
        struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL;
        int order = get_order(size);
  
 -      if (mem && vaddr >= mem->virt_base && vaddr < (mem->virt_base + (mem->size << PAGE_SHIFT))) {
 -              int page = (vaddr - mem->virt_base) >> PAGE_SHIFT;
 -
 -              bitmap_release_region(mem->bitmap, page, order);
 -      } else {
 +      if (!dma_release_from_coherent(dev, order, vaddr)) {
                WARN_ON(irqs_disabled());       /* for portability */
                BUG_ON(mem && mem->flags & DMA_MEMORY_EXCLUSIVE);
                free_pages((unsigned long)phys_to_virt(dma_handle), order);
  }
  EXPORT_SYMBOL(dma_free_coherent);
  
 -int dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
 -                              dma_addr_t device_addr, size_t size, int flags)
 -{
 -      void __iomem *mem_base = NULL;
 -      int pages = size >> PAGE_SHIFT;
 -      int bitmap_size = BITS_TO_LONGS(pages) * sizeof(long);
 -
 -      if ((flags & (DMA_MEMORY_MAP | DMA_MEMORY_IO)) == 0)
 -              goto out;
 -      if (!size)
 -              goto out;
 -      if (dev->dma_mem)
 -              goto out;
 -
 -      /* FIXME: this routine just ignores DMA_MEMORY_INCLUDES_CHILDREN */
 -
 -      mem_base = ioremap_nocache(bus_addr, size);
 -      if (!mem_base)
 -              goto out;
 -
 -      dev->dma_mem = kmalloc(sizeof(struct dma_coherent_mem), GFP_KERNEL);
 -      if (!dev->dma_mem)
 -              goto out;
 -      dev->dma_mem->bitmap = kzalloc(bitmap_size, GFP_KERNEL);
 -      if (!dev->dma_mem->bitmap)
 -              goto free1_out;
 -
 -      dev->dma_mem->virt_base = mem_base;
 -      dev->dma_mem->device_base = device_addr;
 -      dev->dma_mem->size = pages;
 -      dev->dma_mem->flags = flags;
 -
 -      if (flags & DMA_MEMORY_MAP)
 -              return DMA_MEMORY_MAP;
 -
 -      return DMA_MEMORY_IO;
 -
 - free1_out:
 -      kfree(dev->dma_mem);
 - out:
 -      if (mem_base)
 -              iounmap(mem_base);
 -      return 0;
 -}
 -EXPORT_SYMBOL(dma_declare_coherent_memory);
 -
 -void dma_release_declared_memory(struct device *dev)
 -{
 -      struct dma_coherent_mem *mem = dev->dma_mem;
 -
 -      if (!mem)
 -              return;
 -      dev->dma_mem = NULL;
 -      iounmap(mem->virt_base);
 -      kfree(mem->bitmap);
 -      kfree(mem);
 -}
 -EXPORT_SYMBOL(dma_release_declared_memory);
 -
 -void *dma_mark_declared_memory_occupied(struct device *dev,
 -                                      dma_addr_t device_addr, size_t size)
 -{
 -      struct dma_coherent_mem *mem = dev->dma_mem;
 -      int pages = (size + (device_addr & ~PAGE_MASK) + PAGE_SIZE - 1) >> PAGE_SHIFT;
 -      int pos, err;
 -
 -      if (!mem)
 -              return ERR_PTR(-EINVAL);
 -
 -      pos = (device_addr - mem->device_base) >> PAGE_SHIFT;
 -      err = bitmap_allocate_region(mem->bitmap, pos, get_order(pages));
 -      if (err != 0)
 -              return ERR_PTR(err);
 -      return mem->virt_base + (pos << PAGE_SHIFT);
 -}
 -EXPORT_SYMBOL(dma_mark_declared_memory_occupied);
 -
  void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
                    enum dma_data_direction direction)
  {
        }
  }
  EXPORT_SYMBOL(dma_cache_sync);
+ int platform_resource_setup_memory(struct platform_device *pdev,
+                                  char *name, unsigned long memsize)
+ {
+       struct resource *r;
+       dma_addr_t dma_handle;
+       void *buf;
+       r = pdev->resource + pdev->num_resources - 1;
+       if (r->flags) {
+               pr_warning("%s: unable to find empty space for resource\n",
+                       name);
+               return -EINVAL;
+       }
+       buf = dma_alloc_coherent(NULL, memsize, &dma_handle, GFP_KERNEL);
+       if (!buf) {
+               pr_warning("%s: unable to allocate memory\n", name);
+               return -ENOMEM;
+       }
+       memset(buf, 0, memsize);
+       r->flags = IORESOURCE_MEM;
+       r->start = dma_handle;
+       r->end = r->start + memsize - 1;
+       r->name = name;
+       return 0;
+ }
diff --combined arch/x86/Kconfig
index 18a58ecfe6842215e854419054900a27cfac550b,b6fa2877b1734aad723805c2e5518fe301f3443d..3d0f2b6a5a16e6edd6f349b4b19756a5d2cecff7
@@@ -21,13 -21,16 +21,17 @@@ config X8
        select HAVE_UNSTABLE_SCHED_CLOCK
        select HAVE_IDE
        select HAVE_OPROFILE
+       select HAVE_IOREMAP_PROT
+       select HAVE_GET_USER_PAGES_FAST
        select HAVE_KPROBES
+       select ARCH_WANT_OPTIONAL_GPIOLIB
        select HAVE_KRETPROBES
        select HAVE_DYNAMIC_FTRACE
        select HAVE_FTRACE
        select HAVE_KVM if ((X86_32 && !X86_VOYAGER && !X86_VISWS && !X86_NUMAQ) || X86_64)
        select HAVE_ARCH_KGDB if !X86_VOYAGER
 +      select HAVE_GENERIC_DMA_COHERENT if X86_32
+       select HAVE_EFFICIENT_UNALIGNED_ACCESS
  
  config ARCH_DEFCONFIG
        string
@@@ -330,20 -333,6 +334,6 @@@ config X86_BIGSM
  
  endif
  
- config X86_RDC321X
-       bool "RDC R-321x SoC"
-       depends on X86_32
-       select M486
-       select X86_REBOOTFIXUPS
-       select GENERIC_GPIO
-       select LEDS_CLASS
-       select LEDS_GPIO
-       select NEW_LEDS
-       help
-         This option is needed for RDC R-321x system-on-chip, also known
-         as R-8610-(G).
-         If you don't have one of these chips, you should say N here.
  config X86_VSMP
        bool "Support for ScaleMP vSMP"
        select PARAVIRT
@@@ -367,6 -356,16 +357,16 @@@ config X86_VISW
          A kernel compiled for the Visual Workstation will run on general
          PCs as well. See <file:Documentation/sgi-visws.txt> for details.
  
+ config X86_RDC321X
+       bool "RDC R-321x SoC"
+       depends on X86_32
+       select M486
+       select X86_REBOOTFIXUPS
+       help
+         This option is needed for RDC R-321x system-on-chip, also known
+         as R-8610-(G).
+         If you don't have one of these chips, you should say N here.
  config SCHED_NO_NO_OMIT_FRAME_POINTER
        def_bool y
        prompt "Single-depth WCHAN output"
@@@ -448,7 -447,6 +448,6 @@@ config PARAVIRT_DEBU
  
  config MEMTEST
        bool "Memtest"
-       depends on X86_64
        help
          This option adds a kernel parameter 'memtest', which allows memtest
          to be set.
@@@ -1278,6 -1276,14 +1277,14 @@@ config CRASH_DUM
          (CONFIG_RELOCATABLE=y).
          For more details see Documentation/kdump/kdump.txt
  
+ config KEXEC_JUMP
+       bool "kexec jump (EXPERIMENTAL)"
+       depends on EXPERIMENTAL
+       depends on KEXEC && HIBERNATION && X86_32
+       help
+         Jump between original kernel and kexeced kernel and invoke
+         code in physical address mode via KEXEC
  config PHYSICAL_START
        hex "Physical address where the kernel is loaded" if (EMBEDDED || CRASH_DUMP)
        default "0x1000000" if X86_NUMAQ
index b7dd70fda0317c40c500261646bd041561dc3a42,37544123896db54a58ac8cb3ee746d6c114ff686..8dbffb846de9b66c5a1aec5cc542dc959acfa924
@@@ -5,14 -5,13 +5,13 @@@
  
  #include <asm/proto.h>
  #include <asm/dma.h>
- #include <asm/gart.h>
+ #include <asm/iommu.h>
  #include <asm/calgary.h>
  #include <asm/amd_iommu.h>
  
- int forbid_dac __read_mostly;
- EXPORT_SYMBOL(forbid_dac);
+ static int forbid_dac __read_mostly;
  
const struct dma_mapping_ops *dma_ops;
+ struct dma_mapping_ops *dma_ops;
  EXPORT_SYMBOL(dma_ops);
  
  static int iommu_sac_force __read_mostly;
@@@ -114,21 -113,15 +113,15 @@@ void __init pci_iommu_alloc(void
         * The order of these functions is important for
         * fall-back/fail-over reasons
         */
- #ifdef CONFIG_GART_IOMMU
        gart_iommu_hole_init();
- #endif
  
- #ifdef CONFIG_CALGARY_IOMMU
        detect_calgary();
- #endif
  
        detect_intel_iommu();
  
        amd_iommu_detect();
  
- #ifdef CONFIG_SWIOTLB
        pci_swiotlb_init();
- #endif
  }
  #endif
  
@@@ -184,9 -177,7 +177,7 @@@ static __init int iommu_setup(char *p
                        swiotlb = 1;
  #endif
  
- #ifdef CONFIG_GART_IOMMU
                gart_parse_options(p);
- #endif
  
  #ifdef CONFIG_CALGARY_IOMMU
                if (!strncmp(p, "calgary", 7))
  }
  early_param("iommu", iommu_setup);
  
 -#ifdef CONFIG_X86_32
 -int dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
 -                              dma_addr_t device_addr, size_t size, int flags)
 -{
 -      void __iomem *mem_base = NULL;
 -      int pages = size >> PAGE_SHIFT;
 -      int bitmap_size = BITS_TO_LONGS(pages) * sizeof(long);
 -
 -      if ((flags & (DMA_MEMORY_MAP | DMA_MEMORY_IO)) == 0)
 -              goto out;
 -      if (!size)
 -              goto out;
 -      if (dev->dma_mem)
 -              goto out;
 -
 -      /* FIXME: this routine just ignores DMA_MEMORY_INCLUDES_CHILDREN */
 -
 -      mem_base = ioremap(bus_addr, size);
 -      if (!mem_base)
 -              goto out;
 -
 -      dev->dma_mem = kzalloc(sizeof(struct dma_coherent_mem), GFP_KERNEL);
 -      if (!dev->dma_mem)
 -              goto out;
 -      dev->dma_mem->bitmap = kzalloc(bitmap_size, GFP_KERNEL);
 -      if (!dev->dma_mem->bitmap)
 -              goto free1_out;
 -
 -      dev->dma_mem->virt_base = mem_base;
 -      dev->dma_mem->device_base = device_addr;
 -      dev->dma_mem->size = pages;
 -      dev->dma_mem->flags = flags;
 -
 -      if (flags & DMA_MEMORY_MAP)
 -              return DMA_MEMORY_MAP;
 -
 -      return DMA_MEMORY_IO;
 -
 - free1_out:
 -      kfree(dev->dma_mem);
 - out:
 -      if (mem_base)
 -              iounmap(mem_base);
 -      return 0;
 -}
 -EXPORT_SYMBOL(dma_declare_coherent_memory);
 -
 -void dma_release_declared_memory(struct device *dev)
 -{
 -      struct dma_coherent_mem *mem = dev->dma_mem;
 -
 -      if (!mem)
 -              return;
 -      dev->dma_mem = NULL;
 -      iounmap(mem->virt_base);
 -      kfree(mem->bitmap);
 -      kfree(mem);
 -}
 -EXPORT_SYMBOL(dma_release_declared_memory);
 -
 -void *dma_mark_declared_memory_occupied(struct device *dev,
 -                                      dma_addr_t device_addr, size_t size)
 -{
 -      struct dma_coherent_mem *mem = dev->dma_mem;
 -      int pos, err;
 -      int pages = (size + (device_addr & ~PAGE_MASK) + PAGE_SIZE - 1);
 -
 -      pages >>= PAGE_SHIFT;
 -
 -      if (!mem)
 -              return ERR_PTR(-EINVAL);
 -
 -      pos = (device_addr - mem->device_base) >> PAGE_SHIFT;
 -      err = bitmap_allocate_region(mem->bitmap, pos, get_order(pages));
 -      if (err != 0)
 -              return ERR_PTR(err);
 -      return mem->virt_base + (pos << PAGE_SHIFT);
 -}
 -EXPORT_SYMBOL(dma_mark_declared_memory_occupied);
 -
 -static int dma_alloc_from_coherent_mem(struct device *dev, ssize_t size,
 -                                     dma_addr_t *dma_handle, void **ret)
 -{
 -      struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL;
 -      int order = get_order(size);
 -
 -      if (mem) {
 -              int page = bitmap_find_free_region(mem->bitmap, mem->size,
 -                                                   order);
 -              if (page >= 0) {
 -                      *dma_handle = mem->device_base + (page << PAGE_SHIFT);
 -                      *ret = mem->virt_base + (page << PAGE_SHIFT);
 -                      memset(*ret, 0, size);
 -              }
 -              if (mem->flags & DMA_MEMORY_EXCLUSIVE)
 -                      *ret = NULL;
 -      }
 -      return (mem != NULL);
 -}
 -
 -static int dma_release_coherent(struct device *dev, int order, void *vaddr)
 -{
 -      struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL;
 -
 -      if (mem && vaddr >= mem->virt_base && vaddr <
 -                 (mem->virt_base + (mem->size << PAGE_SHIFT))) {
 -              int page = (vaddr - mem->virt_base) >> PAGE_SHIFT;
 -
 -              bitmap_release_region(mem->bitmap, page, order);
 -              return 1;
 -      }
 -      return 0;
 -}
 -#else
 -#define dma_alloc_from_coherent_mem(dev, size, handle, ret) (0)
 -#define dma_release_coherent(dev, order, vaddr) (0)
 -#endif /* CONFIG_X86_32 */
 -
  int dma_supported(struct device *dev, u64 mask)
  {
+       struct dma_mapping_ops *ops = get_dma_ops(dev);
  #ifdef CONFIG_PCI
        if (mask > 0xffffffff && forbid_dac > 0) {
-               printk(KERN_INFO "PCI: Disallowing DAC for device %s\n",
-                                dev->bus_id);
+               dev_info(dev, "PCI: Disallowing DAC for device\n");
                return 0;
        }
  #endif
  
-       if (dma_ops->dma_supported)
-               return dma_ops->dma_supported(dev, mask);
+       if (ops->dma_supported)
+               return ops->dma_supported(dev, mask);
  
        /* Copied from i386. Doesn't make much sense, because it will
           only work for pci_alloc_coherent.
           type. Normally this doesn't make any difference, but gives
           more gentle handling of IOMMU overflow. */
        if (iommu_sac_force && (mask >= DMA_40BIT_MASK)) {
-               printk(KERN_INFO "%s: Force SAC with mask %Lx\n",
-                                dev->bus_id, mask);
+               dev_info(dev, "Force SAC with mask %Lx\n", mask);
                return 0;
        }
  
@@@ -260,6 -369,7 +251,7 @@@ 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 = NULL;
        struct page *page;
        unsigned long dma_mask = 0;
        /* ignore region specifiers */
        gfp &= ~(__GFP_DMA | __GFP_HIGHMEM | __GFP_DMA32);
  
 -      if (dma_alloc_from_coherent_mem(dev, size, dma_handle, &memory))
 +      if (dma_alloc_from_coherent(dev, size, dma_handle, &memory))
                return memory;
  
        if (!dev) {
                        /* Let low level make its own zone decisions */
                        gfp &= ~(GFP_DMA32|GFP_DMA);
  
-                       if (dma_ops->alloc_coherent)
-                               return dma_ops->alloc_coherent(dev, size,
+                       if (ops->alloc_coherent)
+                               return ops->alloc_coherent(dev, size,
                                                           dma_handle, gfp);
                        return NULL;
                }
                }
        }
  
-       if (dma_ops->alloc_coherent) {
+       if (ops->alloc_coherent) {
                free_pages((unsigned long)memory, get_order(size));
                gfp &= ~(GFP_DMA|GFP_DMA32);
-               return dma_ops->alloc_coherent(dev, size, dma_handle, gfp);
+               return ops->alloc_coherent(dev, size, dma_handle, gfp);
        }
  
-       if (dma_ops->map_simple) {
-               *dma_handle = dma_ops->map_simple(dev, virt_to_phys(memory),
+       if (ops->map_simple) {
+               *dma_handle = ops->map_simple(dev, virt_to_phys(memory),
                                              size,
                                              PCI_DMA_BIDIRECTIONAL);
                if (*dma_handle != bad_dma_address)
@@@ -370,29 -480,27 +362,27 @@@ EXPORT_SYMBOL(dma_alloc_coherent)
  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);
        int order = get_order(size);
        WARN_ON(irqs_disabled());       /* for portability */
 -      if (dma_release_coherent(dev, order, vaddr))
 +      if (dma_release_from_coherent(dev, order, vaddr))
                return;
-       if (dma_ops->unmap_single)
-               dma_ops->unmap_single(dev, bus, size, 0);
+       if (ops->unmap_single)
+               ops->unmap_single(dev, bus, size, 0);
        free_pages((unsigned long)vaddr, order);
  }
  EXPORT_SYMBOL(dma_free_coherent);
  
  static int __init pci_iommu_init(void)
  {
- #ifdef CONFIG_CALGARY_IOMMU
        calgary_iommu_init();
- #endif
  
        intel_iommu_init();
  
        amd_iommu_init();
  
- #ifdef CONFIG_GART_IOMMU
        gart_iommu_init();
- #endif
  
        no_iommu_init();
        return 0;
index 943f23bc99a2035c165eb78577387babdab905af,f41335ba63379ad77d5e75599be68b6f010ecc87..45329fca1b64e32f18ba9dc711ea8bc89f5d5576
@@@ -7,8 -7,6 +7,8 @@@
  
  #include <linux/scatterlist.h>
  
 +#include <asm-generic/dma-coherent.h>
 +
  /*
   * DMA-consistent mapping functions.  These allocate/free a region of
   * uncached, unwrite-buffered mapped memory space for use with DMA
@@@ -58,7 -56,7 +58,7 @@@ static inline int dma_is_consistent(str
  /*
   * DMA errors are defined by all-bits-set in the DMA address.
   */
- static inline int dma_mapping_error(dma_addr_t dma_addr)
+ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
  {
        return dma_addr == ~0;
  }
index 4f58670caad52b3b1d9d325359ac183fb8fa2ded,cb2fb25ff8d9dcb79729b6b0865193357b5eda7d..da8ef8e8f842733751a33985879e07057e6af523
@@@ -14,8 -14,6 +14,8 @@@
  #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
  
  #ifdef CONFIG_PCI
 +#include <asm-generic/dma-coherent.h>
 +
  void *dma_alloc_coherent(struct device *dev, size_t size,
                           dma_addr_t *dma_handle, gfp_t flag);
  
@@@ -122,7 -120,7 +122,7 @@@ dma_sync_sg_for_device(struct device *d
  }
  
  static inline int
- dma_mapping_error(dma_addr_t dma_addr)
+ dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
  {
        return 0;
  }
index 5956c5d568b7c7f1e167152893ad3c0e76f6e41d,6c0b8a2de14323d63c57d45dc17fa3d1bc41d950..627315ecdb520de2c0f8688a18934fe05c93121f
@@@ -5,7 -5,6 +5,7 @@@
  #include <linux/scatterlist.h>
  #include <asm/cacheflush.h>
  #include <asm/io.h>
 +#include <asm-generic/dma-coherent.h>
  
  extern struct bus_type pci_bus_type;
  
@@@ -172,7 -171,7 +172,7 @@@ static inline int dma_get_cache_alignme
        return L1_CACHE_BYTES;
  }
  
- static inline int dma_mapping_error(dma_addr_t dma_addr)
+ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
  {
        return dma_addr == 0;
  }
index c68f360ef5642c9b6691861940124cce38b5a0ad,0eaa9bf6011fca2987c0b8731c3b25c8113dc820..ad9cd6d49bfc9bc624747709da188301b35f5b55
@@@ -14,11 -14,11 +14,11 @@@ extern dma_addr_t bad_dma_address
  extern int iommu_merge;
  extern struct device fallback_dev;
  extern int panic_on_overflow;
- extern int forbid_dac;
  extern int force_iommu;
  
  struct dma_mapping_ops {
-       int             (*mapping_error)(dma_addr_t dma_addr);
+       int             (*mapping_error)(struct device *dev,
+                                        dma_addr_t dma_addr);
        void*           (*alloc_coherent)(struct device *dev, size_t size,
                                dma_addr_t *dma_handle, gfp_t gfp);
        void            (*free_coherent)(struct device *dev, size_t size,
        int             is_phys;
  };
  
- extern const struct dma_mapping_ops *dma_ops;
+ extern struct dma_mapping_ops *dma_ops;
  
- static inline int dma_mapping_error(dma_addr_t dma_addr)
+ static inline struct dma_mapping_ops *get_dma_ops(struct device *dev)
  {
-       if (dma_ops->mapping_error)
-               return dma_ops->mapping_error(dma_addr);
+ #ifdef CONFIG_X86_32
+       return dma_ops;
+ #else
+       if (unlikely(!dev) || !dev->archdata.dma_ops)
+               return dma_ops;
+       else
+               return dev->archdata.dma_ops;
+ #endif
+ }
+ /* Make sure we keep the same behaviour */
+ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
+ {
+ #ifdef CONFIG_X86_32
+       return 0;
+ #else
+       struct dma_mapping_ops *ops = get_dma_ops(dev);
+       if (ops->mapping_error)
+               return ops->mapping_error(dev, dma_addr);
  
        return (dma_addr == bad_dma_address);
+ #endif
  }
  
  #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
@@@ -84,44 -102,53 +102,53 @@@ static inline dma_addr_
  dma_map_single(struct device *hwdev, void *ptr, size_t size,
               int direction)
  {
+       struct dma_mapping_ops *ops = get_dma_ops(hwdev);
        BUG_ON(!valid_dma_direction(direction));
-       return dma_ops->map_single(hwdev, virt_to_phys(ptr), size, direction);
+       return ops->map_single(hwdev, virt_to_phys(ptr), size, direction);
  }
  
  static inline void
  dma_unmap_single(struct device *dev, dma_addr_t addr, size_t size,
                 int direction)
  {
+       struct dma_mapping_ops *ops = get_dma_ops(dev);
        BUG_ON(!valid_dma_direction(direction));
-       if (dma_ops->unmap_single)
-               dma_ops->unmap_single(dev, addr, size, direction);
+       if (ops->unmap_single)
+               ops->unmap_single(dev, addr, size, direction);
  }
  
  static inline int
  dma_map_sg(struct device *hwdev, struct scatterlist *sg,
           int nents, int direction)
  {
+       struct dma_mapping_ops *ops = get_dma_ops(hwdev);
        BUG_ON(!valid_dma_direction(direction));
-       return dma_ops->map_sg(hwdev, sg, nents, direction);
+       return ops->map_sg(hwdev, sg, nents, direction);
  }
  
  static inline void
  dma_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents,
             int direction)
  {
+       struct dma_mapping_ops *ops = get_dma_ops(hwdev);
        BUG_ON(!valid_dma_direction(direction));
-       if (dma_ops->unmap_sg)
-               dma_ops->unmap_sg(hwdev, sg, nents, direction);
+       if (ops->unmap_sg)
+               ops->unmap_sg(hwdev, sg, nents, direction);
  }
  
  static inline void
  dma_sync_single_for_cpu(struct device *hwdev, dma_addr_t dma_handle,
                        size_t size, int direction)
  {
+       struct dma_mapping_ops *ops = get_dma_ops(hwdev);
        BUG_ON(!valid_dma_direction(direction));
-       if (dma_ops->sync_single_for_cpu)
-               dma_ops->sync_single_for_cpu(hwdev, dma_handle, size,
-                                            direction);
+       if (ops->sync_single_for_cpu)
+               ops->sync_single_for_cpu(hwdev, dma_handle, size, direction);
        flush_write_buffers();
  }
  
@@@ -129,10 -156,11 +156,11 @@@ static inline voi
  dma_sync_single_for_device(struct device *hwdev, dma_addr_t dma_handle,
                           size_t size, int direction)
  {
+       struct dma_mapping_ops *ops = get_dma_ops(hwdev);
        BUG_ON(!valid_dma_direction(direction));
-       if (dma_ops->sync_single_for_device)
-               dma_ops->sync_single_for_device(hwdev, dma_handle, size,
-                                               direction);
+       if (ops->sync_single_for_device)
+               ops->sync_single_for_device(hwdev, dma_handle, size, direction);
        flush_write_buffers();
  }
  
@@@ -140,11 -168,12 +168,12 @@@ static inline voi
  dma_sync_single_range_for_cpu(struct device *hwdev, dma_addr_t dma_handle,
                              unsigned long offset, size_t size, int direction)
  {
-       BUG_ON(!valid_dma_direction(direction));
-       if (dma_ops->sync_single_range_for_cpu)
-               dma_ops->sync_single_range_for_cpu(hwdev, dma_handle, offset,
-                                                  size, direction);
+       struct dma_mapping_ops *ops = get_dma_ops(hwdev);
  
+       BUG_ON(!valid_dma_direction(direction));
+       if (ops->sync_single_range_for_cpu)
+               ops->sync_single_range_for_cpu(hwdev, dma_handle, offset,
+                                              size, direction);
        flush_write_buffers();
  }
  
@@@ -153,11 -182,12 +182,12 @@@ dma_sync_single_range_for_device(struc
                                 unsigned long offset, size_t size,
                                 int direction)
  {
-       BUG_ON(!valid_dma_direction(direction));
-       if (dma_ops->sync_single_range_for_device)
-               dma_ops->sync_single_range_for_device(hwdev, dma_handle,
-                                                     offset, size, direction);
+       struct dma_mapping_ops *ops = get_dma_ops(hwdev);
  
+       BUG_ON(!valid_dma_direction(direction));
+       if (ops->sync_single_range_for_device)
+               ops->sync_single_range_for_device(hwdev, dma_handle,
+                                                 offset, size, direction);
        flush_write_buffers();
  }
  
@@@ -165,9 -195,11 +195,11 @@@ static inline voi
  dma_sync_sg_for_cpu(struct device *hwdev, struct scatterlist *sg,
                    int nelems, int direction)
  {
+       struct dma_mapping_ops *ops = get_dma_ops(hwdev);
        BUG_ON(!valid_dma_direction(direction));
-       if (dma_ops->sync_sg_for_cpu)
-               dma_ops->sync_sg_for_cpu(hwdev, sg, nelems, direction);
+       if (ops->sync_sg_for_cpu)
+               ops->sync_sg_for_cpu(hwdev, sg, nelems, direction);
        flush_write_buffers();
  }
  
@@@ -175,9 -207,11 +207,11 @@@ static inline voi
  dma_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg,
                       int nelems, int direction)
  {
+       struct dma_mapping_ops *ops = get_dma_ops(hwdev);
        BUG_ON(!valid_dma_direction(direction));
-       if (dma_ops->sync_sg_for_device)
-               dma_ops->sync_sg_for_device(hwdev, sg, nelems, direction);
+       if (ops->sync_sg_for_device)
+               ops->sync_sg_for_device(hwdev, sg, nelems, direction);
  
        flush_write_buffers();
  }
@@@ -186,9 -220,11 +220,11 @@@ static inline dma_addr_t dma_map_page(s
                                      size_t offset, size_t size,
                                      int direction)
  {
+       struct dma_mapping_ops *ops = get_dma_ops(dev);
        BUG_ON(!valid_dma_direction(direction));
-       return dma_ops->map_single(dev, page_to_phys(page)+offset,
-                                  size, direction);
+       return ops->map_single(dev, page_to_phys(page) + offset,
+                              size, direction);
  }
  
  static inline void dma_unmap_page(struct device *dev, dma_addr_t addr,
@@@ -213,5 -249,25 +249,5 @@@ static inline int dma_get_cache_alignme
  
  #define dma_is_consistent(d, h)       (1)
  
 -#ifdef CONFIG_X86_32
 -#  define ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY
 -struct dma_coherent_mem {
 -      void            *virt_base;
 -      u32             device_base;
 -      int             size;
 -      int             flags;
 -      unsigned long   *bitmap;
 -};
 -
 -extern int
 -dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
 -                          dma_addr_t device_addr, size_t size, int flags);
 -
 -extern void
 -dma_release_declared_memory(struct device *dev);
 -
 -extern void *
 -dma_mark_declared_memory_occupied(struct device *dev,
 -                                dma_addr_t device_addr, size_t size);
 -#endif /* CONFIG_X86_32 */
 +#include <asm-generic/dma-coherent.h>
  #endif
diff --combined init/Kconfig
index 63cdbd8bd3d523dda94c82b7d509a49c02c95afa,43d6989c275f3432a0404771af92015f13717a01..250e02c8f8f9b6f68e33a008b5cab014068b8902
@@@ -171,7 -171,7 +171,7 @@@ config BSD_PROCESS_ACCT_V
          process and it's parent. Note that this file format is incompatible
          with previous v0/v1/v2 file formats, so you will need updated tools
          for processing it. A preliminary version of these tools is available
-         at <http://www.physik3.uni-rostock.de/tim/kernel/utils/acct/>.
+         at <http://www.gnu.org/software/acct/>.
  
  config TASKSTATS
        bool "Export task/process statistics through netlink (EXPERIMENTAL)"
@@@ -486,7 -486,7 +486,7 @@@ config PID_N
        default n
        depends on NAMESPACES && EXPERIMENTAL
        help
-         Suport process id namespaces.  This allows having multiple
+         Support process id namespaces.  This allows having multiple
          process with the same pid as long as they are in different
          pid namespaces.  This is a building block of containers.
  
@@@ -802,10 -802,6 +802,10 @@@ config PROC_PAGE_MONITO
  
  endmenu               # General setup
  
 +config HAVE_GENERIC_DMA_COHERENT
 +      bool
 +      default n
 +
  config SLABINFO
        bool
        depends on PROC_FS
@@@ -860,8 -856,8 +860,8 @@@ config MODULE_UNLOA
        help
          Without this option you will not be able to unload any
          modules (note that some modules may not be unloadable
-         anyway), which makes your kernel slightly smaller and
-         simpler.  If unsure, say Y.
+         anyway), which makes your kernel smaller, faster
+         and simpler.  If unsure, say Y.
  
  config MODULE_FORCE_UNLOAD
        bool "Forced module unloading"
@@@ -897,16 -893,11 +897,11 @@@ config MODULE_SRCVERSION_AL
          will be created for all modules.  If unsure, say N.
  
  config KMOD
-       bool "Automatic kernel module loading"
+       def_bool y
        depends on MODULES
        help
-         Normally when you have selected some parts of the kernel to
-         be created as kernel modules, you must load them (using the
-         "modprobe" command) before you can use them. If you say Y
-         here, some parts of the kernel will be able to load modules
-         automatically: when a part of the kernel needs a module, it
-         runs modprobe with the appropriate arguments, thereby
-         loading the module if it is available.  If unsure, say Y.
+         This is being removed soon.  These days, CONFIG_MODULES
+         implies CONFIG_KMOD, so use that instead.
  
  config STOP_MACHINE
        bool
diff --combined kernel/Makefile
index e25ee775dc917bb97a88d2ef0a2f45ba1cfec6ee,54f69837d35a3fa26bfa94c798d9b48332d2d3ac..4e1d7df7c3e279af83ae70f2f70c9196044514f2
@@@ -2,7 -2,7 +2,7 @@@
  # Makefile for the linux kernel.
  #
  
- obj-y     = sched.o fork.o exec_domain.o panic.o printk.o profile.o \
+ obj-y     = sched.o fork.o exec_domain.o panic.o printk.o \
            cpu.o exit.o itimer.o time.o softirq.o resource.o \
            sysctl.o capability.o ptrace.o timer.o user.o \
            signal.o sys.o kmod.o workqueue.o pid.o \
@@@ -11,6 -11,8 +11,8 @@@
            hrtimer.o rwsem.o nsproxy.o srcu.o semaphore.o \
            notifier.o ksysfs.o pm_qos_params.o sched_clock.o
  
+ CFLAGS_REMOVE_sched.o = -mno-spe
  ifdef CONFIG_FTRACE
  # Do not trace debug files and internal ftrace files
  CFLAGS_REMOVE_lockdep.o = -pg
@@@ -22,6 -24,7 +24,7 @@@ CFLAGS_REMOVE_sched_clock.o = -p
  CFLAGS_REMOVE_sched.o = -mno-spe -pg
  endif
  
+ obj-$(CONFIG_PROFILING) += profile.o
  obj-$(CONFIG_SYSCTL_SYSCALL_CHECK) += sysctl_check.o
  obj-$(CONFIG_STACKTRACE) += stacktrace.o
  obj-y += time/
@@@ -81,7 -84,6 +84,7 @@@ obj-$(CONFIG_TASK_DELAY_ACCT) += delaya
  obj-$(CONFIG_TASKSTATS) += taskstats.o tsacct.o
  obj-$(CONFIG_MARKERS) += marker.o
  obj-$(CONFIG_LATENCYTOP) += latencytop.o
 +obj-$(CONFIG_HAVE_GENERIC_DMA_COHERENT) += dma-coherent.o
  obj-$(CONFIG_FTRACE) += trace/
  obj-$(CONFIG_TRACING) += trace/
  obj-$(CONFIG_SMP) += sched_cpupri.o
This page took 0.130826 seconds and 4 git commands to generate.