Merge branch 'drm-intel-next' of git://git.kernel.org/pub/scm/linux/kernel/git/anholt...
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 29 May 2009 15:48:13 +0000 (08:48 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 29 May 2009 15:48:13 +0000 (08:48 -0700)
* 'drm-intel-next' of git://git.kernel.org/pub/scm/linux/kernel/git/anholt/drm-intel:
  i915: Set object to gtt domain when faulting it back in
  drm/i915: Apply a big hammer to 865 GEM object CPU cache flushing.
  drm/i915: Fix tiling pitch handling on 8xx.

58 files changed:
Documentation/sound/alsa/Procfile.txt
MAINTAINERS
arch/arm/include/asm/flat.h
arch/blackfin/include/asm/.gitignore [deleted file]
arch/blackfin/include/asm/flat.h
arch/blackfin/include/asm/unistd.h
arch/blackfin/kernel/.gitignore [new file with mode: 0644]
arch/blackfin/lib/strncmp.c
arch/blackfin/mach-common/entry.S
arch/h8300/include/asm/flat.h
arch/m32r/include/asm/flat.h
arch/m68k/include/asm/flat.h
arch/powerpc/Kconfig
arch/powerpc/include/asm/dma-mapping.h
arch/powerpc/include/asm/fixmap.h
arch/powerpc/include/asm/pgtable-ppc32.h
arch/powerpc/kernel/dma.c
arch/powerpc/lib/Makefile
arch/powerpc/lib/dma-noncoherent.c [deleted file]
arch/powerpc/mm/Makefile
arch/powerpc/mm/dma-noncoherent.c [new file with mode: 0644]
arch/powerpc/mm/init_32.c
arch/powerpc/mm/mem.c
arch/powerpc/mm/pgtable_32.c
arch/sh/include/asm/flat.h
arch/x86/mm/hugetlbpage.c
drivers/edac/Kconfig
drivers/edac/Makefile
drivers/edac/amd8111_edac.c
drivers/edac/amd8131_edac.c
drivers/md/raid5.c
drivers/parport/parport_gsc.c
drivers/serial/8250.c
drivers/serial/8250_gsc.c
drivers/serial/mpc52xx_uart.c
drivers/video/atmel_lcdfb.c
drivers/video/s3c-fb.c
fs/binfmt_flat.c
fs/cachefiles/internal.h
fs/fscache/internal.h
fs/proc/base.c
include/linux/cred.h
include/linux/swap.h
mm/filemap.c
mm/hugetlb.c
mm/memcontrol.c
mm/oom_kill.c
mm/swap_state.c
mm/truncate.c
mm/vmscan.c
security/tomoyo/tomoyo.c
sound/core/pcm_lib.c
sound/core/pcm_native.c
sound/pci/hda/patch_conexant.c
sound/usb/usbaudio.c
sound/usb/usbaudio.h
sound/usb/usbmidi.c
sound/usb/usbquirks.h

index bba2dbb..cfac20c 100644 (file)
@@ -104,6 +104,11 @@ card*/pcm*/xrun_debug
        When this value is greater than 1, the driver will show the
        stack trace additionally.  This may help the debugging.
 
+       Since 2.6.30, this option also enables the hwptr check using
+       jiffies.  This detects spontaneous invalid pointer callback
+       values, but can be lead to too much corrections for a (mostly
+       buggy) hardware that doesn't give smooth pointer updates.
+
 card*/pcm*/sub*/info
        The general information of this PCM sub-stream.
 
index 77cbfb1..41c6605 100644 (file)
@@ -434,7 +434,7 @@ F:  arch/alpha/
 
 AMD GEODE CS5536 USB DEVICE CONTROLLER DRIVER
 P:     Thomas Dahlmann
-M:     thomas.dahlmann@amd.com
+M:     dahlmann.thomas@arcor.de
 L:     linux-geode@lists.infradead.org (moderated for non-subscribers)
 S:     Supported
 F:     drivers/usb/gadget/amd5536udc.*
@@ -1132,17 +1132,17 @@ F:      fs/bfs/
 F:     include/linux/bfs_fs.h
 
 BLACKFIN ARCHITECTURE
-P:     Bryan Wu
-M:     cooloney@kernel.org
+P:     Mike Frysinger
+M:     vapier@gentoo.org
 L:     uclinux-dist-devel@blackfin.uclinux.org
 W:     http://blackfin.uclinux.org
 S:     Supported
 F:     arch/blackfin/
 
 BLACKFIN EMAC DRIVER
-P:     Bryan Wu
-M:     cooloney@kernel.org
-L:     uclinux-dist-devel@blackfin.uclinux.org (subscribers-only)
+P:     Michael Hennerich
+M:     michael.hennerich@analog.com
+L:     uclinux-dist-devel@blackfin.uclinux.org
 W:     http://blackfin.uclinux.org
 S:     Supported
 F:     drivers/net/bfin_mac.*
@@ -1150,7 +1150,7 @@ F:        drivers/net/bfin_mac.*
 BLACKFIN RTC DRIVER
 P:     Mike Frysinger
 M:     vapier.adi@gmail.com
-L:     uclinux-dist-devel@blackfin.uclinux.org (subscribers-only)
+L:     uclinux-dist-devel@blackfin.uclinux.org
 W:     http://blackfin.uclinux.org
 S:     Supported
 F:     drivers/rtc/rtc-bfin.c
@@ -1158,7 +1158,7 @@ F:        drivers/rtc/rtc-bfin.c
 BLACKFIN SERIAL DRIVER
 P:     Sonic Zhang
 M:     sonic.zhang@analog.com
-L:     uclinux-dist-devel@blackfin.uclinux.org (subscribers-only)
+L:     uclinux-dist-devel@blackfin.uclinux.org
 W:     http://blackfin.uclinux.org
 S:     Supported
 F:     drivers/serial/bfin_5xx.c
@@ -1166,7 +1166,7 @@ F:        drivers/serial/bfin_5xx.c
 BLACKFIN WATCHDOG DRIVER
 P:     Mike Frysinger
 M:     vapier.adi@gmail.com
-L:     uclinux-dist-devel@blackfin.uclinux.org (subscribers-only)
+L:     uclinux-dist-devel@blackfin.uclinux.org
 W:     http://blackfin.uclinux.org
 S:     Supported
 F:     drivers/watchdog/bfin_wdt.c
@@ -1174,7 +1174,7 @@ F:        drivers/watchdog/bfin_wdt.c
 BLACKFIN I2C TWI DRIVER
 P:     Sonic Zhang
 M:     sonic.zhang@analog.com
-L:     uclinux-dist-devel@blackfin.uclinux.org (subscribers-only)
+L:     uclinux-dist-devel@blackfin.uclinux.org
 W:     http://blackfin.uclinux.org/
 S:     Supported
 F:     drivers/i2c/busses/i2c-bfin-twi.c
@@ -1971,8 +1971,8 @@ F:        include/linux/edac.h
 
 EDAC-E752X
 P:     Mark Gross
-P:     Doug Thompson
 M:     mark.gross@intel.com
+P:     Doug Thompson
 M:     dougthompson@xmission.com
 L:     bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers)
 W:     bluesmoke.sourceforge.net
index 1d77e51..59426a4 100644 (file)
@@ -5,9 +5,6 @@
 #ifndef __ARM_FLAT_H__
 #define __ARM_FLAT_H__
 
-/* An odd number of words will be pushed after this alignment, so
-   deliberately misalign the value.  */
-#define        flat_stack_align(sp)    sp = (void *)(((unsigned long)(sp) - 4) | 4)
 #define        flat_argvp_envp_on_stack()              1
 #define        flat_old_ram_flag(flags)                (flags)
 #define        flat_reloc_valid(reloc, size)           ((reloc) <= (size))
diff --git a/arch/blackfin/include/asm/.gitignore b/arch/blackfin/include/asm/.gitignore
deleted file mode 100644 (file)
index 7858564..0000000
+++ /dev/null
@@ -1 +0,0 @@
-+mach
index e70074e..733a178 100644 (file)
@@ -10,7 +10,6 @@
 
 #include <asm/unaligned.h>
 
-#define        flat_stack_align(sp)    /* nothing needed */
 #define        flat_argvp_envp_on_stack()              0
 #define        flat_old_ram_flag(flags)                (flags)
 
index 1e57b63..cf5066d 100644 (file)
 #define __NR_dup3              363
 #define __NR_pipe2             364
 #define __NR_inotify_init1     365
+#define __NR_preadv            366
+#define __NR_pwritev           367
 
-#define __NR_syscall           366
+#define __NR_syscall           368
 #define NR_syscalls            __NR_syscall
 
 /* Old optional stuff no one actually uses */
diff --git a/arch/blackfin/kernel/.gitignore b/arch/blackfin/kernel/.gitignore
new file mode 100644 (file)
index 0000000..c5f676c
--- /dev/null
@@ -0,0 +1 @@
+vmlinux.lds
index 2aaae78..46518b1 100644 (file)
@@ -8,9 +8,8 @@
 
 #define strncmp __inline_strncmp
 #include <asm/string.h>
-#undef strncmp
-
 #include <linux/module.h>
+#undef strncmp
 
 int strncmp(const char *cs, const char *ct, size_t count)
 {
index 21e65a3..a063a43 100644 (file)
@@ -1581,6 +1581,8 @@ ENTRY(_sys_call_table)
        .long _sys_dup3
        .long _sys_pipe2
        .long _sys_inotify_init1        /* 365 */
+       .long _sys_preadv
+       .long _sys_pwritev
 
        .rept NR_syscalls-(.-_sys_call_table)/4
        .long _sys_ni_syscall
index 2a87350..bd12b31 100644 (file)
@@ -5,7 +5,6 @@
 #ifndef __H8300_FLAT_H__
 #define __H8300_FLAT_H__
 
-#define        flat_stack_align(sp)                    /* nothing needed */
 #define        flat_argvp_envp_on_stack()              1
 #define        flat_old_ram_flag(flags)                1
 #define        flat_reloc_valid(reloc, size)           ((reloc) <= (size))
index d851cf0..5d711c4 100644 (file)
@@ -12,7 +12,6 @@
 #ifndef __ASM_M32R_FLAT_H
 #define __ASM_M32R_FLAT_H
 
-#define        flat_stack_align(sp)            (*sp += (*sp & 3 ? (4 - (*sp & 3)): 0))
 #define        flat_argvp_envp_on_stack()              0
 #define        flat_old_ram_flag(flags)                (flags)
 #define        flat_set_persistent(relval, p)          0
index 814b517..a0e2907 100644 (file)
@@ -5,7 +5,6 @@
 #ifndef __M68KNOMMU_FLAT_H__
 #define __M68KNOMMU_FLAT_H__
 
-#define        flat_stack_align(sp)                    /* nothing needed */
 #define        flat_argvp_envp_on_stack()              1
 #define        flat_old_ram_flag(flags)                (flags)
 #define        flat_reloc_valid(reloc, size)           ((reloc) <= (size))
index a0d1146..cdc9a6f 100644 (file)
@@ -868,6 +868,18 @@ config TASK_SIZE
        default "0x80000000" if PPC_PREP || PPC_8xx
        default "0xc0000000"
 
+config CONSISTENT_SIZE_BOOL
+       bool "Set custom consistent memory pool size"
+       depends on ADVANCED_OPTIONS && NOT_COHERENT_CACHE
+       help
+         This option allows you to set the size of the
+         consistent memory pool.  This pool of virtual memory
+         is used to make consistent memory allocations.
+
+config CONSISTENT_SIZE
+       hex "Size of consistent memory pool" if CONSISTENT_SIZE_BOOL
+       default "0x00200000" if NOT_COHERENT_CACHE
+
 config PIN_TLB
        bool "Pinned Kernel TLBs (860 ONLY)"
        depends on ADVANCED_OPTIONS && 8xx
index c69f2b5..cb448d6 100644 (file)
@@ -26,7 +26,9 @@
  * allocate the space "normally" and use the cache management functions
  * to ensure it is consistent.
  */
-extern void *__dma_alloc_coherent(size_t size, dma_addr_t *handle, gfp_t gfp);
+struct device;
+extern void *__dma_alloc_coherent(struct device *dev, size_t size,
+                                 dma_addr_t *handle, gfp_t gfp);
 extern void __dma_free_coherent(size_t size, void *vaddr);
 extern void __dma_sync(void *vaddr, size_t size, int direction);
 extern void __dma_sync_page(struct page *page, unsigned long offset,
@@ -37,7 +39,7 @@ extern void __dma_sync_page(struct page *page, unsigned long offset,
  * Cache coherent cores.
  */
 
-#define __dma_alloc_coherent(gfp, size, handle)        NULL
+#define __dma_alloc_coherent(dev, gfp, size, handle)   NULL
 #define __dma_free_coherent(size, addr)                ((void)0)
 #define __dma_sync(addr, size, rw)             ((void)0)
 #define __dma_sync_page(pg, off, sz, rw)       ((void)0)
index d60fd18..f1f4e23 100644 (file)
@@ -14,8 +14,6 @@
 #ifndef _ASM_FIXMAP_H
 #define _ASM_FIXMAP_H
 
-extern unsigned long FIXADDR_TOP;
-
 #ifndef __ASSEMBLY__
 #include <linux/kernel.h>
 #include <asm/page.h>
@@ -24,6 +22,8 @@ extern unsigned long FIXADDR_TOP;
 #include <asm/kmap_types.h>
 #endif
 
+#define FIXADDR_TOP    ((unsigned long)(-PAGE_SIZE))
+
 /*
  * Here we define all the compile-time 'special' virtual
  * addresses. The point is to have a constant address at
index ba45c99..c9ff9d7 100644 (file)
@@ -10,7 +10,7 @@
 
 extern unsigned long va_to_phys(unsigned long address);
 extern pte_t *va_to_pte(unsigned long address);
-extern unsigned long ioremap_bot, ioremap_base;
+extern unsigned long ioremap_bot;
 
 #ifdef CONFIG_44x
 extern int icache_44x_need_flush;
@@ -56,8 +56,30 @@ extern int icache_44x_need_flush;
        printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))
 
 /*
+ * This is the bottom of the PKMAP area with HIGHMEM or an arbitrary
+ * value (for now) on others, from where we can start layout kernel
+ * virtual space that goes below PKMAP and FIXMAP
+ */
+#ifdef CONFIG_HIGHMEM
+#define KVIRT_TOP      PKMAP_BASE
+#else
+#define KVIRT_TOP      (0xfe000000UL)  /* for now, could be FIXMAP_BASE ? */
+#endif
+
+/*
+ * ioremap_bot starts at that address. Early ioremaps move down from there,
+ * until mem_init() at which point this becomes the top of the vmalloc
+ * and ioremap space
+ */
+#ifdef CONFIG_NOT_COHERENT_CACHE
+#define IOREMAP_TOP    ((KVIRT_TOP - CONFIG_CONSISTENT_SIZE) & PAGE_MASK)
+#else
+#define IOREMAP_TOP    KVIRT_TOP
+#endif
+
+/*
  * Just any arbitrary offset to the start of the vmalloc VM area: the
- * current 64MB value just means that there will be a 64MB "hole" after the
+ * current 16MB value just means that there will be a 64MB "hole" after the
  * physical memory until the kernel virtual memory starts.  That means that
  * any out-of-bounds memory accesses will hopefully be caught.
  * The vmalloc() routines leaves a hole of 4kB between each vmalloced
index 53c7788..6b02793 100644 (file)
@@ -32,7 +32,7 @@ void *dma_direct_alloc_coherent(struct device *dev, size_t size,
 {
        void *ret;
 #ifdef CONFIG_NOT_COHERENT_CACHE
-       ret = __dma_alloc_coherent(size, dma_handle, flag);
+       ret = __dma_alloc_coherent(dev, size, dma_handle, flag);
        if (ret == NULL)
                return NULL;
        *dma_handle += get_dma_direct_offset(dev);
index 8db3527..29b742b 100644 (file)
@@ -18,7 +18,6 @@ obj-$(CONFIG_PPC64)   += copypage_64.o copyuser_64.o \
                           memcpy_64.o usercopy_64.o mem_64.o string.o
 obj-$(CONFIG_XMON)     += sstep.o
 obj-$(CONFIG_KPROBES)  += sstep.o
-obj-$(CONFIG_NOT_COHERENT_CACHE)       += dma-noncoherent.o
 
 ifeq ($(CONFIG_PPC64),y)
 obj-$(CONFIG_SMP)      += locks.o
diff --git a/arch/powerpc/lib/dma-noncoherent.c b/arch/powerpc/lib/dma-noncoherent.c
deleted file mode 100644 (file)
index 005a28d..0000000
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- *  PowerPC version derived from arch/arm/mm/consistent.c
- *    Copyright (C) 2001 Dan Malek (dmalek@jlc.net)
- *
- *  Copyright (C) 2000 Russell King
- *
- * Consistent memory allocators.  Used for DMA devices that want to
- * share uncached memory with the processor core.  The function return
- * is the virtual address and 'dma_handle' is the physical address.
- * Mostly stolen from the ARM port, with some changes for PowerPC.
- *                                             -- Dan
- *
- * Reorganized to get rid of the arch-specific consistent_* functions
- * and provide non-coherent implementations for the DMA API. -Matt
- *
- * Added in_interrupt() safe dma_alloc_coherent()/dma_free_coherent()
- * implementation. This is pulled straight from ARM and barely
- * modified. -Matt
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include <linux/sched.h>
-#include <linux/kernel.h>
-#include <linux/errno.h>
-#include <linux/string.h>
-#include <linux/types.h>
-#include <linux/highmem.h>
-#include <linux/dma-mapping.h>
-#include <linux/vmalloc.h>
-
-#include <asm/tlbflush.h>
-
-/*
- * Allocate DMA-coherent memory space and return both the kernel remapped
- * virtual and bus address for that space.
- */
-void *
-__dma_alloc_coherent(size_t size, dma_addr_t *handle, gfp_t gfp)
-{
-       struct page *page;
-       unsigned long order;
-       int i;
-       unsigned int nr_pages = PAGE_ALIGN(size)>>PAGE_SHIFT;
-       unsigned int array_size = nr_pages * sizeof(struct page *);
-       struct page **pages;
-       struct page *end;
-       u64 mask = 0x00ffffff, limit; /* ISA default */
-       struct vm_struct *area;
-
-       BUG_ON(!mem_init_done);
-       size = PAGE_ALIGN(size);
-       limit = (mask + 1) & ~mask;
-       if (limit && size >= limit) {
-               printk(KERN_WARNING "coherent allocation too big (requested "
-                               "%#x mask %#Lx)\n", size, mask);
-               return NULL;
-       }
-
-       order = get_order(size);
-
-       if (mask != 0xffffffff)
-               gfp |= GFP_DMA;
-
-       page = alloc_pages(gfp, order);
-       if (!page)
-               goto no_page;
-
-       end = page + (1 << order);
-
-       /*
-        * Invalidate any data that might be lurking in the
-        * kernel direct-mapped region for device DMA.
-        */
-       {
-               unsigned long kaddr = (unsigned long)page_address(page);
-               memset(page_address(page), 0, size);
-               flush_dcache_range(kaddr, kaddr + size);
-       }
-
-       split_page(page, order);
-
-       /*
-        * Set the "dma handle"
-        */
-       *handle = page_to_phys(page);
-
-       area = get_vm_area_caller(size, VM_IOREMAP,
-                       __builtin_return_address(1));
-       if (!area)
-               goto out_free_pages;
-
-       if (array_size > PAGE_SIZE) {
-               pages = vmalloc(array_size);
-               area->flags |= VM_VPAGES;
-       } else {
-               pages = kmalloc(array_size, GFP_KERNEL);
-       }
-       if (!pages)
-               goto out_free_area;
-
-       area->pages = pages;
-       area->nr_pages = nr_pages;
-
-       for (i = 0; i < nr_pages; i++)
-               pages[i] = page + i;
-
-       if (map_vm_area(area, pgprot_noncached(PAGE_KERNEL), &pages))
-               goto out_unmap;
-
-       /*
-        * Free the otherwise unused pages.
-        */
-       page += nr_pages;
-       while (page < end) {
-               __free_page(page);
-               page++;
-       }
-
-       return area->addr;
-out_unmap:
-       vunmap(area->addr);
-       if (array_size > PAGE_SIZE)
-               vfree(pages);
-       else
-               kfree(pages);
-       goto out_free_pages;
-out_free_area:
-       free_vm_area(area);
-out_free_pages:
-       if (page)
-               __free_pages(page, order);
-no_page:
-       return NULL;
-}
-EXPORT_SYMBOL(__dma_alloc_coherent);
-
-/*
- * free a page as defined by the above mapping.
- */
-void __dma_free_coherent(size_t size, void *vaddr)
-{
-       vfree(vaddr);
-
-}
-EXPORT_SYMBOL(__dma_free_coherent);
-
-/*
- * make an area consistent.
- */
-void __dma_sync(void *vaddr, size_t size, int direction)
-{
-       unsigned long start = (unsigned long)vaddr;
-       unsigned long end   = start + size;
-
-       switch (direction) {
-       case DMA_NONE:
-               BUG();
-       case DMA_FROM_DEVICE:
-               /*
-                * invalidate only when cache-line aligned otherwise there is
-                * the potential for discarding uncommitted data from the cache
-                */
-               if ((start & (L1_CACHE_BYTES - 1)) || (size & (L1_CACHE_BYTES - 1)))
-                       flush_dcache_range(start, end);
-               else
-                       invalidate_dcache_range(start, end);
-               break;
-       case DMA_TO_DEVICE:             /* writeback only */
-               clean_dcache_range(start, end);
-               break;
-       case DMA_BIDIRECTIONAL: /* writeback and invalidate */
-               flush_dcache_range(start, end);
-               break;
-       }
-}
-EXPORT_SYMBOL(__dma_sync);
-
-#ifdef CONFIG_HIGHMEM
-/*
- * __dma_sync_page() implementation for systems using highmem.
- * In this case, each page of a buffer must be kmapped/kunmapped
- * in order to have a virtual address for __dma_sync(). This must
- * not sleep so kmap_atomic()/kunmap_atomic() are used.
- *
- * Note: yes, it is possible and correct to have a buffer extend
- * beyond the first page.
- */
-static inline void __dma_sync_page_highmem(struct page *page,
-               unsigned long offset, size_t size, int direction)
-{
-       size_t seg_size = min((size_t)(PAGE_SIZE - offset), size);
-       size_t cur_size = seg_size;
-       unsigned long flags, start, seg_offset = offset;
-       int nr_segs = 1 + ((size - seg_size) + PAGE_SIZE - 1)/PAGE_SIZE;
-       int seg_nr = 0;
-
-       local_irq_save(flags);
-
-       do {
-               start = (unsigned long)kmap_atomic(page + seg_nr,
-                               KM_PPC_SYNC_PAGE) + seg_offset;
-
-               /* Sync this buffer segment */
-               __dma_sync((void *)start, seg_size, direction);
-               kunmap_atomic((void *)start, KM_PPC_SYNC_PAGE);
-               seg_nr++;
-
-               /* Calculate next buffer segment size */
-               seg_size = min((size_t)PAGE_SIZE, size - cur_size);
-
-               /* Add the segment size to our running total */
-               cur_size += seg_size;
-               seg_offset = 0;
-       } while (seg_nr < nr_segs);
-
-       local_irq_restore(flags);
-}
-#endif /* CONFIG_HIGHMEM */
-
-/*
- * __dma_sync_page makes memory consistent. identical to __dma_sync, but
- * takes a struct page instead of a virtual address
- */
-void __dma_sync_page(struct page *page, unsigned long offset,
-       size_t size, int direction)
-{
-#ifdef CONFIG_HIGHMEM
-       __dma_sync_page_highmem(page, offset, size, direction);
-#else
-       unsigned long start = (unsigned long)page_address(page) + offset;
-       __dma_sync((void *)start, size, direction);
-#endif
-}
-EXPORT_SYMBOL(__dma_sync_page);
index 17290bc..b746f4c 100644 (file)
@@ -26,3 +26,4 @@ obj-$(CONFIG_NEED_MULTIPLE_NODES) += numa.o
 obj-$(CONFIG_PPC_MM_SLICES)    += slice.o
 obj-$(CONFIG_HUGETLB_PAGE)     += hugetlbpage.o
 obj-$(CONFIG_PPC_SUBPAGE_PROT) += subpage-prot.o
+obj-$(CONFIG_NOT_COHERENT_CACHE) += dma-noncoherent.o
diff --git a/arch/powerpc/mm/dma-noncoherent.c b/arch/powerpc/mm/dma-noncoherent.c
new file mode 100644 (file)
index 0000000..36692f5
--- /dev/null
@@ -0,0 +1,400 @@
+/*
+ *  PowerPC version derived from arch/arm/mm/consistent.c
+ *    Copyright (C) 2001 Dan Malek (dmalek@jlc.net)
+ *
+ *  Copyright (C) 2000 Russell King
+ *
+ * Consistent memory allocators.  Used for DMA devices that want to
+ * share uncached memory with the processor core.  The function return
+ * is the virtual address and 'dma_handle' is the physical address.
+ * Mostly stolen from the ARM port, with some changes for PowerPC.
+ *                                             -- Dan
+ *
+ * Reorganized to get rid of the arch-specific consistent_* functions
+ * and provide non-coherent implementations for the DMA API. -Matt
+ *
+ * Added in_interrupt() safe dma_alloc_coherent()/dma_free_coherent()
+ * implementation. This is pulled straight from ARM and barely
+ * modified. -Matt
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/sched.h>
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/string.h>
+#include <linux/types.h>
+#include <linux/highmem.h>
+#include <linux/dma-mapping.h>
+
+#include <asm/tlbflush.h>
+
+#include "mmu_decl.h"
+
+/*
+ * This address range defaults to a value that is safe for all
+ * platforms which currently set CONFIG_NOT_COHERENT_CACHE. It
+ * can be further configured for specific applications under
+ * the "Advanced Setup" menu. -Matt
+ */
+#define CONSISTENT_BASE                (IOREMAP_TOP)
+#define CONSISTENT_END                 (CONSISTENT_BASE + CONFIG_CONSISTENT_SIZE)
+#define CONSISTENT_OFFSET(x)   (((unsigned long)(x) - CONSISTENT_BASE) >> PAGE_SHIFT)
+
+/*
+ * This is the page table (2MB) covering uncached, DMA consistent allocations
+ */
+static DEFINE_SPINLOCK(consistent_lock);
+
+/*
+ * VM region handling support.
+ *
+ * This should become something generic, handling VM region allocations for
+ * vmalloc and similar (ioremap, module space, etc).
+ *
+ * I envisage vmalloc()'s supporting vm_struct becoming:
+ *
+ *  struct vm_struct {
+ *    struct vm_region region;
+ *    unsigned long    flags;
+ *    struct page      **pages;
+ *    unsigned int     nr_pages;
+ *    unsigned long    phys_addr;
+ *  };
+ *
+ * get_vm_area() would then call vm_region_alloc with an appropriate
+ * struct vm_region head (eg):
+ *
+ *  struct vm_region vmalloc_head = {
+ *     .vm_list        = LIST_HEAD_INIT(vmalloc_head.vm_list),
+ *     .vm_start       = VMALLOC_START,
+ *     .vm_end         = VMALLOC_END,
+ *  };
+ *
+ * However, vmalloc_head.vm_start is variable (typically, it is dependent on
+ * the amount of RAM found at boot time.)  I would imagine that get_vm_area()
+ * would have to initialise this each time prior to calling vm_region_alloc().
+ */
+struct ppc_vm_region {
+       struct list_head        vm_list;
+       unsigned long           vm_start;
+       unsigned long           vm_end;
+};
+
+static struct ppc_vm_region consistent_head = {
+       .vm_list        = LIST_HEAD_INIT(consistent_head.vm_list),
+       .vm_start       = CONSISTENT_BASE,
+       .vm_end         = CONSISTENT_END,
+};
+
+static struct ppc_vm_region *
+ppc_vm_region_alloc(struct ppc_vm_region *head, size_t size, gfp_t gfp)
+{
+       unsigned long addr = head->vm_start, end = head->vm_end - size;
+       unsigned long flags;
+       struct ppc_vm_region *c, *new;
+
+       new = kmalloc(sizeof(struct ppc_vm_region), gfp);
+       if (!new)
+               goto out;
+
+       spin_lock_irqsave(&consistent_lock, flags);
+
+       list_for_each_entry(c, &head->vm_list, vm_list) {
+               if ((addr + size) < addr)
+                       goto nospc;
+               if ((addr + size) <= c->vm_start)
+                       goto found;
+               addr = c->vm_end;
+               if (addr > end)
+                       goto nospc;
+       }
+
+ found:
+       /*
+        * Insert this entry _before_ the one we found.
+        */
+       list_add_tail(&new->vm_list, &c->vm_list);
+       new->vm_start = addr;
+       new->vm_end = addr + size;
+
+       spin_unlock_irqrestore(&consistent_lock, flags);
+       return new;
+
+ nospc:
+       spin_unlock_irqrestore(&consistent_lock, flags);
+       kfree(new);
+ out:
+       return NULL;
+}
+
+static struct ppc_vm_region *ppc_vm_region_find(struct ppc_vm_region *head, unsigned long addr)
+{
+       struct ppc_vm_region *c;
+
+       list_for_each_entry(c, &head->vm_list, vm_list) {
+               if (c->vm_start == addr)
+                       goto out;
+       }
+       c = NULL;
+ out:
+       return c;
+}
+
+/*
+ * Allocate DMA-coherent memory space and return both the kernel remapped
+ * virtual and bus address for that space.
+ */
+void *
+__dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp)
+{
+       struct page *page;
+       struct ppc_vm_region *c;
+       unsigned long order;
+       u64 mask = ISA_DMA_THRESHOLD, limit;
+
+       if (dev) {
+               mask = dev->coherent_dma_mask;
+
+               /*
+                * Sanity check the DMA mask - it must be non-zero, and
+                * must be able to be satisfied by a DMA allocation.
+                */
+               if (mask == 0) {
+                       dev_warn(dev, "coherent DMA mask is unset\n");
+                       goto no_page;
+               }
+
+               if ((~mask) & ISA_DMA_THRESHOLD) {
+                       dev_warn(dev, "coherent DMA mask %#llx is smaller "
+                                "than system GFP_DMA mask %#llx\n",
+                                mask, (unsigned long long)ISA_DMA_THRESHOLD);
+                       goto no_page;
+               }
+       }
+
+
+       size = PAGE_ALIGN(size);
+       limit = (mask + 1) & ~mask;
+       if ((limit && size >= limit) ||
+           size >= (CONSISTENT_END - CONSISTENT_BASE)) {
+               printk(KERN_WARNING "coherent allocation too big (requested %#x mask %#Lx)\n",
+                      size, mask);
+               return NULL;
+       }
+
+       order = get_order(size);
+
+       /* Might be useful if we ever have a real legacy DMA zone... */
+       if (mask != 0xffffffff)
+               gfp |= GFP_DMA;
+
+       page = alloc_pages(gfp, order);
+       if (!page)
+               goto no_page;
+
+       /*
+        * Invalidate any data that might be lurking in the
+        * kernel direct-mapped region for device DMA.
+        */
+       {
+               unsigned long kaddr = (unsigned long)page_address(page);
+               memset(page_address(page), 0, size);
+               flush_dcache_range(kaddr, kaddr + size);
+       }
+
+       /*
+        * Allocate a virtual address in the consistent mapping region.
+        */
+       c = ppc_vm_region_alloc(&consistent_head, size,
+                           gfp & ~(__GFP_DMA | __GFP_HIGHMEM));
+       if (c) {
+               unsigned long vaddr = c->vm_start;
+               struct page *end = page + (1 << order);
+
+               split_page(page, order);
+
+               /*
+                * Set the "dma handle"
+                */
+               *handle = page_to_phys(page);
+
+               do {
+                       SetPageReserved(page);
+                       map_page(vaddr, page_to_phys(page),
+                                pgprot_noncached(PAGE_KERNEL));
+                       page++;
+                       vaddr += PAGE_SIZE;
+               } while (size -= PAGE_SIZE);
+
+               /*
+                * Free the otherwise unused pages.
+                */
+               while (page < end) {
+                       __free_page(page);
+                       page++;
+               }
+
+               return (void *)c->vm_start;
+       }
+
+       if (page)
+               __free_pages(page, order);
+ no_page:
+       return NULL;
+}
+EXPORT_SYMBOL(__dma_alloc_coherent);
+
+/*
+ * free a page as defined by the above mapping.
+ */
+void __dma_free_coherent(size_t size, void *vaddr)
+{
+       struct ppc_vm_region *c;
+       unsigned long flags, addr;
+       
+       size = PAGE_ALIGN(size);
+
+       spin_lock_irqsave(&consistent_lock, flags);
+
+       c = ppc_vm_region_find(&consistent_head, (unsigned long)vaddr);
+       if (!c)
+               goto no_area;
+
+       if ((c->vm_end - c->vm_start) != size) {
+               printk(KERN_ERR "%s: freeing wrong coherent size (%ld != %d)\n",
+                      __func__, c->vm_end - c->vm_start, size);
+               dump_stack();
+               size = c->vm_end - c->vm_start;
+       }
+
+       addr = c->vm_start;
+       do {
+               pte_t *ptep;
+               unsigned long pfn;
+
+               ptep = pte_offset_kernel(pmd_offset(pud_offset(pgd_offset_k(addr),
+                                                              addr),
+                                                   addr),
+                                        addr);
+               if (!pte_none(*ptep) && pte_present(*ptep)) {
+                       pfn = pte_pfn(*ptep);
+                       pte_clear(&init_mm, addr, ptep);
+                       if (pfn_valid(pfn)) {
+                               struct page *page = pfn_to_page(pfn);
+
+                               ClearPageReserved(page);
+                               __free_page(page);
+                       }
+               }
+               addr += PAGE_SIZE;
+       } while (size -= PAGE_SIZE);
+
+       flush_tlb_kernel_range(c->vm_start, c->vm_end);
+
+       list_del(&c->vm_list);
+
+       spin_unlock_irqrestore(&consistent_lock, flags);
+
+       kfree(c);
+       return;
+
+ no_area:
+       spin_unlock_irqrestore(&consistent_lock, flags);
+       printk(KERN_ERR "%s: trying to free invalid coherent area: %p\n",
+              __func__, vaddr);
+       dump_stack();
+}
+EXPORT_SYMBOL(__dma_free_coherent);
+
+/*
+ * make an area consistent.
+ */
+void __dma_sync(void *vaddr, size_t size, int direction)
+{
+       unsigned long start = (unsigned long)vaddr;
+       unsigned long end   = start + size;
+
+       switch (direction) {
+       case DMA_NONE:
+               BUG();
+       case DMA_FROM_DEVICE:
+               /*
+                * invalidate only when cache-line aligned otherwise there is
+                * the potential for discarding uncommitted data from the cache
+                */
+               if ((start & (L1_CACHE_BYTES - 1)) || (size & (L1_CACHE_BYTES - 1)))
+                       flush_dcache_range(start, end);
+               else
+                       invalidate_dcache_range(start, end);
+               break;
+       case DMA_TO_DEVICE:             /* writeback only */
+               clean_dcache_range(start, end);
+               break;
+       case DMA_BIDIRECTIONAL: /* writeback and invalidate */
+               flush_dcache_range(start, end);
+               break;
+       }
+}
+EXPORT_SYMBOL(__dma_sync);
+
+#ifdef CONFIG_HIGHMEM
+/*
+ * __dma_sync_page() implementation for systems using highmem.
+ * In this case, each page of a buffer must be kmapped/kunmapped
+ * in order to have a virtual address for __dma_sync(). This must
+ * not sleep so kmap_atomic()/kunmap_atomic() are used.
+ *
+ * Note: yes, it is possible and correct to have a buffer extend
+ * beyond the first page.
+ */
+static inline void __dma_sync_page_highmem(struct page *page,
+               unsigned long offset, size_t size, int direction)
+{
+       size_t seg_size = min((size_t)(PAGE_SIZE - offset), size);
+       size_t cur_size = seg_size;
+       unsigned long flags, start, seg_offset = offset;
+       int nr_segs = 1 + ((size - seg_size) + PAGE_SIZE - 1)/PAGE_SIZE;
+       int seg_nr = 0;
+
+       local_irq_save(flags);
+
+       do {
+               start = (unsigned long)kmap_atomic(page + seg_nr,
+                               KM_PPC_SYNC_PAGE) + seg_offset;
+
+               /* Sync this buffer segment */
+               __dma_sync((void *)start, seg_size, direction);
+               kunmap_atomic((void *)start, KM_PPC_SYNC_PAGE);
+               seg_nr++;
+
+               /* Calculate next buffer segment size */
+               seg_size = min((size_t)PAGE_SIZE, size - cur_size);
+
+               /* Add the segment size to our running total */
+               cur_size += seg_size;
+               seg_offset = 0;
+       } while (seg_nr < nr_segs);
+
+       local_irq_restore(flags);
+}
+#endif /* CONFIG_HIGHMEM */
+
+/*
+ * __dma_sync_page makes memory consistent. identical to __dma_sync, but
+ * takes a struct page instead of a virtual address
+ */
+void __dma_sync_page(struct page *page, unsigned long offset,
+       size_t size, int direction)
+{
+#ifdef CONFIG_HIGHMEM
+       __dma_sync_page_highmem(page, offset, size, direction);
+#else
+       unsigned long start = (unsigned long)page_address(page) + offset;
+       __dma_sync((void *)start, size, direction);
+#endif
+}
+EXPORT_SYMBOL(__dma_sync_page);
index 666a5e8..3de6a0d 100644 (file)
@@ -168,12 +168,8 @@ void __init MMU_init(void)
                ppc_md.progress("MMU:mapin", 0x301);
        mapin_ram();
 
-#ifdef CONFIG_HIGHMEM
-       ioremap_base = PKMAP_BASE;
-#else
-       ioremap_base = 0xfe000000UL;    /* for now, could be 0xfffff000 */
-#endif /* CONFIG_HIGHMEM */
-       ioremap_bot = ioremap_base;
+       /* Initialize early top-down ioremap allocator */
+       ioremap_bot = IOREMAP_TOP;
 
        /* Map in I/O resources */
        if (ppc_md.progress)
index d0602a7..579382c 100644 (file)
@@ -380,6 +380,23 @@ void __init mem_init(void)
                bsssize >> 10,
                initsize >> 10);
 
+#ifdef CONFIG_PPC32
+       pr_info("Kernel virtual memory layout:\n");
+       pr_info("  * 0x%08lx..0x%08lx  : fixmap\n", FIXADDR_START, FIXADDR_TOP);
+#ifdef CONFIG_HIGHMEM
+       pr_info("  * 0x%08lx..0x%08lx  : highmem PTEs\n",
+               PKMAP_BASE, PKMAP_ADDR(LAST_PKMAP));
+#endif /* CONFIG_HIGHMEM */
+#ifdef CONFIG_NOT_COHERENT_CACHE
+       pr_info("  * 0x%08lx..0x%08lx  : consistent mem\n",
+               IOREMAP_TOP, IOREMAP_TOP + CONFIG_CONSISTENT_SIZE);
+#endif /* CONFIG_NOT_COHERENT_CACHE */
+       pr_info("  * 0x%08lx..0x%08lx  : early ioremap\n",
+               ioremap_bot, IOREMAP_TOP);
+       pr_info("  * 0x%08lx..0x%08lx  : vmalloc & ioremap\n",
+               VMALLOC_START, VMALLOC_END);
+#endif /* CONFIG_PPC32 */
+
        mem_init_done = 1;
 }
 
index 430d090..5422169 100644 (file)
@@ -399,8 +399,6 @@ void kernel_map_pages(struct page *page, int numpages, int enable)
 #endif /* CONFIG_DEBUG_PAGEALLOC */
 
 static int fixmaps;
-unsigned long FIXADDR_TOP = (-PAGE_SIZE);
-EXPORT_SYMBOL(FIXADDR_TOP);
 
 void __set_fixmap (enum fixed_addresses idx, phys_addr_t phys, pgprot_t flags)
 {
index d3b2b4f..5d84df5 100644 (file)
@@ -12,7 +12,6 @@
 #ifndef __ASM_SH_FLAT_H
 #define __ASM_SH_FLAT_H
 
-#define        flat_stack_align(sp)                    /* nothing needed */
 #define        flat_argvp_envp_on_stack()              0
 #define        flat_old_ram_flag(flags)                (flags)
 #define        flat_reloc_valid(reloc, size)           ((reloc) <= (size))
index 8f307d9..f46c340 100644 (file)
@@ -26,12 +26,16 @@ static unsigned long page_table_shareable(struct vm_area_struct *svma,
        unsigned long sbase = saddr & PUD_MASK;
        unsigned long s_end = sbase + PUD_SIZE;
 
+       /* Allow segments to share if only one is marked locked */
+       unsigned long vm_flags = vma->vm_flags & ~VM_LOCKED;
+       unsigned long svm_flags = svma->vm_flags & ~VM_LOCKED;
+
        /*
         * match the virtual addresses, permission and the alignment of the
         * page table page.
         */
        if (pmd_index(addr) != pmd_index(saddr) ||
-           vma->vm_flags != svma->vm_flags ||
+           vm_flags != svm_flags ||
            sbase < svma->vm_start || svma->vm_end < s_end)
                return 0;
 
index e5f5c5a..956982f 100644 (file)
@@ -192,16 +192,20 @@ config EDAC_PPC4XX
 
 config EDAC_AMD8131
        tristate "AMD8131 HyperTransport PCI-X Tunnel"
-       depends on EDAC_MM_EDAC && PCI
+       depends on EDAC_MM_EDAC && PCI && PPC_MAPLE
        help
          Support for error detection and correction on the
          AMD8131 HyperTransport PCI-X Tunnel chip.
+         Note, add more Kconfig dependency if it's adopted
+         on some machine other than Maple.
 
 config EDAC_AMD8111
        tristate "AMD8111 HyperTransport I/O Hub"
-       depends on EDAC_MM_EDAC && PCI
+       depends on EDAC_MM_EDAC && PCI && PPC_MAPLE
        help
          Support for error detection and correction on the
          AMD8111 HyperTransport I/O Hub chip.
+         Note, add more Kconfig dependency if it's adopted
+         on some machine other than Maple.
 
 endif # EDAC
index a5fdcf0..5907681 100644 (file)
@@ -35,3 +35,5 @@ obj-$(CONFIG_EDAC_MPC85XX)            += mpc85xx_edac.o
 obj-$(CONFIG_EDAC_MV64X60)             += mv64x60_edac.o
 obj-$(CONFIG_EDAC_CELL)                        += cell_edac.o
 obj-$(CONFIG_EDAC_PPC4XX)              += ppc4xx_edac.o
+obj-$(CONFIG_EDAC_AMD8111)             += amd8111_edac.o
+obj-$(CONFIG_EDAC_AMD8131)             += amd8131_edac.o
index 6146921..2cb58ef 100644 (file)
@@ -389,7 +389,7 @@ static int amd8111_dev_probe(struct pci_dev *dev,
        dev_info->edac_dev->dev = &dev_info->dev->dev;
        dev_info->edac_dev->mod_name = AMD8111_EDAC_MOD_STR;
        dev_info->edac_dev->ctl_name = dev_info->ctl_name;
-       dev_info->edac_dev->dev_name = dev_info->dev->dev.bus_id;
+       dev_info->edac_dev->dev_name = dev_name(&dev_info->dev->dev);
 
        if (edac_op_state == EDAC_OPSTATE_POLL)
                dev_info->edac_dev->edac_check = dev_info->check;
@@ -473,7 +473,7 @@ static int amd8111_pci_probe(struct pci_dev *dev,
        pci_info->edac_dev->dev = &pci_info->dev->dev;
        pci_info->edac_dev->mod_name = AMD8111_EDAC_MOD_STR;
        pci_info->edac_dev->ctl_name = pci_info->ctl_name;
-       pci_info->edac_dev->dev_name = pci_info->dev->dev.bus_id;
+       pci_info->edac_dev->dev_name = dev_name(&pci_info->dev->dev);
 
        if (edac_op_state == EDAC_OPSTATE_POLL)
                pci_info->edac_dev->edac_check = pci_info->check;
index c083b31..b432d60 100644 (file)
@@ -287,7 +287,7 @@ static int amd8131_probe(struct pci_dev *dev, const struct pci_device_id *id)
        dev_info->edac_dev->dev = &dev_info->dev->dev;
        dev_info->edac_dev->mod_name = AMD8131_EDAC_MOD_STR;
        dev_info->edac_dev->ctl_name = dev_info->ctl_name;
-       dev_info->edac_dev->dev_name = dev_info->dev->dev.bus_id;
+       dev_info->edac_dev->dev_name = dev_name(&dev_info->dev->dev);
 
        if (edac_op_state == EDAC_OPSTATE_POLL)
                dev_info->edac_dev->edac_check = amd8131_chipset.check;
index 3c3626d..5d400ae 100644 (file)
@@ -3811,13 +3811,13 @@ static sector_t reshape_request(mddev_t *mddev, sector_t sector_nr, int *skipped
        safepos = conf->reshape_safe;
        sector_div(safepos, data_disks);
        if (mddev->delta_disks < 0) {
-               writepos -= min(reshape_sectors, writepos);
+               writepos -= min_t(sector_t, reshape_sectors, writepos);
                readpos += reshape_sectors;
                safepos += reshape_sectors;
        } else {
                writepos += reshape_sectors;
-               readpos -= min(reshape_sectors, readpos);
-               safepos -= min(reshape_sectors, safepos);
+               readpos -= min_t(sector_t, reshape_sectors, readpos);
+               safepos -= min_t(sector_t, reshape_sectors, safepos);
        }
 
        /* 'writepos' is the most advanced device address we might write.
index e6a7e84..ea31a45 100644 (file)
@@ -352,8 +352,8 @@ static int __devinit parport_init_chip(struct parisc_device *dev)
        unsigned long port;
 
        if (!dev->irq) {
-               printk(KERN_WARNING "IRQ not found for parallel device at 0x%lx\n",
-                       dev->hpa.start);
+               printk(KERN_WARNING "IRQ not found for parallel device at 0x%llx\n",
+                       (unsigned long long)dev->hpa.start);
                return -ENODEV;
        }
 
index b4b3981..a0127e9 100644 (file)
@@ -137,6 +137,7 @@ struct uart_8250_port {
        unsigned char           mcr;
        unsigned char           mcr_mask;       /* mask of user bits */
        unsigned char           mcr_force;      /* mask of forced bits */
+       unsigned char           cur_iotype;     /* Running I/O type */
 
        /*
         * Some bits in registers are cleared on a read, so they must
@@ -471,6 +472,7 @@ static void io_serial_out(struct uart_port *p, int offset, int value)
 
 static void set_io_from_upio(struct uart_port *p)
 {
+       struct uart_8250_port *up = (struct uart_8250_port *)p;
        switch (p->iotype) {
        case UPIO_HUB6:
                p->serial_in = hub6_serial_in;
@@ -509,6 +511,8 @@ static void set_io_from_upio(struct uart_port *p)
                p->serial_out = io_serial_out;
                break;
        }
+       /* Remember loaded iotype */
+       up->cur_iotype = p->iotype;
 }
 
 static void
@@ -1937,6 +1941,9 @@ static int serial8250_startup(struct uart_port *port)
        up->capabilities = uart_config[up->port.type].flags;
        up->mcr = 0;
 
+       if (up->port.iotype != up->cur_iotype)
+               set_io_from_upio(port);
+
        if (up->port.type == PORT_16C950) {
                /* Wake up and initialize UART */
                up->acr = 0;
@@ -2563,6 +2570,9 @@ static void serial8250_config_port(struct uart_port *port, int flags)
        if (ret < 0)
                probeflags &= ~PROBE_RSA;
 
+       if (up->port.iotype != up->cur_iotype)
+               set_io_from_upio(port);
+
        if (flags & UART_CONFIG_TYPE)
                autoconfig(up, probeflags);
        if (up->port.type != PORT_UNKNOWN && flags & UART_CONFIG_IRQ)
@@ -2671,6 +2681,11 @@ serial8250_register_ports(struct uart_driver *drv, struct device *dev)
 {
        int i;
 
+       for (i = 0; i < nr_uarts; i++) {
+               struct uart_8250_port *up = &serial8250_ports[i];
+               up->cur_iotype = 0xFF;
+       }
+
        serial8250_isa_init_ports();
 
        for (i = 0; i < nr_uarts; i++) {
index 418b4fe..33149d9 100644 (file)
@@ -39,9 +39,9 @@ static int __init serial_init_chip(struct parisc_device *dev)
                 */
                if (parisc_parent(dev)->id.hw_type != HPHW_IOA)
                        printk(KERN_INFO
-                               "Serial: device 0x%lx not configured.\n"
+                               "Serial: device 0x%llx not configured.\n"
                                "Enable support for Wax, Lasi, Asp or Dino.\n",
-                               dev->hpa.start);
+                               (unsigned long long)dev->hpa.start);
                return -ENODEV;
        }
 
index 7f72f8c..b3feb61 100644 (file)
@@ -988,7 +988,7 @@ mpc52xx_console_setup(struct console *co, char *options)
        pr_debug("mpc52xx_console_setup co=%p, co->index=%i, options=%s\n",
                 co, co->index, options);
 
-       if ((co->index < 0) || (co->index > MPC52xx_PSC_MAXNUM)) {
+       if ((co->index < 0) || (co->index >= MPC52xx_PSC_MAXNUM)) {
                pr_debug("PSC%x out of range\n", co->index);
                return -EINVAL;
        }
index 9a577a8..2fb63f6 100644 (file)
 
 /* configurable parameters */
 #define ATMEL_LCDC_CVAL_DEFAULT                0xc8
-#define ATMEL_LCDC_DMA_BURST_LEN       8
-
-#if defined(CONFIG_ARCH_AT91SAM9263) || defined(CONFIG_ARCH_AT91CAP9) || \
-       defined(CONFIG_ARCH_AT91SAM9RL)
-#define ATMEL_LCDC_FIFO_SIZE           2048
-#else
-#define ATMEL_LCDC_FIFO_SIZE           512
-#endif
+#define ATMEL_LCDC_DMA_BURST_LEN       8       /* words */
+#define ATMEL_LCDC_FIFO_SIZE           512     /* words */
 
 #if defined(CONFIG_ARCH_AT91)
 #define        ATMEL_LCDFB_FBINFO_DEFAULT      (FBINFO_DEFAULT \
index 5e9c630..d3a568e 100644 (file)
@@ -947,7 +947,8 @@ static int __devexit s3c_fb_remove(struct platform_device *pdev)
        int win;
 
        for (win = 0; win <= S3C_FB_MAX_WIN; win++)
-               s3c_fb_release_win(sfb, sfb->windows[win]);
+               if (sfb->windows[win])
+                       s3c_fb_release_win(sfb, sfb->windows[win]);
 
        iounmap(sfb->regs);
 
@@ -985,11 +986,20 @@ static int s3c_fb_suspend(struct platform_device *pdev, pm_message_t state)
 static int s3c_fb_resume(struct platform_device *pdev)
 {
        struct s3c_fb *sfb = platform_get_drvdata(pdev);
+       struct s3c_fb_platdata *pd = sfb->pdata;
        struct s3c_fb_win *win;
        int win_no;
 
        clk_enable(sfb->bus_clk);
 
+       /* setup registers */
+       writel(pd->vidcon1, sfb->regs + VIDCON1);
+
+       /* zero all windows before we do anything */
+       for (win_no = 0; win_no < S3C_FB_MAX_WIN; win_no++)
+               s3c_fb_clear_win(sfb, win_no);
+
+       /* restore framebuffers */
        for (win_no = 0; win_no < S3C_FB_MAX_WIN; win_no++) {
                win = sfb->windows[win_no];
                if (!win)
index 5cebf0b..697f6b5 100644 (file)
@@ -41,6 +41,7 @@
 #include <asm/uaccess.h>
 #include <asm/unaligned.h>
 #include <asm/cacheflush.h>
+#include <asm/page.h>
 
 /****************************************************************************/
 
 #define        DBG_FLT(a...)
 #endif
 
+/*
+ * User data (stack, data section and bss) needs to be aligned
+ * for the same reasons as SLAB memory is, and to the same amount.
+ * Avoid duplicating architecture specific code by using the same
+ * macro as with SLAB allocation:
+ */
+#ifdef ARCH_SLAB_MINALIGN
+#define FLAT_DATA_ALIGN        (ARCH_SLAB_MINALIGN)
+#else
+#define FLAT_DATA_ALIGN        (sizeof(void *))
+#endif
+
 #define RELOC_FAILED 0xff00ff01                /* Relocation incorrect somewhere */
 #define UNLOADED_LIB 0x7ff000ff                /* Placeholder for unused library */
 
@@ -114,20 +127,18 @@ static unsigned long create_flat_tables(
        int envc = bprm->envc;
        char uninitialized_var(dummy);
 
-       sp = (unsigned long *) ((-(unsigned long)sizeof(char *))&(unsigned long) p);
+       sp = (unsigned long *)p;
+       sp -= (envc + argc + 2) + 1 + (flat_argvp_envp_on_stack() ? 2 : 0);
+       sp = (unsigned long *) ((unsigned long)sp & -FLAT_DATA_ALIGN);
+       argv = sp + 1 + (flat_argvp_envp_on_stack() ? 2 : 0);
+       envp = argv + (argc + 1);
 
-       sp -= envc+1;
-       envp = sp;
-       sp -= argc+1;
-       argv = sp;
-
-       flat_stack_align(sp);
        if (flat_argvp_envp_on_stack()) {
-               --sp; put_user((unsigned long) envp, sp);
-               --sp; put_user((unsigned long) argv, sp);
+               put_user((unsigned long) envp, sp + 2);
+               put_user((unsigned long) argv, sp + 1);
        }
 
-       put_user(argc,--sp);
+       put_user(argc, sp);
        current->mm->arg_start = (unsigned long) p;
        while (argc-->0) {
                put_user((unsigned long) p, argv++);
@@ -558,7 +569,9 @@ static int load_flat_file(struct linux_binprm * bprm,
                        ret = realdatastart;
                        goto err;
                }
-               datapos = realdatastart + MAX_SHARED_LIBS * sizeof(unsigned long);
+               datapos = ALIGN(realdatastart +
+                               MAX_SHARED_LIBS * sizeof(unsigned long),
+                               FLAT_DATA_ALIGN);
 
                DBG_FLT("BINFMT_FLAT: Allocated data+bss+stack (%d bytes): %x\n",
                                (int)(data_len + bss_len + stack_len), (int)datapos);
@@ -604,9 +617,12 @@ static int load_flat_file(struct linux_binprm * bprm,
                }
 
                realdatastart = textpos + ntohl(hdr->data_start);
-               datapos = realdatastart + MAX_SHARED_LIBS * sizeof(unsigned long);
-               reloc = (unsigned long *) (textpos + ntohl(hdr->reloc_start) +
-                               MAX_SHARED_LIBS * sizeof(unsigned long));
+               datapos = ALIGN(realdatastart +
+                               MAX_SHARED_LIBS * sizeof(unsigned long),
+                               FLAT_DATA_ALIGN);
+
+               reloc = (unsigned long *)
+                       (datapos + (ntohl(hdr->reloc_start) - text_len));
                memp = textpos;
                memp_size = len;
 #ifdef CONFIG_BINFMT_ZFLAT
@@ -854,7 +870,7 @@ static int load_flat_binary(struct linux_binprm * bprm, struct pt_regs * regs)
        stack_len = TOP_OF_ARGS - bprm->p;             /* the strings */
        stack_len += (bprm->argc + 1) * sizeof(char *); /* the argv array */
        stack_len += (bprm->envc + 1) * sizeof(char *); /* the envp array */
-
+       stack_len += FLAT_DATA_ALIGN - 1;  /* reserve for upcoming alignment */
        
        res = load_flat_file(bprm, &libinfo, 0, &stack_len);
        if (res > (unsigned long)-4096)
index 19218e1..f7c255f 100644 (file)
@@ -122,13 +122,13 @@ static inline void cachefiles_state_changed(struct cachefiles_cache *cache)
 }
 
 /*
- * cf-bind.c
+ * bind.c
  */
 extern int cachefiles_daemon_bind(struct cachefiles_cache *cache, char *args);
 extern void cachefiles_daemon_unbind(struct cachefiles_cache *cache);
 
 /*
- * cf-daemon.c
+ * daemon.c
  */
 extern const struct file_operations cachefiles_daemon_fops;
 
@@ -136,17 +136,17 @@ extern int cachefiles_has_space(struct cachefiles_cache *cache,
                                unsigned fnr, unsigned bnr);
 
 /*
- * cf-interface.c
+ * interface.c
  */
 extern const struct fscache_cache_ops cachefiles_cache_ops;
 
 /*
- * cf-key.c
+ * key.c
  */
 extern char *cachefiles_cook_key(const u8 *raw, int keylen, uint8_t type);
 
 /*
- * cf-namei.c
+ * namei.c
  */
 extern int cachefiles_delete_object(struct cachefiles_cache *cache,
                                    struct cachefiles_object *object);
@@ -165,7 +165,7 @@ extern int cachefiles_check_in_use(struct cachefiles_cache *cache,
                                   struct dentry *dir, char *filename);
 
 /*
- * cf-proc.c
+ * proc.c
  */
 #ifdef CONFIG_CACHEFILES_HISTOGRAM
 extern atomic_t cachefiles_lookup_histogram[HZ];
@@ -190,7 +190,7 @@ void cachefiles_hist(atomic_t histogram[], unsigned long start_jif)
 #endif
 
 /*
- * cf-rdwr.c
+ * rdwr.c
  */
 extern int cachefiles_read_or_alloc_page(struct fscache_retrieval *,
                                         struct page *, gfp_t);
@@ -205,7 +205,7 @@ extern int cachefiles_write_page(struct fscache_storage *, struct page *);
 extern void cachefiles_uncache_page(struct fscache_object *, struct page *);
 
 /*
- * cf-security.c
+ * security.c
  */
 extern int cachefiles_get_security_ID(struct cachefiles_cache *cache);
 extern int cachefiles_determine_cache_security(struct cachefiles_cache *cache,
@@ -225,7 +225,7 @@ static inline void cachefiles_end_secure(struct cachefiles_cache *cache,
 }
 
 /*
- * cf-xattr.c
+ * xattr.c
  */
 extern int cachefiles_check_object_type(struct cachefiles_object *object);
 extern int cachefiles_set_object_xattr(struct cachefiles_object *object,
index e0cbd16..1c34130 100644 (file)
@@ -28,7 +28,7 @@
 #define FSCACHE_MAX_THREADS    32
 
 /*
- * fsc-cache.c
+ * cache.c
  */
 extern struct list_head fscache_cache_list;
 extern struct rw_semaphore fscache_addremove_sem;
@@ -37,7 +37,7 @@ extern struct fscache_cache *fscache_select_cache_for_object(
        struct fscache_cookie *);
 
 /*
- * fsc-cookie.c
+ * cookie.c
  */
 extern struct kmem_cache *fscache_cookie_jar;
 
@@ -45,13 +45,13 @@ extern void fscache_cookie_init_once(void *);
 extern void __fscache_cookie_put(struct fscache_cookie *);
 
 /*
- * fsc-fsdef.c
+ * fsdef.c
  */
 extern struct fscache_cookie fscache_fsdef_index;
 extern struct fscache_cookie_def fscache_fsdef_netfs_def;
 
 /*
- * fsc-histogram.c
+ * histogram.c
  */
 #ifdef CONFIG_FSCACHE_HISTOGRAM
 extern atomic_t fscache_obj_instantiate_histogram[HZ];
@@ -75,7 +75,7 @@ extern const struct file_operations fscache_histogram_fops;
 #endif
 
 /*
- * fsc-main.c
+ * main.c
  */
 extern unsigned fscache_defer_lookup;
 extern unsigned fscache_defer_create;
@@ -86,14 +86,14 @@ extern int fscache_wait_bit(void *);
 extern int fscache_wait_bit_interruptible(void *);
 
 /*
- * fsc-object.c
+ * object.c
  */
 extern void fscache_withdrawing_object(struct fscache_cache *,
                                       struct fscache_object *);
 extern void fscache_enqueue_object(struct fscache_object *);
 
 /*
- * fsc-operation.c
+ * operation.c
  */
 extern int fscache_submit_exclusive_op(struct fscache_object *,
                                       struct fscache_operation *);
@@ -104,7 +104,7 @@ extern void fscache_start_operations(struct fscache_object *);
 extern void fscache_operation_gc(struct work_struct *);
 
 /*
- * fsc-proc.c
+ * proc.c
  */
 #ifdef CONFIG_PROC_FS
 extern int __init fscache_proc_init(void);
@@ -115,7 +115,7 @@ extern void fscache_proc_cleanup(void);
 #endif
 
 /*
- * fsc-stats.c
+ * stats.c
  */
 #ifdef CONFIG_FSCACHE_STATS
 extern atomic_t fscache_n_ops_processed[FSCACHE_MAX_THREADS];
index fb45615..3326bbf 100644 (file)
@@ -1956,7 +1956,7 @@ static struct dentry *proc_pident_instantiate(struct inode *dir,
        const struct pid_entry *p = ptr;
        struct inode *inode;
        struct proc_inode *ei;
-       struct dentry *error = ERR_PTR(-EINVAL);
+       struct dentry *error = ERR_PTR(-ENOENT);
 
        inode = proc_pid_make_inode(dir->i_sb, task);
        if (!inode)
index 3282ee4..4fa9996 100644 (file)
@@ -13,6 +13,7 @@
 #define _LINUX_CRED_H
 
 #include <linux/capability.h>
+#include <linux/init.h>
 #include <linux/key.h>
 #include <asm/atomic.h>
 
index 62d8143..d476aad 100644 (file)
@@ -437,6 +437,11 @@ static inline int mem_cgroup_cache_charge_swapin(struct page *page,
        return 0;
 }
 
+static inline void
+mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent)
+{
+}
+
 #endif /* CONFIG_SWAP */
 #endif /* __KERNEL__*/
 #endif /* _LINUX_SWAP_H */
index 379ff0b..1b60f30 100644 (file)
@@ -121,7 +121,6 @@ void __remove_from_page_cache(struct page *page)
        mapping->nrpages--;
        __dec_zone_page_state(page, NR_FILE_PAGES);
        BUG_ON(page_mapped(page));
-       mem_cgroup_uncharge_cache_page(page);
 
        /*
         * Some filesystems seem to re-dirty the page even after
@@ -145,6 +144,7 @@ void remove_from_page_cache(struct page *page)
        spin_lock_irq(&mapping->tree_lock);
        __remove_from_page_cache(page);
        spin_unlock_irq(&mapping->tree_lock);
+       mem_cgroup_uncharge_cache_page(page);
 }
 
 static int sync_page(void *word)
@@ -476,13 +476,13 @@ int add_to_page_cache_locked(struct page *page, struct address_space *mapping,
                if (likely(!error)) {
                        mapping->nrpages++;
                        __inc_zone_page_state(page, NR_FILE_PAGES);
+                       spin_unlock_irq(&mapping->tree_lock);
                } else {
                        page->mapping = NULL;
+                       spin_unlock_irq(&mapping->tree_lock);
                        mem_cgroup_uncharge_cache_page(page);
                        page_cache_release(page);
                }
-
-               spin_unlock_irq(&mapping->tree_lock);
                radix_tree_preload_end();
        } else
                mem_cgroup_uncharge_cache_page(page);
index 28c655b..e83ad2c 100644 (file)
@@ -316,7 +316,7 @@ static void resv_map_release(struct kref *ref)
 static struct resv_map *vma_resv_map(struct vm_area_struct *vma)
 {
        VM_BUG_ON(!is_vm_hugetlb_page(vma));
-       if (!(vma->vm_flags & VM_SHARED))
+       if (!(vma->vm_flags & VM_MAYSHARE))
                return (struct resv_map *)(get_vma_private_data(vma) &
                                                        ~HPAGE_RESV_MASK);
        return NULL;
@@ -325,7 +325,7 @@ static struct resv_map *vma_resv_map(struct vm_area_struct *vma)
 static void set_vma_resv_map(struct vm_area_struct *vma, struct resv_map *map)
 {
        VM_BUG_ON(!is_vm_hugetlb_page(vma));
-       VM_BUG_ON(vma->vm_flags & VM_SHARED);
+       VM_BUG_ON(vma->vm_flags & VM_MAYSHARE);
 
        set_vma_private_data(vma, (get_vma_private_data(vma) &
                                HPAGE_RESV_MASK) | (unsigned long)map);
@@ -334,7 +334,7 @@ static void set_vma_resv_map(struct vm_area_struct *vma, struct resv_map *map)
 static void set_vma_resv_flags(struct vm_area_struct *vma, unsigned long flags)
 {
        VM_BUG_ON(!is_vm_hugetlb_page(vma));
-       VM_BUG_ON(vma->vm_flags & VM_SHARED);
+       VM_BUG_ON(vma->vm_flags & VM_MAYSHARE);
 
        set_vma_private_data(vma, get_vma_private_data(vma) | flags);
 }
@@ -353,7 +353,7 @@ static void decrement_hugepage_resv_vma(struct hstate *h,
        if (vma->vm_flags & VM_NORESERVE)
                return;
 
-       if (vma->vm_flags & VM_SHARED) {
+       if (vma->vm_flags & VM_MAYSHARE) {
                /* Shared mappings always use reserves */
                h->resv_huge_pages--;
        } else if (is_vma_resv_set(vma, HPAGE_RESV_OWNER)) {
@@ -369,14 +369,14 @@ static void decrement_hugepage_resv_vma(struct hstate *h,
 void reset_vma_resv_huge_pages(struct vm_area_struct *vma)
 {
        VM_BUG_ON(!is_vm_hugetlb_page(vma));
-       if (!(vma->vm_flags & VM_SHARED))
+       if (!(vma->vm_flags & VM_MAYSHARE))
                vma->vm_private_data = (void *)0;
 }
 
 /* Returns true if the VMA has associated reserve pages */
 static int vma_has_reserves(struct vm_area_struct *vma)
 {
-       if (vma->vm_flags & VM_SHARED)
+       if (vma->vm_flags & VM_MAYSHARE)
                return 1;
        if (is_vma_resv_set(vma, HPAGE_RESV_OWNER))
                return 1;
@@ -924,7 +924,7 @@ static long vma_needs_reservation(struct hstate *h,
        struct address_space *mapping = vma->vm_file->f_mapping;
        struct inode *inode = mapping->host;
 
-       if (vma->vm_flags & VM_SHARED) {
+       if (vma->vm_flags & VM_MAYSHARE) {
                pgoff_t idx = vma_hugecache_offset(h, vma, addr);
                return region_chg(&inode->i_mapping->private_list,
                                                        idx, idx + 1);
@@ -949,7 +949,7 @@ static void vma_commit_reservation(struct hstate *h,
        struct address_space *mapping = vma->vm_file->f_mapping;
        struct inode *inode = mapping->host;
 
-       if (vma->vm_flags & VM_SHARED) {
+       if (vma->vm_flags & VM_MAYSHARE) {
                pgoff_t idx = vma_hugecache_offset(h, vma, addr);
                region_add(&inode->i_mapping->private_list, idx, idx + 1);
 
@@ -1893,7 +1893,7 @@ retry_avoidcopy:
         * at the time of fork() could consume its reserves on COW instead
         * of the full address range.
         */
-       if (!(vma->vm_flags & VM_SHARED) &&
+       if (!(vma->vm_flags & VM_MAYSHARE) &&
                        is_vma_resv_set(vma, HPAGE_RESV_OWNER) &&
                        old_page != pagecache_page)
                outside_reserve = 1;
@@ -2000,7 +2000,7 @@ retry:
                clear_huge_page(page, address, huge_page_size(h));
                __SetPageUptodate(page);
 
-               if (vma->vm_flags & VM_SHARED) {
+               if (vma->vm_flags & VM_MAYSHARE) {
                        int err;
                        struct inode *inode = mapping->host;
 
@@ -2104,7 +2104,7 @@ int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
                        goto out_mutex;
                }
 
-               if (!(vma->vm_flags & VM_SHARED))
+               if (!(vma->vm_flags & VM_MAYSHARE))
                        pagecache_page = hugetlbfs_pagecache_page(h,
                                                                vma, address);
        }
@@ -2289,7 +2289,7 @@ int hugetlb_reserve_pages(struct inode *inode,
         * to reserve the full area even if read-only as mprotect() may be
         * called to make the mapping read-write. Assume !vma is a shm mapping
         */
-       if (!vma || vma->vm_flags & VM_SHARED)
+       if (!vma || vma->vm_flags & VM_MAYSHARE)
                chg = region_chg(&inode->i_mapping->private_list, from, to);
        else {
                struct resv_map *resv_map = resv_map_alloc();
@@ -2330,7 +2330,7 @@ int hugetlb_reserve_pages(struct inode *inode,
         * consumed reservations are stored in the map. Hence, nothing
         * else has to be done for private mappings here
         */
-       if (!vma || vma->vm_flags & VM_SHARED)
+       if (!vma || vma->vm_flags & VM_MAYSHARE)
                region_add(&inode->i_mapping->private_list, from, to);
        return 0;
 }
index 01c2d8f..78eb855 100644 (file)
@@ -314,14 +314,6 @@ static struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm)
        return mem;
 }
 
-static bool mem_cgroup_is_obsolete(struct mem_cgroup *mem)
-{
-       if (!mem)
-               return true;
-       return css_is_removed(&mem->css);
-}
-
-
 /*
  * Call callback function against all cgroup under hierarchy tree.
  */
@@ -932,7 +924,7 @@ static int __mem_cgroup_try_charge(struct mm_struct *mm,
        if (unlikely(!mem))
                return 0;
 
-       VM_BUG_ON(!mem || mem_cgroup_is_obsolete(mem));
+       VM_BUG_ON(css_is_removed(&mem->css));
 
        while (1) {
                int ret;
@@ -1488,8 +1480,9 @@ void mem_cgroup_uncharge_cache_page(struct page *page)
        __mem_cgroup_uncharge_common(page, MEM_CGROUP_CHARGE_TYPE_CACHE);
 }
 
+#ifdef CONFIG_SWAP
 /*
- * called from __delete_from_swap_cache() and drop "page" account.
+ * called after __delete_from_swap_cache() and drop "page" account.
  * memcg information is recorded to swap_cgroup of "ent"
  */
 void mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent)
@@ -1506,6 +1499,7 @@ void mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent)
        if (memcg)
                css_put(&memcg->css);
 }
+#endif
 
 #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP
 /*
index 92bcf1d..a7b2460 100644 (file)
@@ -284,22 +284,28 @@ static void dump_tasks(const struct mem_cgroup *mem)
        printk(KERN_INFO "[ pid ]   uid  tgid total_vm      rss cpu oom_adj "
               "name\n");
        do_each_thread(g, p) {
-               /*
-                * total_vm and rss sizes do not exist for tasks with a
-                * detached mm so there's no need to report them.
-                */
-               if (!p->mm)
-                       continue;
+               struct mm_struct *mm;
+
                if (mem && !task_in_mem_cgroup(p, mem))
                        continue;
                if (!thread_group_leader(p))
                        continue;
 
                task_lock(p);
+               mm = p->mm;
+               if (!mm) {
+                       /*
+                        * total_vm and rss sizes do not exist for tasks with no
+                        * mm so there's no need to report them; they can't be
+                        * oom killed anyway.
+                        */
+                       task_unlock(p);
+                       continue;
+               }
                printk(KERN_INFO "[%5d] %5d %5d %8lu %8lu %3d     %3d %s\n",
-                      p->pid, __task_cred(p)->uid, p->tgid,
-                      p->mm->total_vm, get_mm_rss(p->mm), (int)task_cpu(p),
-                      p->oomkilladj, p->comm);
+                      p->pid, __task_cred(p)->uid, p->tgid, mm->total_vm,
+                      get_mm_rss(mm), (int)task_cpu(p), p->oomkilladj,
+                      p->comm);
                task_unlock(p);
        } while_each_thread(g, p);
 }
index 3ecea98..1416e7e 100644 (file)
@@ -109,8 +109,6 @@ int add_to_swap_cache(struct page *page, swp_entry_t entry, gfp_t gfp_mask)
  */
 void __delete_from_swap_cache(struct page *page)
 {
-       swp_entry_t ent = {.val = page_private(page)};
-
        VM_BUG_ON(!PageLocked(page));
        VM_BUG_ON(!PageSwapCache(page));
        VM_BUG_ON(PageWriteback(page));
@@ -121,7 +119,6 @@ void __delete_from_swap_cache(struct page *page)
        total_swapcache_pages--;
        __dec_zone_page_state(page, NR_FILE_PAGES);
        INC_CACHE_INFO(del_total);
-       mem_cgroup_uncharge_swapcache(page, ent);
 }
 
 /**
@@ -191,6 +188,7 @@ void delete_from_swap_cache(struct page *page)
        __delete_from_swap_cache(page);
        spin_unlock_irq(&swapper_space.tree_lock);
 
+       mem_cgroup_uncharge_swapcache(page, entry);
        swap_free(entry);
        page_cache_release(page);
 }
index 55206fa..12e1579 100644 (file)
@@ -359,6 +359,7 @@ invalidate_complete_page2(struct address_space *mapping, struct page *page)
        BUG_ON(page_has_private(page));
        __remove_from_page_cache(page);
        spin_unlock_irq(&mapping->tree_lock);
+       mem_cgroup_uncharge_cache_page(page);
        page_cache_release(page);       /* pagecache ref */
        return 1;
 failed:
index 5fa3eda..d254306 100644 (file)
@@ -470,10 +470,12 @@ static int __remove_mapping(struct address_space *mapping, struct page *page)
                swp_entry_t swap = { .val = page_private(page) };
                __delete_from_swap_cache(page);
                spin_unlock_irq(&mapping->tree_lock);
+               mem_cgroup_uncharge_swapcache(page, swap);
                swap_free(swap);
        } else {
                __remove_from_page_cache(page);
                spin_unlock_irq(&mapping->tree_lock);
+               mem_cgroup_uncharge_cache_page(page);
        }
 
        return 1;
index 5b48191..e42be5c 100644 (file)
@@ -27,6 +27,12 @@ static int tomoyo_cred_prepare(struct cred *new, const struct cred *old,
 
 static int tomoyo_bprm_set_creds(struct linux_binprm *bprm)
 {
+       int rc;
+
+       rc = cap_bprm_set_creds(bprm);
+       if (rc)
+               return rc;
+
        /*
         * Do only if this function is called for the first time of an execve
         * operation.
index a2a792c..d659995 100644 (file)
@@ -249,6 +249,11 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream)
                        new_hw_ptr = hw_base + pos;
                }
        }
+
+       /* Do jiffies check only in xrun_debug mode */
+       if (!xrun_debug(substream))
+               goto no_jiffies_check;
+
        /* Skip the jiffies check for hardwares with BATCH flag.
         * Such hardware usually just increases the position at each IRQ,
         * thus it can't give any strange position.
@@ -336,7 +341,9 @@ int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream)
                        hw_base = 0;
                new_hw_ptr = hw_base + pos;
        }
-       if (((delta * HZ) / runtime->rate) > jdelta + HZ/100) {
+       /* Do jiffies check only in xrun_debug mode */
+       if (xrun_debug(substream) &&
+           ((delta * HZ) / runtime->rate) > jdelta + HZ/100) {
                hw_ptr_error(substream,
                             "hw_ptr skipping! "
                             "(pos=%ld, delta=%ld, period=%ld, jdelta=%lu/%lu)\n",
@@ -1478,7 +1485,6 @@ static int snd_pcm_lib_ioctl_reset(struct snd_pcm_substream *substream,
                runtime->status->hw_ptr %= runtime->buffer_size;
        else
                runtime->status->hw_ptr = 0;
-       runtime->hw_ptr_jiffies = jiffies;
        snd_pcm_stream_unlock_irqrestore(substream, flags);
        return 0;
 }
index fc6f98e..b5da656 100644 (file)
@@ -848,6 +848,7 @@ static void snd_pcm_post_start(struct snd_pcm_substream *substream, int state)
 {
        struct snd_pcm_runtime *runtime = substream->runtime;
        snd_pcm_trigger_tstamp(substream);
+       runtime->hw_ptr_jiffies = jiffies;
        runtime->status->state = state;
        if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
            runtime->silence_size > 0)
@@ -961,6 +962,11 @@ static int snd_pcm_do_pause(struct snd_pcm_substream *substream, int push)
 {
        if (substream->runtime->trigger_master != substream)
                return 0;
+       /* The jiffies check in snd_pcm_update_hw_ptr*() is done by
+        * a delta betwen the current jiffies, this gives a large enough
+        * delta, effectively to skip the check once.
+        */
+       substream->runtime->hw_ptr_jiffies = jiffies - HZ * 1000;
        return substream->ops->trigger(substream,
                                       push ? SNDRV_PCM_TRIGGER_PAUSE_PUSH :
                                              SNDRV_PCM_TRIGGER_PAUSE_RELEASE);
index 56ce19e..4fcbe21 100644 (file)
@@ -1848,6 +1848,7 @@ static const char *cxt5051_models[CXT5051_MODELS] = {
 
 static struct snd_pci_quirk cxt5051_cfg_tbl[] = {
        SND_PCI_QUIRK(0x103c, 0x30cf, "HP DV6736", CXT5051_HP_DV6736),
+       SND_PCI_QUIRK(0x103c, 0x360b, "Compaq Presario CQ60", CXT5051_HP),
        SND_PCI_QUIRK(0x14f1, 0x0101, "Conexant Reference board",
                      CXT5051_LAPTOP),
        SND_PCI_QUIRK(0x14f1, 0x5051, "HP Spartan 1.1", CXT5051_HP),
index 823296d..a6b8848 100644 (file)
@@ -3347,7 +3347,7 @@ static int snd_usb_create_quirk(struct snd_usb_audio *chip,
                [QUIRK_MIDI_YAMAHA] = snd_usb_create_midi_interface,
                [QUIRK_MIDI_MIDIMAN] = snd_usb_create_midi_interface,
                [QUIRK_MIDI_NOVATION] = snd_usb_create_midi_interface,
-               [QUIRK_MIDI_RAW] = snd_usb_create_midi_interface,
+               [QUIRK_MIDI_FASTLANE] = snd_usb_create_midi_interface,
                [QUIRK_MIDI_EMAGIC] = snd_usb_create_midi_interface,
                [QUIRK_MIDI_CME] = snd_usb_create_midi_interface,
                [QUIRK_AUDIO_STANDARD_INTERFACE] = create_standard_audio_quirk,
index 36e4f7a..8e7f789 100644 (file)
@@ -153,7 +153,7 @@ enum quirk_type {
        QUIRK_MIDI_YAMAHA,
        QUIRK_MIDI_MIDIMAN,
        QUIRK_MIDI_NOVATION,
-       QUIRK_MIDI_RAW,
+       QUIRK_MIDI_FASTLANE,
        QUIRK_MIDI_EMAGIC,
        QUIRK_MIDI_CME,
        QUIRK_MIDI_US122L,
index 26bad37..2fb35cc 100644 (file)
@@ -1778,8 +1778,18 @@ int snd_usb_create_midi_interface(struct snd_usb_audio* chip,
                umidi->usb_protocol_ops = &snd_usbmidi_novation_ops;
                err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints);
                break;
-       case QUIRK_MIDI_RAW:
+       case QUIRK_MIDI_FASTLANE:
                umidi->usb_protocol_ops = &snd_usbmidi_raw_ops;
+               /*
+                * Interface 1 contains isochronous endpoints, but with the same
+                * numbers as in interface 0.  Since it is interface 1 that the
+                * USB core has most recently seen, these descriptors are now
+                * associated with the endpoint numbers.  This will foul up our
+                * attempts to submit bulk/interrupt URBs to the endpoints in
+                * interface 0, so we have to make sure that the USB core looks
+                * again at interface 0 by calling usb_set_interface() on it.
+                */
+               usb_set_interface(umidi->chip->dev, 0, 0);
                err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints);
                break;
        case QUIRK_MIDI_EMAGIC:
index 647ef50..5d955aa 100644 (file)
@@ -1868,7 +1868,7 @@ YAMAHA_DEVICE(0x7010, "UB99"),
                .data = & (const struct snd_usb_audio_quirk[]) {
                        {
                                .ifnum = 0,
-                               .type = QUIRK_MIDI_RAW
+                               .type = QUIRK_MIDI_FASTLANE
                        },
                        {
                                .ifnum = 1,