aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/HOWTO28
-rw-r--r--Documentation/kernel-parameters.txt5
-rw-r--r--arch/arm/kernel/calls.S2
-rw-r--r--arch/arm/kernel/sys_arm.c13
-rw-r--r--arch/i386/kernel/cpu/mtrr/cyrix.c4
-rw-r--r--arch/ia64/kernel/time.c1
-rw-r--r--arch/ia64/kernel/unwind.c16
-rw-r--r--arch/ia64/mm/hugetlbpage.c3
-rw-r--r--arch/ia64/sn/kernel/xp_nofault.S3
-rw-r--r--arch/ia64/sn/pci/pcibr/pcibr_provider.c7
-rw-r--r--arch/ia64/sn/pci/tioca_provider.c4
-rw-r--r--arch/ia64/sn/pci/tioce_provider.c4
-rw-r--r--arch/mips/jazz/setup.c2
-rw-r--r--arch/powerpc/kernel/sys_ppc32.c9
-rw-r--r--arch/powerpc/kernel/vdso64/gettimeofday.S2
-rw-r--r--drivers/ata/libata-core.c56
-rw-r--r--drivers/ata/libata-eh.c7
-rw-r--r--drivers/ata/libata-scsi.c20
-rw-r--r--drivers/ata/pata_hpt37x.c4
-rw-r--r--drivers/ata/pata_it821x.c2
-rw-r--r--drivers/atm/Kconfig2
-rw-r--r--drivers/char/drm/drm_pciids.h2
-rw-r--r--drivers/char/drm/sis_drv.h8
-rw-r--r--drivers/dma/ioatdma.c8
-rw-r--r--drivers/media/dvb/Kconfig2
-rw-r--r--drivers/media/radio/Kconfig2
-rw-r--r--drivers/media/video/Kconfig6
-rw-r--r--drivers/media/video/saa7134/saa7134-tvaudio.c2
-rw-r--r--drivers/net/au1000_eth.c2
-rw-r--r--drivers/net/cxgb3/xgmac.c8
-rw-r--r--drivers/net/irda/smsc-ircc2.c14
-rw-r--r--drivers/net/pcmcia/Kconfig2
-rw-r--r--drivers/net/phy/mdio_bus.c3
-rw-r--r--drivers/net/phy/vitesse.c2
-rw-r--r--drivers/net/s2io.c16
-rw-r--r--drivers/pnp/quirks.c66
-rw-r--r--drivers/serial/mpsc.c3
-rw-r--r--drivers/video/aty/atyfb_base.c17
-rw-r--r--drivers/video/chipsfb.c6
-rw-r--r--drivers/w1/slaves/w1_therm.c6
-rw-r--r--fs/ecryptfs/ecryptfs_kernel.h2
-rw-r--r--fs/ecryptfs/inode.c66
-rw-r--r--fs/ecryptfs/mmap.c55
-rw-r--r--fs/ext2/super.c1
-rw-r--r--fs/signalfd.c3
-rw-r--r--fs/sync.c8
-rw-r--r--include/asm-arm/unistd.h1
-rw-r--r--include/asm-ia64/sn/sn_sal.h4
-rw-r--r--include/asm-powerpc/systbl.h1
-rw-r--r--include/asm-powerpc/unistd.h3
-rw-r--r--include/linux/eventfd.h3
-rw-r--r--include/linux/libata.h9
-rw-r--r--include/linux/syscalls.h2
-rw-r--r--kernel/relay.c11
-rw-r--r--mm/rmap.c24
-rwxr-xr-xscripts/checksyscalls.sh5
-rw-r--r--sound/isa/opl3sa2.c2
-rw-r--r--sound/pci/ice1712/prodigy192.c2
58 files changed, 328 insertions, 243 deletions
diff --git a/Documentation/HOWTO b/Documentation/HOWTO
index ced9207bedcf..98e2701c746f 100644
--- a/Documentation/HOWTO
+++ b/Documentation/HOWTO
@@ -322,39 +322,34 @@ kernel releases as described above.
322Here is a list of some of the different kernel trees available: 322Here is a list of some of the different kernel trees available:
323 git trees: 323 git trees:
324 - Kbuild development tree, Sam Ravnborg <sam@ravnborg.org> 324 - Kbuild development tree, Sam Ravnborg <sam@ravnborg.org>
325 kernel.org:/pub/scm/linux/kernel/git/sam/kbuild.git 325 git.kernel.org:/pub/scm/linux/kernel/git/sam/kbuild.git
326 326
327 - ACPI development tree, Len Brown <len.brown@intel.com> 327 - ACPI development tree, Len Brown <len.brown@intel.com>
328 kernel.org:/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6.git 328 git.kernel.org:/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6.git
329 329
330 - Block development tree, Jens Axboe <axboe@suse.de> 330 - Block development tree, Jens Axboe <axboe@suse.de>
331 kernel.org:/pub/scm/linux/kernel/git/axboe/linux-2.6-block.git 331 git.kernel.org:/pub/scm/linux/kernel/git/axboe/linux-2.6-block.git
332 332
333 - DRM development tree, Dave Airlie <airlied@linux.ie> 333 - DRM development tree, Dave Airlie <airlied@linux.ie>
334 kernel.org:/pub/scm/linux/kernel/git/airlied/drm-2.6.git 334 git.kernel.org:/pub/scm/linux/kernel/git/airlied/drm-2.6.git
335 335
336 - ia64 development tree, Tony Luck <tony.luck@intel.com> 336 - ia64 development tree, Tony Luck <tony.luck@intel.com>
337 kernel.org:/pub/scm/linux/kernel/git/aegl/linux-2.6.git 337 git.kernel.org:/pub/scm/linux/kernel/git/aegl/linux-2.6.git
338
339 - ieee1394 development tree, Jody McIntyre <scjody@modernduck.com>
340 kernel.org:/pub/scm/linux/kernel/git/scjody/ieee1394.git
341 338
342 - infiniband, Roland Dreier <rolandd@cisco.com> 339 - infiniband, Roland Dreier <rolandd@cisco.com>
343 kernel.org:/pub/scm/linux/kernel/git/roland/infiniband.git 340 git.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband.git
344 341
345 - libata, Jeff Garzik <jgarzik@pobox.com> 342 - libata, Jeff Garzik <jgarzik@pobox.com>
346 kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev.git 343 git.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev.git
347 344
348 - network drivers, Jeff Garzik <jgarzik@pobox.com> 345 - network drivers, Jeff Garzik <jgarzik@pobox.com>
349 kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git 346 git.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git
350 347
351 - pcmcia, Dominik Brodowski <linux@dominikbrodowski.net> 348 - pcmcia, Dominik Brodowski <linux@dominikbrodowski.net>
352 kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git 349 git.kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git
353 350
354 - SCSI, James Bottomley <James.Bottomley@SteelEye.com> 351 - SCSI, James Bottomley <James.Bottomley@SteelEye.com>
355 kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git 352 git.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git
356
357 Other git kernel trees can be found listed at http://kernel.org/git
358 353
359 quilt trees: 354 quilt trees:
360 - USB, PCI, Driver Core, and I2C, Greg Kroah-Hartman <gregkh@suse.de> 355 - USB, PCI, Driver Core, and I2C, Greg Kroah-Hartman <gregkh@suse.de>
@@ -362,6 +357,9 @@ Here is a list of some of the different kernel trees available:
362 - x86-64, partly i386, Andi Kleen <ak@suse.de> 357 - x86-64, partly i386, Andi Kleen <ak@suse.de>
363 ftp.firstfloor.org:/pub/ak/x86_64/quilt/ 358 ftp.firstfloor.org:/pub/ak/x86_64/quilt/
364 359
360 Other kernel trees can be found listed at http://git.kernel.org/ and in
361 the MAINTAINERS file.
362
365Bug Reporting 363Bug Reporting
366------------- 364-------------
367 365
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 5d0283cd3a81..af50f9bbe68e 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -223,11 +223,6 @@ and is between 256 and 4096 characters. It is defined in the file
223 223
224 acpi_fake_ecdt [HW,ACPI] Workaround failure due to BIOS lacking ECDT 224 acpi_fake_ecdt [HW,ACPI] Workaround failure due to BIOS lacking ECDT
225 225
226 acpi_generic_hotkey [HW,ACPI]
227 Allow consolidated generic hotkey driver to
228 override platform specific driver.
229 See also Documentation/acpi-hotkey.txt.
230
231 acpi_pm_good [IA-32,X86-64] 226 acpi_pm_good [IA-32,X86-64]
232 Override the pmtimer bug detection: force the kernel 227 Override the pmtimer bug detection: force the kernel
233 to assume that this machine's pmtimer latches its value 228 to assume that this machine's pmtimer latches its value
diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S
index 19326d7cdeb3..a98d0c933db0 100644
--- a/arch/arm/kernel/calls.S
+++ b/arch/arm/kernel/calls.S
@@ -350,7 +350,7 @@
350 CALL(sys_set_robust_list) 350 CALL(sys_set_robust_list)
351 CALL(sys_get_robust_list) 351 CALL(sys_get_robust_list)
352/* 340 */ CALL(sys_splice) 352/* 340 */ CALL(sys_splice)
353 CALL(sys_arm_sync_file_range) 353 CALL(sys_sync_file_range2)
354 CALL(sys_tee) 354 CALL(sys_tee)
355 CALL(sys_vmsplice) 355 CALL(sys_vmsplice)
356 CALL(sys_move_pages) 356 CALL(sys_move_pages)
diff --git a/arch/arm/kernel/sys_arm.c b/arch/arm/kernel/sys_arm.c
index 1ca2d5174fcb..4d25e49a14f7 100644
--- a/arch/arm/kernel/sys_arm.c
+++ b/arch/arm/kernel/sys_arm.c
@@ -328,16 +328,3 @@ asmlinkage long sys_arm_fadvise64_64(int fd, int advice,
328{ 328{
329 return sys_fadvise64_64(fd, offset, len, advice); 329 return sys_fadvise64_64(fd, offset, len, advice);
330} 330}
331
332/*
333 * Yet more syscall fsckage - we can't fit sys_sync_file_range's
334 * arguments into the available registers with EABI. So, let's
335 * create an ARM specific syscall for this which has _sane_
336 * arguments. (This incidentally also has an ABI-independent
337 * argument layout.)
338 */
339asmlinkage long sys_arm_sync_file_range(int fd, unsigned int flags,
340 loff_t offset, loff_t nbytes)
341{
342 return sys_sync_file_range(fd, offset, nbytes, flags);
343}
diff --git a/arch/i386/kernel/cpu/mtrr/cyrix.c b/arch/i386/kernel/cpu/mtrr/cyrix.c
index 9edf5625584f..1001f1e0fe6d 100644
--- a/arch/i386/kernel/cpu/mtrr/cyrix.c
+++ b/arch/i386/kernel/cpu/mtrr/cyrix.c
@@ -233,12 +233,12 @@ typedef struct {
233 mtrr_type type; 233 mtrr_type type;
234} arr_state_t; 234} arr_state_t;
235 235
236static arr_state_t arr_state[8] __devinitdata = { 236static arr_state_t arr_state[8] = {
237 {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, 237 {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL},
238 {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL} 238 {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}
239}; 239};
240 240
241static unsigned char ccr_state[7] __devinitdata = { 0, 0, 0, 0, 0, 0, 0 }; 241static unsigned char ccr_state[7] = { 0, 0, 0, 0, 0, 0, 0 };
242 242
243static void cyrix_set_all(void) 243static void cyrix_set_all(void)
244{ 244{
diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c
index a06667c7acc0..3486fe7d6e65 100644
--- a/arch/ia64/kernel/time.c
+++ b/arch/ia64/kernel/time.c
@@ -18,7 +18,6 @@
18#include <linux/time.h> 18#include <linux/time.h>
19#include <linux/interrupt.h> 19#include <linux/interrupt.h>
20#include <linux/efi.h> 20#include <linux/efi.h>
21#include <linux/profile.h>
22#include <linux/timex.h> 21#include <linux/timex.h>
23 22
24#include <asm/machvec.h> 23#include <asm/machvec.h>
diff --git a/arch/ia64/kernel/unwind.c b/arch/ia64/kernel/unwind.c
index b0b08b5f3eca..c1bdb5131814 100644
--- a/arch/ia64/kernel/unwind.c
+++ b/arch/ia64/kernel/unwind.c
@@ -1856,11 +1856,19 @@ find_save_locs (struct unw_frame_info *info)
1856 return 0; 1856 return 0;
1857} 1857}
1858 1858
1859static int
1860unw_valid(const struct unw_frame_info *info, unsigned long* p)
1861{
1862 unsigned long loc = (unsigned long)p;
1863 return (loc >= info->regstk.limit && loc < info->regstk.top) ||
1864 (loc >= info->memstk.top && loc < info->memstk.limit);
1865}
1866
1859int 1867int
1860unw_unwind (struct unw_frame_info *info) 1868unw_unwind (struct unw_frame_info *info)
1861{ 1869{
1862 unsigned long prev_ip, prev_sp, prev_bsp; 1870 unsigned long prev_ip, prev_sp, prev_bsp;
1863 unsigned long ip, pr, num_regs, rp_loc, pfs_loc; 1871 unsigned long ip, pr, num_regs;
1864 STAT(unsigned long start, flags;) 1872 STAT(unsigned long start, flags;)
1865 int retval; 1873 int retval;
1866 1874
@@ -1871,8 +1879,7 @@ unw_unwind (struct unw_frame_info *info)
1871 prev_bsp = info->bsp; 1879 prev_bsp = info->bsp;
1872 1880
1873 /* validate the return IP pointer */ 1881 /* validate the return IP pointer */
1874 rp_loc = (unsigned long) info->rp_loc; 1882 if (!unw_valid(info, info->rp_loc)) {
1875 if ((rp_loc < info->regstk.limit) || (rp_loc > info->regstk.top)) {
1876 /* FIXME: should really be level 0 but it occurs too often. KAO */ 1883 /* FIXME: should really be level 0 but it occurs too often. KAO */
1877 UNW_DPRINT(1, "unwind.%s: failed to locate return link (ip=0x%lx)!\n", 1884 UNW_DPRINT(1, "unwind.%s: failed to locate return link (ip=0x%lx)!\n",
1878 __FUNCTION__, info->ip); 1885 __FUNCTION__, info->ip);
@@ -1888,8 +1895,7 @@ unw_unwind (struct unw_frame_info *info)
1888 } 1895 }
1889 1896
1890 /* validate the previous stack frame pointer */ 1897 /* validate the previous stack frame pointer */
1891 pfs_loc = (unsigned long) info->pfs_loc; 1898 if (!unw_valid(info, info->pfs_loc)) {
1892 if ((pfs_loc < info->regstk.limit) || (pfs_loc > info->regstk.top)) {
1893 UNW_DPRINT(0, "unwind.%s: failed to locate ar.pfs!\n", __FUNCTION__); 1899 UNW_DPRINT(0, "unwind.%s: failed to locate ar.pfs!\n", __FUNCTION__);
1894 STAT(unw.stat.api.unwind_time += ia64_get_itc() - start; local_irq_restore(flags)); 1900 STAT(unw.stat.api.unwind_time += ia64_get_itc() - start; local_irq_restore(flags));
1895 return -1; 1901 return -1;
diff --git a/arch/ia64/mm/hugetlbpage.c b/arch/ia64/mm/hugetlbpage.c
index 1346b7f05397..d22861c5b04c 100644
--- a/arch/ia64/mm/hugetlbpage.c
+++ b/arch/ia64/mm/hugetlbpage.c
@@ -15,6 +15,7 @@
15#include <linux/pagemap.h> 15#include <linux/pagemap.h>
16#include <linux/slab.h> 16#include <linux/slab.h>
17#include <linux/sysctl.h> 17#include <linux/sysctl.h>
18#include <linux/log2.h>
18#include <asm/mman.h> 19#include <asm/mman.h>
19#include <asm/pgalloc.h> 20#include <asm/pgalloc.h>
20#include <asm/tlb.h> 21#include <asm/tlb.h>
@@ -182,7 +183,7 @@ static int __init hugetlb_setup_sz(char *str)
182 tr_pages = 0x15557000UL; 183 tr_pages = 0x15557000UL;
183 184
184 size = memparse(str, &str); 185 size = memparse(str, &str);
185 if (*str || (size & (size-1)) || !(tr_pages & size) || 186 if (*str || !is_power_of_2(size) || !(tr_pages & size) ||
186 size <= PAGE_SIZE || 187 size <= PAGE_SIZE ||
187 size >= (1UL << PAGE_SHIFT << MAX_ORDER)) { 188 size >= (1UL << PAGE_SHIFT << MAX_ORDER)) {
188 printk(KERN_WARNING "Invalid huge page size specified\n"); 189 printk(KERN_WARNING "Invalid huge page size specified\n");
diff --git a/arch/ia64/sn/kernel/xp_nofault.S b/arch/ia64/sn/kernel/xp_nofault.S
index b772543053c9..54e8973b6e99 100644
--- a/arch/ia64/sn/kernel/xp_nofault.S
+++ b/arch/ia64/sn/kernel/xp_nofault.S
@@ -21,7 +21,8 @@
21xp_nofault_PIOR: 21xp_nofault_PIOR:
22 mov r8=r0 // Stage a success return value 22 mov r8=r0 // Stage a success return value
23 ld8.acq r9=[r32];; // PIO Read the specified register 23 ld8.acq r9=[r32];; // PIO Read the specified register
24 adds r9=1,r9 // Add to force a consume 24 adds r9=1,r9;; // Add to force consumption
25 or r9=r9,r9;; // Or to force consumption
25 br.ret.sptk.many b0;; // Return success 26 br.ret.sptk.many b0;; // Return success
26 27
27 .global xp_error_PIOR 28 .global xp_error_PIOR
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_provider.c b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
index 04a8256017eb..b42bfcae6f91 100644
--- a/arch/ia64/sn/pci/pcibr/pcibr_provider.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
@@ -15,6 +15,7 @@
15#include <asm/sn/pcibus_provider_defs.h> 15#include <asm/sn/pcibus_provider_defs.h>
16#include <asm/sn/pcidev.h> 16#include <asm/sn/pcidev.h>
17#include <asm/sn/sn_sal.h> 17#include <asm/sn/sn_sal.h>
18#include <asm/sn/pic.h>
18#include <asm/sn/sn2/sn_hwperf.h> 19#include <asm/sn/sn2/sn_hwperf.h>
19#include "xtalk/xwidgetdev.h" 20#include "xtalk/xwidgetdev.h"
20#include "xtalk/hubdev.h" 21#include "xtalk/hubdev.h"
@@ -130,9 +131,9 @@ pcibr_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
130 } 131 }
131 132
132 memcpy(soft, prom_bussoft, sizeof(struct pcibus_info)); 133 memcpy(soft, prom_bussoft, sizeof(struct pcibus_info));
133 soft->pbi_buscommon.bs_base = 134 soft->pbi_buscommon.bs_base = (unsigned long)
134 (((u64) soft->pbi_buscommon. 135 ioremap(REGION_OFFSET(soft->pbi_buscommon.bs_base),
135 bs_base << 4) >> 4) | __IA64_UNCACHED_OFFSET; 136 sizeof(struct pic));
136 137
137 spin_lock_init(&soft->pbi_lock); 138 spin_lock_init(&soft->pbi_lock);
138 139
diff --git a/arch/ia64/sn/pci/tioca_provider.c b/arch/ia64/sn/pci/tioca_provider.c
index b9bedbd6e1d6..d798dd4d0dc4 100644
--- a/arch/ia64/sn/pci/tioca_provider.c
+++ b/arch/ia64/sn/pci/tioca_provider.c
@@ -610,7 +610,9 @@ tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
610 return NULL; 610 return NULL;
611 611
612 memcpy(tioca_common, prom_bussoft, sizeof(struct tioca_common)); 612 memcpy(tioca_common, prom_bussoft, sizeof(struct tioca_common));
613 tioca_common->ca_common.bs_base |= __IA64_UNCACHED_OFFSET; 613 tioca_common->ca_common.bs_base = (unsigned long)
614 ioremap(REGION_OFFSET(tioca_common->ca_common.bs_base),
615 sizeof(struct tioca_common));
614 616
615 /* init kernel-private area */ 617 /* init kernel-private area */
616 618
diff --git a/arch/ia64/sn/pci/tioce_provider.c b/arch/ia64/sn/pci/tioce_provider.c
index f4c0b961a939..84b72b27e27f 100644
--- a/arch/ia64/sn/pci/tioce_provider.c
+++ b/arch/ia64/sn/pci/tioce_provider.c
@@ -1002,7 +1002,9 @@ tioce_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
1002 return NULL; 1002 return NULL;
1003 1003
1004 memcpy(tioce_common, prom_bussoft, sizeof(struct tioce_common)); 1004 memcpy(tioce_common, prom_bussoft, sizeof(struct tioce_common));
1005 tioce_common->ce_pcibus.bs_base |= __IA64_UNCACHED_OFFSET; 1005 tioce_common->ce_pcibus.bs_base = (unsigned long)
1006 ioremap(REGION_OFFSET(tioce_common->ce_pcibus.bs_base),
1007 sizeof(struct tioce_common));
1006 1008
1007 tioce_kern = tioce_kern_init(tioce_common); 1009 tioce_kern = tioce_kern_init(tioce_common);
1008 if (tioce_kern == NULL) { 1010 if (tioce_kern == NULL) {
diff --git a/arch/mips/jazz/setup.c b/arch/mips/jazz/setup.c
index d848f1a07786..81ec559a1c26 100644
--- a/arch/mips/jazz/setup.c
+++ b/arch/mips/jazz/setup.c
@@ -54,7 +54,7 @@ static struct resource jazz_io_resources[] = {
54 .start = 0x40, 54 .start = 0x40,
55 .end = 0x5f, 55 .end = 0x5f,
56 .name = "timer", 56 .name = "timer",
57 .end = IORESOURCE_BUSY 57 .flags = IORESOURCE_BUSY
58 }, { 58 }, {
59 .start = 0x80, 59 .start = 0x80,
60 .end = 0x8f, 60 .end = 0x8f,
diff --git a/arch/powerpc/kernel/sys_ppc32.c b/arch/powerpc/kernel/sys_ppc32.c
index 047246ad4f65..b42cbf1e2d7d 100644
--- a/arch/powerpc/kernel/sys_ppc32.c
+++ b/arch/powerpc/kernel/sys_ppc32.c
@@ -810,3 +810,12 @@ asmlinkage long compat_sys_request_key(const char __user *_type,
810 return sys_request_key(_type, _description, _callout_info, destringid); 810 return sys_request_key(_type, _description, _callout_info, destringid);
811} 811}
812 812
813asmlinkage long compat_sys_sync_file_range2(int fd, unsigned int flags,
814 unsigned offset_hi, unsigned offset_lo,
815 unsigned nbytes_hi, unsigned nbytes_lo)
816{
817 loff_t offset = ((loff_t)offset_hi << 32) | offset_lo;
818 loff_t nbytes = ((loff_t)nbytes_hi << 32) | nbytes_lo;
819
820 return sys_sync_file_range(fd, offset, nbytes, flags);
821}
diff --git a/arch/powerpc/kernel/vdso64/gettimeofday.S b/arch/powerpc/kernel/vdso64/gettimeofday.S
index 2d7a5104c666..c6401f9e37f1 100644
--- a/arch/powerpc/kernel/vdso64/gettimeofday.S
+++ b/arch/powerpc/kernel/vdso64/gettimeofday.S
@@ -31,7 +31,7 @@ V_FUNCTION_BEGIN(__kernel_gettimeofday)
31 mr r11,r3 /* r11 holds tv */ 31 mr r11,r3 /* r11 holds tv */
32 mr r10,r4 /* r10 holds tz */ 32 mr r10,r4 /* r10 holds tz */
33 bl V_LOCAL_FUNC(__get_datapage) /* get data page */ 33 bl V_LOCAL_FUNC(__get_datapage) /* get data page */
34 cmpldi r10,0 /* check if tv is NULL */ 34 cmpldi r11,0 /* check if tv is NULL */
35 beq 2f 35 beq 2f
36 bl V_LOCAL_FUNC(__do_get_xsec) /* get xsec from tb & kernel */ 36 bl V_LOCAL_FUNC(__do_get_xsec) /* get xsec from tb & kernel */
37 lis r7,15 /* r7 = 1000000 = USEC_PER_SEC */ 37 lis r7,15 /* r7 = 1000000 = USEC_PER_SEC */
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index adfae9d1ceb1..bfc59a104728 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -600,8 +600,9 @@ static const char *sata_spd_string(unsigned int spd)
600 600
601void ata_dev_disable(struct ata_device *dev) 601void ata_dev_disable(struct ata_device *dev)
602{ 602{
603 if (ata_dev_enabled(dev) && ata_msg_drv(dev->ap)) { 603 if (ata_dev_enabled(dev)) {
604 ata_dev_printk(dev, KERN_WARNING, "disabled\n"); 604 if (ata_msg_drv(dev->ap))
605 ata_dev_printk(dev, KERN_WARNING, "disabled\n");
605 ata_down_xfermask_limit(dev, ATA_DNXFER_FORCE_PIO0 | 606 ata_down_xfermask_limit(dev, ATA_DNXFER_FORCE_PIO0 |
606 ATA_DNXFER_QUIET); 607 ATA_DNXFER_QUIET);
607 dev->class++; 608 dev->class++;
@@ -983,11 +984,6 @@ static u64 ata_hpa_resize(struct ata_device *dev)
983 else 984 else
984 hpa_sectors = ata_read_native_max_address(dev); 985 hpa_sectors = ata_read_native_max_address(dev);
985 986
986 /* if no hpa, both should be equal */
987 ata_dev_printk(dev, KERN_INFO, "%s 1: sectors = %lld, "
988 "hpa_sectors = %lld\n",
989 __FUNCTION__, (long long)sectors, (long long)hpa_sectors);
990
991 if (hpa_sectors > sectors) { 987 if (hpa_sectors > sectors) {
992 ata_dev_printk(dev, KERN_INFO, 988 ata_dev_printk(dev, KERN_INFO,
993 "Host Protected Area detected:\n" 989 "Host Protected Area detected:\n"
@@ -1009,7 +1005,11 @@ static u64 ata_hpa_resize(struct ata_device *dev)
1009 return hpa_sectors; 1005 return hpa_sectors;
1010 } 1006 }
1011 } 1007 }
1012 } 1008 } else if (hpa_sectors < sectors)
1009 ata_dev_printk(dev, KERN_WARNING, "%s 1: hpa sectors (%lld) "
1010 "is smaller than sectors (%lld)\n", __FUNCTION__,
1011 (long long)hpa_sectors, (long long)sectors);
1012
1013 return sectors; 1013 return sectors;
1014} 1014}
1015 1015
@@ -2046,10 +2046,6 @@ int ata_dev_configure(struct ata_device *dev)
2046 dev->max_sectors = min_t(unsigned int, ATA_MAX_SECTORS_128, 2046 dev->max_sectors = min_t(unsigned int, ATA_MAX_SECTORS_128,
2047 dev->max_sectors); 2047 dev->max_sectors);
2048 2048
2049 /* limit ATAPI DMA to R/W commands only */
2050 if (ata_device_blacklisted(dev) & ATA_HORKAGE_DMA_RW_ONLY)
2051 dev->horkage |= ATA_HORKAGE_DMA_RW_ONLY;
2052
2053 if (ap->ops->dev_config) 2049 if (ap->ops->dev_config)
2054 ap->ops->dev_config(dev); 2050 ap->ops->dev_config(dev);
2055 2051
@@ -3780,8 +3776,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
3780 { "IOMEGA ZIP 250 ATAPI", NULL, ATA_HORKAGE_NODMA }, /* temporary fix */ 3776 { "IOMEGA ZIP 250 ATAPI", NULL, ATA_HORKAGE_NODMA }, /* temporary fix */
3781 3777
3782 /* Weird ATAPI devices */ 3778 /* Weird ATAPI devices */
3783 { "TORiSAN DVD-ROM DRD-N216", NULL, ATA_HORKAGE_MAX_SEC_128 | 3779 { "TORiSAN DVD-ROM DRD-N216", NULL, ATA_HORKAGE_MAX_SEC_128 },
3784 ATA_HORKAGE_DMA_RW_ONLY },
3785 3780
3786 /* Devices we expect to fail diagnostics */ 3781 /* Devices we expect to fail diagnostics */
3787 3782
@@ -4109,6 +4104,7 @@ static void ata_fill_sg(struct ata_queued_cmd *qc)
4109 if (idx) 4104 if (idx)
4110 ap->prd[idx - 1].flags_len |= cpu_to_le32(ATA_PRD_EOT); 4105 ap->prd[idx - 1].flags_len |= cpu_to_le32(ATA_PRD_EOT);
4111} 4106}
4107
4112/** 4108/**
4113 * ata_check_atapi_dma - Check whether ATAPI DMA can be supported 4109 * ata_check_atapi_dma - Check whether ATAPI DMA can be supported
4114 * @qc: Metadata associated with taskfile to check 4110 * @qc: Metadata associated with taskfile to check
@@ -4126,33 +4122,19 @@ static void ata_fill_sg(struct ata_queued_cmd *qc)
4126int ata_check_atapi_dma(struct ata_queued_cmd *qc) 4122int ata_check_atapi_dma(struct ata_queued_cmd *qc)
4127{ 4123{
4128 struct ata_port *ap = qc->ap; 4124 struct ata_port *ap = qc->ap;
4129 int rc = 0; /* Assume ATAPI DMA is OK by default */ 4125
4130 4126 /* Don't allow DMA if it isn't multiple of 16 bytes. Quite a
4131 /* some drives can only do ATAPI DMA on read/write */ 4127 * few ATAPI devices choke on such DMA requests.
4132 if (unlikely(qc->dev->horkage & ATA_HORKAGE_DMA_RW_ONLY)) { 4128 */
4133 struct scsi_cmnd *cmd = qc->scsicmd; 4129 if (unlikely(qc->nbytes & 15))
4134 u8 *scsicmd = cmd->cmnd; 4130 return 1;
4135
4136 switch (scsicmd[0]) {
4137 case READ_10:
4138 case WRITE_10:
4139 case READ_12:
4140 case WRITE_12:
4141 case READ_6:
4142 case WRITE_6:
4143 /* atapi dma maybe ok */
4144 break;
4145 default:
4146 /* turn off atapi dma */
4147 return 1;
4148 }
4149 }
4150 4131
4151 if (ap->ops->check_atapi_dma) 4132 if (ap->ops->check_atapi_dma)
4152 rc = ap->ops->check_atapi_dma(qc); 4133 return ap->ops->check_atapi_dma(qc);
4153 4134
4154 return rc; 4135 return 0;
4155} 4136}
4137
4156/** 4138/**
4157 * ata_qc_prep - Prepare taskfile for submission 4139 * ata_qc_prep - Prepare taskfile for submission
4158 * @qc: Metadata associated with taskfile to be prepared 4140 * @qc: Metadata associated with taskfile to be prepared
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index d8070989a39f..f7582c9c320e 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -336,6 +336,7 @@ void ata_scsi_error(struct Scsi_Host *host)
336 } 336 }
337 ata_port_printk(ap, KERN_ERR, "EH pending after %d " 337 ata_port_printk(ap, KERN_ERR, "EH pending after %d "
338 "tries, giving up\n", ATA_EH_MAX_REPEAT); 338 "tries, giving up\n", ATA_EH_MAX_REPEAT);
339 ap->pflags &= ~ATA_PFLAG_EH_PENDING;
339 } 340 }
340 341
341 /* this run is complete, make sure EH info is clear */ 342 /* this run is complete, make sure EH info is clear */
@@ -1616,7 +1617,7 @@ static int ata_eh_reset(struct ata_port *ap, int classify,
1616 unsigned long deadline; 1617 unsigned long deadline;
1617 unsigned int action; 1618 unsigned int action;
1618 ata_reset_fn_t reset; 1619 ata_reset_fn_t reset;
1619 int i, did_followup_srst, rc; 1620 int i, rc;
1620 1621
1621 /* about to reset */ 1622 /* about to reset */
1622 ata_eh_about_to_do(ap, NULL, ehc->i.action & ATA_EH_RESET_MASK); 1623 ata_eh_about_to_do(ap, NULL, ehc->i.action & ATA_EH_RESET_MASK);
@@ -1665,8 +1666,6 @@ static int ata_eh_reset(struct ata_port *ap, int classify,
1665 1666
1666 /* did prereset() screw up? if so, fix up to avoid oopsing */ 1667 /* did prereset() screw up? if so, fix up to avoid oopsing */
1667 if (!reset) { 1668 if (!reset) {
1668 ata_port_printk(ap, KERN_ERR, "BUG: prereset() requested "
1669 "invalid reset type\n");
1670 if (softreset) 1669 if (softreset)
1671 reset = softreset; 1670 reset = softreset;
1672 else 1671 else
@@ -1689,11 +1688,9 @@ static int ata_eh_reset(struct ata_port *ap, int classify,
1689 1688
1690 rc = ata_do_reset(ap, reset, classes, deadline); 1689 rc = ata_do_reset(ap, reset, classes, deadline);
1691 1690
1692 did_followup_srst = 0;
1693 if (reset == hardreset && 1691 if (reset == hardreset &&
1694 ata_eh_followup_srst_needed(rc, classify, classes)) { 1692 ata_eh_followup_srst_needed(rc, classify, classes)) {
1695 /* okay, let's do follow-up softreset */ 1693 /* okay, let's do follow-up softreset */
1696 did_followup_srst = 1;
1697 reset = softreset; 1694 reset = softreset;
1698 1695
1699 if (!reset) { 1696 if (!reset) {
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index c228df298bd8..4ddf00c8c5f5 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -2384,11 +2384,6 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc)
2384 int using_pio = (dev->flags & ATA_DFLAG_PIO); 2384 int using_pio = (dev->flags & ATA_DFLAG_PIO);
2385 int nodata = (scmd->sc_data_direction == DMA_NONE); 2385 int nodata = (scmd->sc_data_direction == DMA_NONE);
2386 2386
2387 if (!using_pio)
2388 /* Check whether ATAPI DMA is safe */
2389 if (ata_check_atapi_dma(qc))
2390 using_pio = 1;
2391
2392 memset(qc->cdb, 0, dev->cdb_len); 2387 memset(qc->cdb, 0, dev->cdb_len);
2393 memcpy(qc->cdb, scmd->cmnd, scmd->cmd_len); 2388 memcpy(qc->cdb, scmd->cmnd, scmd->cmd_len);
2394 2389
@@ -2401,19 +2396,22 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc)
2401 } 2396 }
2402 2397
2403 qc->tf.command = ATA_CMD_PACKET; 2398 qc->tf.command = ATA_CMD_PACKET;
2399 qc->nbytes = scmd->request_bufflen;
2400
2401 /* check whether ATAPI DMA is safe */
2402 if (!using_pio && ata_check_atapi_dma(qc))
2403 using_pio = 1;
2404 2404
2405 /* no data, or PIO data xfer */
2406 if (using_pio || nodata) { 2405 if (using_pio || nodata) {
2406 /* no data, or PIO data xfer */
2407 if (nodata) 2407 if (nodata)
2408 qc->tf.protocol = ATA_PROT_ATAPI_NODATA; 2408 qc->tf.protocol = ATA_PROT_ATAPI_NODATA;
2409 else 2409 else
2410 qc->tf.protocol = ATA_PROT_ATAPI; 2410 qc->tf.protocol = ATA_PROT_ATAPI;
2411 qc->tf.lbam = (8 * 1024) & 0xff; 2411 qc->tf.lbam = (8 * 1024) & 0xff;
2412 qc->tf.lbah = (8 * 1024) >> 8; 2412 qc->tf.lbah = (8 * 1024) >> 8;
2413 } 2413 } else {
2414 2414 /* DMA data xfer */
2415 /* DMA data xfer */
2416 else {
2417 qc->tf.protocol = ATA_PROT_ATAPI_DMA; 2415 qc->tf.protocol = ATA_PROT_ATAPI_DMA;
2418 qc->tf.feature |= ATAPI_PKT_DMA; 2416 qc->tf.feature |= ATAPI_PKT_DMA;
2419 2417
@@ -2422,8 +2420,6 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc)
2422 qc->tf.feature |= ATAPI_DMADIR; 2420 qc->tf.feature |= ATAPI_DMADIR;
2423 } 2421 }
2424 2422
2425 qc->nbytes = scmd->request_bufflen;
2426
2427 return 0; 2423 return 0;
2428} 2424}
2429 2425
diff --git a/drivers/ata/pata_hpt37x.c b/drivers/ata/pata_hpt37x.c
index 6446735a46e0..a8c0cbeca399 100644
--- a/drivers/ata/pata_hpt37x.c
+++ b/drivers/ata/pata_hpt37x.c
@@ -931,13 +931,13 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
931 .udma_mask = 0x7f, 931 .udma_mask = 0x7f,
932 .port_ops = &hpt372_port_ops 932 .port_ops = &hpt372_port_ops
933 }; 933 };
934 /* HPT374 - UDMA133 */ 934 /* HPT374 - UDMA100 */
935 static const struct ata_port_info info_hpt374 = { 935 static const struct ata_port_info info_hpt374 = {
936 .sht = &hpt37x_sht, 936 .sht = &hpt37x_sht,
937 .flags = ATA_FLAG_SLAVE_POSS|ATA_FLAG_SRST, 937 .flags = ATA_FLAG_SLAVE_POSS|ATA_FLAG_SRST,
938 .pio_mask = 0x1f, 938 .pio_mask = 0x1f,
939 .mwdma_mask = 0x07, 939 .mwdma_mask = 0x07,
940 .udma_mask = 0x7f, 940 .udma_mask = 0x3f,
941 .port_ops = &hpt374_port_ops 941 .port_ops = &hpt374_port_ops
942 }; 942 };
943 943
diff --git a/drivers/ata/pata_it821x.c b/drivers/ata/pata_it821x.c
index dab4e7cf8cda..12c6e08cc4d1 100644
--- a/drivers/ata/pata_it821x.c
+++ b/drivers/ata/pata_it821x.c
@@ -690,7 +690,7 @@ static struct ata_port_operations it821x_passthru_port_ops = {
690 .port_start = it821x_port_start, 690 .port_start = it821x_port_start,
691}; 691};
692 692
693static void __devinit it821x_disable_raid(struct pci_dev *pdev) 693static void it821x_disable_raid(struct pci_dev *pdev)
694{ 694{
695 /* Reset local CPU, and set BIOS not ready */ 695 /* Reset local CPU, and set BIOS not ready */
696 pci_write_config_byte(pdev, 0x5E, 0x01); 696 pci_write_config_byte(pdev, 0x5E, 0x01);
diff --git a/drivers/atm/Kconfig b/drivers/atm/Kconfig
index f5a47a48c3b4..5b4fab24155f 100644
--- a/drivers/atm/Kconfig
+++ b/drivers/atm/Kconfig
@@ -7,7 +7,7 @@ menuconfig ATM_DRIVERS
7 depends on NETDEVICES && ATM 7 depends on NETDEVICES && ATM
8 default y 8 default y
9 9
10if ATM_DRIVERS 10if ATM_DRIVERS && NETDEVICES && ATM
11 11
12config ATM_DUMMY 12config ATM_DUMMY
13 tristate "Dummy ATM driver" 13 tristate "Dummy ATM driver"
diff --git a/drivers/char/drm/drm_pciids.h b/drivers/char/drm/drm_pciids.h
index aa6335032d1e..30b200b01314 100644
--- a/drivers/char/drm/drm_pciids.h
+++ b/drivers/char/drm/drm_pciids.h
@@ -219,6 +219,8 @@
219 {0x1039, 0x6300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ 219 {0x1039, 0x6300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
220 {0x1039, 0x6330, PCI_ANY_ID, PCI_ANY_ID, 0, 0, SIS_CHIP_315}, \ 220 {0x1039, 0x6330, PCI_ANY_ID, PCI_ANY_ID, 0, 0, SIS_CHIP_315}, \
221 {0x1039, 0x7300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ 221 {0x1039, 0x7300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
222 {0x18CA, 0x0040, PCI_ANY_ID, PCI_ANY_ID, 0, 0, SIS_CHIP_315}, \
223 {0x18CA, 0x0042, PCI_ANY_ID, PCI_ANY_ID, 0, 0, SIS_CHIP_315}, \
222 {0, 0, 0} 224 {0, 0, 0}
223 225
224#define tdfx_PCI_IDS \ 226#define tdfx_PCI_IDS \
diff --git a/drivers/char/drm/sis_drv.h b/drivers/char/drm/sis_drv.h
index 2b8d6f6ed7c0..70d4ede75fe8 100644
--- a/drivers/char/drm/sis_drv.h
+++ b/drivers/char/drm/sis_drv.h
@@ -33,11 +33,11 @@
33 33
34#define DRIVER_AUTHOR "SIS, Tungsten Graphics" 34#define DRIVER_AUTHOR "SIS, Tungsten Graphics"
35#define DRIVER_NAME "sis" 35#define DRIVER_NAME "sis"
36#define DRIVER_DESC "SIS 300/630/540" 36#define DRIVER_DESC "SIS 300/630/540 and XGI V3XE/V5/V8"
37#define DRIVER_DATE "20060704" 37#define DRIVER_DATE "20070626"
38#define DRIVER_MAJOR 1 38#define DRIVER_MAJOR 1
39#define DRIVER_MINOR 2 39#define DRIVER_MINOR 3
40#define DRIVER_PATCHLEVEL 1 40#define DRIVER_PATCHLEVEL 0
41 41
42enum sis_family { 42enum sis_family {
43 SIS_OTHER = 0, 43 SIS_OTHER = 0,
diff --git a/drivers/dma/ioatdma.c b/drivers/dma/ioatdma.c
index 8e8726104619..850014139556 100644
--- a/drivers/dma/ioatdma.c
+++ b/drivers/dma/ioatdma.c
@@ -556,7 +556,7 @@ static struct pci_device_id ioat_pci_tbl[] = {
556 { 0, } 556 { 0, }
557}; 557};
558 558
559static struct pci_driver ioat_pci_drv = { 559static struct pci_driver ioat_pci_driver = {
560 .name = "ioatdma", 560 .name = "ioatdma",
561 .id_table = ioat_pci_tbl, 561 .id_table = ioat_pci_tbl,
562 .probe = ioat_probe, 562 .probe = ioat_probe,
@@ -699,7 +699,7 @@ static int __devinit ioat_probe(struct pci_dev *pdev,
699 if (err) 699 if (err)
700 goto err_set_dma_mask; 700 goto err_set_dma_mask;
701 701
702 err = pci_request_regions(pdev, ioat_pci_drv.name); 702 err = pci_request_regions(pdev, ioat_pci_driver.name);
703 if (err) 703 if (err)
704 goto err_request_regions; 704 goto err_request_regions;
705 705
@@ -828,14 +828,14 @@ static int __init ioat_init_module(void)
828 /* if forced, worst case is that rmmod hangs */ 828 /* if forced, worst case is that rmmod hangs */
829 __unsafe(THIS_MODULE); 829 __unsafe(THIS_MODULE);
830 830
831 return pci_register_driver(&ioat_pci_drv); 831 return pci_register_driver(&ioat_pci_driver);
832} 832}
833 833
834module_init(ioat_init_module); 834module_init(ioat_init_module);
835 835
836static void __exit ioat_exit_module(void) 836static void __exit ioat_exit_module(void)
837{ 837{
838 pci_unregister_driver(&ioat_pci_drv); 838 pci_unregister_driver(&ioat_pci_driver);
839} 839}
840 840
841module_exit(ioat_exit_module); 841module_exit(ioat_exit_module);
diff --git a/drivers/media/dvb/Kconfig b/drivers/media/dvb/Kconfig
index efd2b7468158..03ef88acd9b8 100644
--- a/drivers/media/dvb/Kconfig
+++ b/drivers/media/dvb/Kconfig
@@ -11,7 +11,7 @@ menuconfig DVB_CAPTURE_DRIVERS
11 ---help--- 11 ---help---
12 Say Y to select Digital TV adapters 12 Say Y to select Digital TV adapters
13 13
14if DVB_CAPTURE_DRIVERS 14if DVB_CAPTURE_DRIVERS && DVB_CORE
15 15
16comment "Supported SAA7146 based PCI Adapters" 16comment "Supported SAA7146 based PCI Adapters"
17 depends on DVB_CORE && PCI && I2C 17 depends on DVB_CORE && PCI && I2C
diff --git a/drivers/media/radio/Kconfig b/drivers/media/radio/Kconfig
index a6ac82a609d4..194b102140ef 100644
--- a/drivers/media/radio/Kconfig
+++ b/drivers/media/radio/Kconfig
@@ -9,7 +9,7 @@ menuconfig RADIO_ADAPTERS
9 ---help--- 9 ---help---
10 Say Y here to enable selecting AM/FM radio adapters. 10 Say Y here to enable selecting AM/FM radio adapters.
11 11
12if RADIO_ADAPTERS 12if RADIO_ADAPTERS && VIDEO_DEV
13 13
14config RADIO_CADET 14config RADIO_CADET
15 tristate "ADS Cadet AM/FM Tuner" 15 tristate "ADS Cadet AM/FM Tuner"
diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
index 4cca55170e21..4d45a40016de 100644
--- a/drivers/media/video/Kconfig
+++ b/drivers/media/video/Kconfig
@@ -11,7 +11,7 @@ menuconfig VIDEO_CAPTURE_DRIVERS
11 webcams, analog TV, and hybrid analog/digital TV. 11 webcams, analog TV, and hybrid analog/digital TV.
12 Some of those devices also supports FM radio. 12 Some of those devices also supports FM radio.
13 13
14if VIDEO_CAPTURE_DRIVERS 14if VIDEO_CAPTURE_DRIVERS && VIDEO_DEV
15 15
16config VIDEO_ADV_DEBUG 16config VIDEO_ADV_DEBUG
17 bool "Enable advanced debug functionality" 17 bool "Enable advanced debug functionality"
@@ -347,7 +347,7 @@ endmenu # encoder / decoder chips
347 347
348config VIDEO_VIVI 348config VIDEO_VIVI
349 tristate "Virtual Video Driver" 349 tristate "Virtual Video Driver"
350 depends on VIDEO_V4L2 && !SPARC32 && !SPARC64 && PCI && VIDEO_DEV 350 depends on VIDEO_V4L2 && !SPARC32 && !SPARC64 && PCI
351 select VIDEO_BUF 351 select VIDEO_BUF
352 default n 352 default n
353 ---help--- 353 ---help---
@@ -691,7 +691,7 @@ menuconfig V4L_USB_DRIVERS
691 depends on USB 691 depends on USB
692 default y 692 default y
693 693
694if V4L_USB_DRIVERS 694if V4L_USB_DRIVERS && USB
695 695
696source "drivers/media/video/pvrusb2/Kconfig" 696source "drivers/media/video/pvrusb2/Kconfig"
697 697
diff --git a/drivers/media/video/saa7134/saa7134-tvaudio.c b/drivers/media/video/saa7134/saa7134-tvaudio.c
index 7b56041186dc..30395d6b5f14 100644
--- a/drivers/media/video/saa7134/saa7134-tvaudio.c
+++ b/drivers/media/video/saa7134/saa7134-tvaudio.c
@@ -1005,7 +1005,7 @@ int saa7134_tvaudio_init2(struct saa7134_dev *dev)
1005int saa7134_tvaudio_fini(struct saa7134_dev *dev) 1005int saa7134_tvaudio_fini(struct saa7134_dev *dev)
1006{ 1006{
1007 /* shutdown tvaudio thread */ 1007 /* shutdown tvaudio thread */
1008 if (dev->thread.pid >= 0) { 1008 if (dev->thread.pid > 0) {
1009 dev->thread.shutdown = 1; 1009 dev->thread.shutdown = 1;
1010 wake_up_interruptible(&dev->thread.wq); 1010 wake_up_interruptible(&dev->thread.wq);
1011 wait_for_completion(&dev->thread.exit); 1011 wait_for_completion(&dev->thread.exit);
diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c
index c39ab803c5d8..c27cfcef45fa 100644
--- a/drivers/net/au1000_eth.c
+++ b/drivers/net/au1000_eth.c
@@ -34,7 +34,7 @@
34 * 34 *
35 * 35 *
36 */ 36 */
37 37#include <linux/dma-mapping.h>
38#include <linux/module.h> 38#include <linux/module.h>
39#include <linux/kernel.h> 39#include <linux/kernel.h>
40#include <linux/string.h> 40#include <linux/string.h>
diff --git a/drivers/net/cxgb3/xgmac.c b/drivers/net/cxgb3/xgmac.c
index b261be147e7b..c302b1a30cba 100644
--- a/drivers/net/cxgb3/xgmac.c
+++ b/drivers/net/cxgb3/xgmac.c
@@ -335,11 +335,11 @@ int t3_mac_set_mtu(struct cmac *mac, unsigned int mtu)
335 hwm = min(hwm, MAC_RXFIFO_SIZE - 8192); 335 hwm = min(hwm, MAC_RXFIFO_SIZE - 8192);
336 lwm = min(3 * (int)mtu, MAC_RXFIFO_SIZE / 4); 336 lwm = min(3 * (int)mtu, MAC_RXFIFO_SIZE / 4);
337 337
338 v = t3_read_reg(adap, A_XGM_RXFIFO_CFG + mac->offset);
339 if (adap->params.rev == T3_REV_B2 && 338 if (adap->params.rev == T3_REV_B2 &&
340 (t3_read_reg(adap, A_XGM_RX_CTRL + mac->offset) & F_RXEN)) { 339 (t3_read_reg(adap, A_XGM_RX_CTRL + mac->offset) & F_RXEN)) {
341 disable_exact_filters(mac); 340 disable_exact_filters(mac);
342 t3_set_reg_field(adap, A_XGM_RXFIFO_CFG + mac->offset, 341 v = t3_read_reg(adap, A_XGM_RX_CFG + mac->offset);
342 t3_set_reg_field(adap, A_XGM_RX_CFG + mac->offset,
343 F_ENHASHMCAST | F_COPYALLFRAMES, F_DISBCAST); 343 F_ENHASHMCAST | F_COPYALLFRAMES, F_DISBCAST);
344 344
345 /* drain rx FIFO */ 345 /* drain rx FIFO */
@@ -347,11 +347,12 @@ int t3_mac_set_mtu(struct cmac *mac, unsigned int mtu)
347 A_XGM_RX_MAX_PKT_SIZE_ERR_CNT + 347 A_XGM_RX_MAX_PKT_SIZE_ERR_CNT +
348 mac->offset, 348 mac->offset,
349 1 << 31, 1, 20, 5)) { 349 1 << 31, 1, 20, 5)) {
350 t3_write_reg(adap, A_XGM_RXFIFO_CFG + mac->offset, v); 350 t3_write_reg(adap, A_XGM_RX_CFG + mac->offset, v);
351 enable_exact_filters(mac); 351 enable_exact_filters(mac);
352 return -EIO; 352 return -EIO;
353 } 353 }
354 t3_write_reg(adap, A_XGM_RX_MAX_PKT_SIZE + mac->offset, mtu); 354 t3_write_reg(adap, A_XGM_RX_MAX_PKT_SIZE + mac->offset, mtu);
355 t3_write_reg(adap, A_XGM_RX_CFG + mac->offset, v);
355 enable_exact_filters(mac); 356 enable_exact_filters(mac);
356 } else 357 } else
357 t3_write_reg(adap, A_XGM_RX_MAX_PKT_SIZE + mac->offset, mtu); 358 t3_write_reg(adap, A_XGM_RX_MAX_PKT_SIZE + mac->offset, mtu);
@@ -362,6 +363,7 @@ int t3_mac_set_mtu(struct cmac *mac, unsigned int mtu)
362 */ 363 */
363 hwm = rx_fifo_hwm(mtu); 364 hwm = rx_fifo_hwm(mtu);
364 lwm = min(3 * (int)mtu, MAC_RXFIFO_SIZE / 4); 365 lwm = min(3 * (int)mtu, MAC_RXFIFO_SIZE / 4);
366 v = t3_read_reg(adap, A_XGM_RXFIFO_CFG + mac->offset);
365 v &= ~V_RXFIFOPAUSELWM(M_RXFIFOPAUSELWM); 367 v &= ~V_RXFIFOPAUSELWM(M_RXFIFOPAUSELWM);
366 v |= V_RXFIFOPAUSELWM(lwm / 8); 368 v |= V_RXFIFOPAUSELWM(lwm / 8);
367 if (G_RXFIFOPAUSEHWM(v)) 369 if (G_RXFIFOPAUSEHWM(v))
diff --git a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c
index 9043bf4aa49e..2803b370ba01 100644
--- a/drivers/net/irda/smsc-ircc2.c
+++ b/drivers/net/irda/smsc-ircc2.c
@@ -416,6 +416,13 @@ static int __init smsc_ircc_legacy_probe(void)
416{ 416{
417 int ret = 0; 417 int ret = 0;
418 418
419#ifdef CONFIG_PCI
420 if (smsc_ircc_preconfigure_subsystems(ircc_cfg, ircc_fir, ircc_sir, ircc_dma, ircc_irq) < 0) {
421 /* Ignore errors from preconfiguration */
422 IRDA_ERROR("%s, Preconfiguration failed !\n", driver_name);
423 }
424#endif
425
419 if (ircc_fir > 0 && ircc_sir > 0) { 426 if (ircc_fir > 0 && ircc_sir > 0) {
420 IRDA_MESSAGE(" Overriding FIR address 0x%04x\n", ircc_fir); 427 IRDA_MESSAGE(" Overriding FIR address 0x%04x\n", ircc_fir);
421 IRDA_MESSAGE(" Overriding SIR address 0x%04x\n", ircc_sir); 428 IRDA_MESSAGE(" Overriding SIR address 0x%04x\n", ircc_sir);
@@ -459,13 +466,6 @@ static int __init smsc_ircc_init(void)
459 return ret; 466 return ret;
460 } 467 }
461 468
462#ifdef CONFIG_PCI
463 if (smsc_ircc_preconfigure_subsystems(ircc_cfg, ircc_fir, ircc_sir, ircc_dma, ircc_irq) < 0) {
464 /* Ignore errors from preconfiguration */
465 IRDA_ERROR("%s, Preconfiguration failed !\n", driver_name);
466 }
467#endif
468
469 dev_count = 0; 469 dev_count = 0;
470 470
471 if (smsc_nopnp || !pnp_platform_devices || 471 if (smsc_nopnp || !pnp_platform_devices ||
diff --git a/drivers/net/pcmcia/Kconfig b/drivers/net/pcmcia/Kconfig
index 5d658bc9791c..e8f55d8ed7a9 100644
--- a/drivers/net/pcmcia/Kconfig
+++ b/drivers/net/pcmcia/Kconfig
@@ -19,7 +19,7 @@ menuconfig NET_PCMCIA
19 19
20 If unsure, say N. 20 If unsure, say N.
21 21
22if NET_PCMCIA 22if NET_PCMCIA && PCMCIA
23 23
24config PCMCIA_3C589 24config PCMCIA_3C589
25 tristate "3Com 3c589 PCMCIA support" 25 tristate "3Com 3c589 PCMCIA support"
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index fc4aee96cdfd..fc2f0e695a13 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -131,7 +131,8 @@ static int mdio_bus_match(struct device *dev, struct device_driver *drv)
131 struct phy_device *phydev = to_phy_device(dev); 131 struct phy_device *phydev = to_phy_device(dev);
132 struct phy_driver *phydrv = to_phy_driver(drv); 132 struct phy_driver *phydrv = to_phy_driver(drv);
133 133
134 return (phydrv->phy_id == (phydev->phy_id & phydrv->phy_id_mask)); 134 return ((phydrv->phy_id & phydrv->phy_id_mask) ==
135 (phydev->phy_id & phydrv->phy_id_mask));
135} 136}
136 137
137/* Suspend and resume. Copied from platform_suspend and 138/* Suspend and resume. Copied from platform_suspend and
diff --git a/drivers/net/phy/vitesse.c b/drivers/net/phy/vitesse.c
index 792716beb052..596222b260d6 100644
--- a/drivers/net/phy/vitesse.c
+++ b/drivers/net/phy/vitesse.c
@@ -84,7 +84,7 @@ static int vsc824x_config_intr(struct phy_device *phydev)
84 84
85/* Vitesse 824x */ 85/* Vitesse 824x */
86static struct phy_driver vsc8244_driver = { 86static struct phy_driver vsc8244_driver = {
87 .phy_id = 0x000fc6c2, 87 .phy_id = 0x000fc6c0,
88 .name = "Vitesse VSC8244", 88 .name = "Vitesse VSC8244",
89 .phy_id_mask = 0x000fffc0, 89 .phy_id_mask = 0x000fffc0,
90 .features = PHY_GBIT_FEATURES, 90 .features = PHY_GBIT_FEATURES,
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index c6ba3dee8ae0..09078ff84cd2 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -2868,6 +2868,7 @@ static void tx_intr_handler(struct fifo_info *fifo_data)
2868 struct tx_curr_get_info get_info, put_info; 2868 struct tx_curr_get_info get_info, put_info;
2869 struct sk_buff *skb; 2869 struct sk_buff *skb;
2870 struct TxD *txdlp; 2870 struct TxD *txdlp;
2871 u8 err_mask;
2871 2872
2872 get_info = fifo_data->tx_curr_get_info; 2873 get_info = fifo_data->tx_curr_get_info;
2873 memcpy(&put_info, &fifo_data->tx_curr_put_info, sizeof(put_info)); 2874 memcpy(&put_info, &fifo_data->tx_curr_put_info, sizeof(put_info));
@@ -2886,8 +2887,8 @@ static void tx_intr_handler(struct fifo_info *fifo_data)
2886 } 2887 }
2887 2888
2888 /* update t_code statistics */ 2889 /* update t_code statistics */
2889 err >>= 48; 2890 err_mask = err >> 48;
2890 switch(err) { 2891 switch(err_mask) {
2891 case 2: 2892 case 2:
2892 nic->mac_control.stats_info->sw_stat. 2893 nic->mac_control.stats_info->sw_stat.
2893 tx_buf_abort_cnt++; 2894 tx_buf_abort_cnt++;
@@ -6805,6 +6806,7 @@ static int rx_osm_handler(struct ring_info *ring_data, struct RxD_t * rxdp)
6805 u16 l3_csum, l4_csum; 6806 u16 l3_csum, l4_csum;
6806 unsigned long long err = rxdp->Control_1 & RXD_T_CODE; 6807 unsigned long long err = rxdp->Control_1 & RXD_T_CODE;
6807 struct lro *lro; 6808 struct lro *lro;
6809 u8 err_mask;
6808 6810
6809 skb->dev = dev; 6811 skb->dev = dev;
6810 6812
@@ -6813,8 +6815,8 @@ static int rx_osm_handler(struct ring_info *ring_data, struct RxD_t * rxdp)
6813 if (err & 0x1) { 6815 if (err & 0x1) {
6814 sp->mac_control.stats_info->sw_stat.parity_err_cnt++; 6816 sp->mac_control.stats_info->sw_stat.parity_err_cnt++;
6815 } 6817 }
6816 err >>= 48; 6818 err_mask = err >> 48;
6817 switch(err) { 6819 switch(err_mask) {
6818 case 1: 6820 case 1:
6819 sp->mac_control.stats_info->sw_stat. 6821 sp->mac_control.stats_info->sw_stat.
6820 rx_parity_err_cnt++; 6822 rx_parity_err_cnt++;
@@ -6867,9 +6869,9 @@ static int rx_osm_handler(struct ring_info *ring_data, struct RxD_t * rxdp)
6867 * Note that in this case, since checksum will be incorrect, 6869 * Note that in this case, since checksum will be incorrect,
6868 * stack will validate the same. 6870 * stack will validate the same.
6869 */ 6871 */
6870 if (err != 0x5) { 6872 if (err_mask != 0x5) {
6871 DBG_PRINT(ERR_DBG, "%s: Rx error Value: 0x%llx\n", 6873 DBG_PRINT(ERR_DBG, "%s: Rx error Value: 0x%x\n",
6872 dev->name, err); 6874 dev->name, err_mask);
6873 sp->stats.rx_crc_errors++; 6875 sp->stats.rx_crc_errors++;
6874 sp->mac_control.stats_info->sw_stat.mem_freed 6876 sp->mac_control.stats_info->sw_stat.mem_freed
6875 += skb->truesize; 6877 += skb->truesize;
diff --git a/drivers/pnp/quirks.c b/drivers/pnp/quirks.c
index 277df50c89ae..967a8e22b2da 100644
--- a/drivers/pnp/quirks.c
+++ b/drivers/pnp/quirks.c
@@ -107,31 +107,61 @@ static void quirk_sb16audio_resources(struct pnp_dev *dev)
107 return; 107 return;
108} 108}
109 109
110static void quirk_smc_enable(struct pnp_dev *dev) 110static int quirk_smc_fir_enabled(struct pnp_dev *dev)
111{ 111{
112 unsigned int firbase; 112 unsigned long firbase;
113 u8 bank, high, low, chip;
114
115 if (!pnp_port_valid(dev, 1))
116 return 0;
117
118 firbase = pnp_port_start(dev, 1);
119
120 /* Select register bank 3 */
121 bank = inb(firbase + 7);
122 bank &= 0xf0;
123 bank |= 3;
124 outb(bank, firbase + 7);
125
126 high = inb(firbase + 0);
127 low = inb(firbase + 1);
128 chip = inb(firbase + 2);
129
130 /* This corresponds to the check in smsc_ircc_present() */
131 if (high == 0x10 && low == 0xb8 && (chip == 0xf1 || chip == 0xf2))
132 return 1;
133
134 return 0;
135}
113 136
114 if (!dev->active || !pnp_port_valid(dev, 1)) 137static void quirk_smc_enable(struct pnp_dev *dev)
138{
139 /*
140 * If the BIOS left the device disabled, or it is enabled and
141 * responding correctly, we're in good shape.
142 */
143 if (!dev->active || quirk_smc_fir_enabled(dev))
115 return; 144 return;
116 145
117 /* 146 /*
118 * On the HP/Compaq nw8240 (and probably other similar machines), 147 * Sometimes the BIOS claims the device is enabled, but it reports
119 * there is an SMCF010 device with two I/O port regions: 148 * the wrong FIR resources or doesn't properly configure ISA or LPC
120 * 149 * bridges on the way to the device.
121 * 0x3e8-0x3ef SIR
122 * 0x100-0x10f FIR
123 * 150 *
124 * _STA reports the device is enabled, but in fact, the BIOS 151 * HP nc6000 and nc8000/nw8000 laptops have known problems like
125 * neglects to enable the FIR range. Fortunately, it does fully 152 * this. Fortunately, they do fix things up if we auto-configure
126 * enable the device if we call _SRS. 153 * the device using its _PRS and _SRS methods.
127 */ 154 */
128 firbase = pnp_port_start(dev, 1); 155 dev_err(&dev->dev, "%s device not responding, auto-configuring "
129 if (inb(firbase + 0x7 /* IRCC_MASTER */) == 0xff) { 156 "resources\n", dev->id->id);
130 pnp_err("%s (%s) enabled but not responding, disabling and " 157
131 "re-enabling", dev->dev.bus_id, pnp_dev_name(dev)); 158 pnp_disable_dev(dev);
132 pnp_disable_dev(dev); 159 pnp_init_resource_table(&dev->res);
133 pnp_activate_dev(dev); 160 pnp_auto_config_dev(dev);
134 } 161 pnp_activate_dev(dev);
162
163 if (!quirk_smc_fir_enabled(dev))
164 dev_err(&dev->dev, "giving up; try \"smsc-ircc2.nopnp\"\n");
135} 165}
136 166
137 167
diff --git a/drivers/serial/mpsc.c b/drivers/serial/mpsc.c
index d09f2097d5b0..00924feaf621 100644
--- a/drivers/serial/mpsc.c
+++ b/drivers/serial/mpsc.c
@@ -503,7 +503,8 @@ mpsc_sdma_intr_ack(struct mpsc_port_info *pi)
503 503
504 if (pi->mirror_regs) 504 if (pi->mirror_regs)
505 pi->shared_regs->SDMA_INTR_CAUSE_m = 0; 505 pi->shared_regs->SDMA_INTR_CAUSE_m = 0;
506 writel(0, pi->shared_regs->sdma_intr_base + SDMA_INTR_CAUSE); 506 writeb(0x00, pi->shared_regs->sdma_intr_base + SDMA_INTR_CAUSE +
507 pi->port.line);
507 return; 508 return;
508} 509}
509 510
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index 8d3455da663a..2fbff6317433 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -2290,15 +2290,6 @@ static int __devinit aty_init(struct fb_info *info)
2290 init_waitqueue_head(&par->vblank.wait); 2290 init_waitqueue_head(&par->vblank.wait);
2291 spin_lock_init(&par->int_lock); 2291 spin_lock_init(&par->int_lock);
2292 2292
2293#ifdef CONFIG_PPC_PMAC
2294 /* The Apple iBook1 uses non-standard memory frequencies. We detect it
2295 * and set the frequency manually. */
2296 if (machine_is_compatible("PowerBook2,1")) {
2297 par->pll_limits.mclk = 70;
2298 par->pll_limits.xclk = 53;
2299 }
2300#endif
2301
2302#ifdef CONFIG_FB_ATY_GX 2293#ifdef CONFIG_FB_ATY_GX
2303 if (!M64_HAS(INTEGRATED)) { 2294 if (!M64_HAS(INTEGRATED)) {
2304 u32 stat0; 2295 u32 stat0;
@@ -2383,6 +2374,14 @@ static int __devinit aty_init(struct fb_info *info)
2383 par->pll_limits.xclk = (par->pll_limits.xclk + 1) >> 1; 2374 par->pll_limits.xclk = (par->pll_limits.xclk + 1) >> 1;
2384 } 2375 }
2385#endif 2376#endif
2377#ifdef CONFIG_PPC_PMAC
2378 /* The Apple iBook1 uses non-standard memory frequencies. We detect it
2379 * and set the frequency manually. */
2380 if (machine_is_compatible("PowerBook2,1")) {
2381 par->pll_limits.mclk = 70;
2382 par->pll_limits.xclk = 53;
2383 }
2384#endif
2386 2385
2387 /* Allow command line to override clocks. */ 2386 /* Allow command line to override clocks. */
2388 if (pll) 2387 if (pll)
diff --git a/drivers/video/chipsfb.c b/drivers/video/chipsfb.c
index af313bf1a2da..f48e8c534c87 100644
--- a/drivers/video/chipsfb.c
+++ b/drivers/video/chipsfb.c
@@ -292,7 +292,7 @@ static void __init chips_hw_init(void)
292 write_fr(chips_init_fr[i].addr, chips_init_fr[i].data); 292 write_fr(chips_init_fr[i].addr, chips_init_fr[i].data);
293} 293}
294 294
295static struct fb_fix_screeninfo chipsfb_fix __initdata = { 295static struct fb_fix_screeninfo chipsfb_fix __devinitdata = {
296 .id = "C&T 65550", 296 .id = "C&T 65550",
297 .type = FB_TYPE_PACKED_PIXELS, 297 .type = FB_TYPE_PACKED_PIXELS,
298 .visual = FB_VISUAL_PSEUDOCOLOR, 298 .visual = FB_VISUAL_PSEUDOCOLOR,
@@ -309,7 +309,7 @@ static struct fb_fix_screeninfo chipsfb_fix __initdata = {
309 .smem_len = 0x100000, /* 1MB */ 309 .smem_len = 0x100000, /* 1MB */
310}; 310};
311 311
312static struct fb_var_screeninfo chipsfb_var __initdata = { 312static struct fb_var_screeninfo chipsfb_var __devinitdata = {
313 .xres = 800, 313 .xres = 800,
314 .yres = 600, 314 .yres = 600,
315 .xres_virtual = 800, 315 .xres_virtual = 800,
@@ -330,7 +330,7 @@ static struct fb_var_screeninfo chipsfb_var __initdata = {
330 .vsync_len = 8, 330 .vsync_len = 8,
331}; 331};
332 332
333static void __init init_chips(struct fb_info *p, unsigned long addr) 333static void __devinit init_chips(struct fb_info *p, unsigned long addr)
334{ 334{
335 memset(p->screen_base, 0, 0x100000); 335 memset(p->screen_base, 0, 0x100000);
336 336
diff --git a/drivers/w1/slaves/w1_therm.c b/drivers/w1/slaves/w1_therm.c
index 732db4780042..1a6937dc190b 100644
--- a/drivers/w1/slaves/w1_therm.c
+++ b/drivers/w1/slaves/w1_therm.c
@@ -191,11 +191,7 @@ static ssize_t w1_therm_read_bin(struct kobject *kobj, char *buf, loff_t off, si
191 191
192 w1_write_8(dev, W1_CONVERT_TEMP); 192 w1_write_8(dev, W1_CONVERT_TEMP);
193 193
194 while (tm) { 194 msleep(tm);
195 tm = msleep_interruptible(tm);
196 if (signal_pending(current))
197 flush_signals(current);
198 }
199 195
200 if (!w1_reset_select_slave(sl)) { 196 if (!w1_reset_select_slave(sl)) {
201 197
diff --git a/fs/ecryptfs/ecryptfs_kernel.h b/fs/ecryptfs/ecryptfs_kernel.h
index 403e3bad1455..1b9dd9a96f19 100644
--- a/fs/ecryptfs/ecryptfs_kernel.h
+++ b/fs/ecryptfs/ecryptfs_kernel.h
@@ -580,5 +580,7 @@ void
580ecryptfs_write_header_metadata(char *virt, 580ecryptfs_write_header_metadata(char *virt,
581 struct ecryptfs_crypt_stat *crypt_stat, 581 struct ecryptfs_crypt_stat *crypt_stat,
582 size_t *written); 582 size_t *written);
583int ecryptfs_write_zeros(struct file *file, pgoff_t index, int start,
584 int num_zeros);
583 585
584#endif /* #ifndef ECRYPTFS_KERNEL_H */ 586#endif /* #ifndef ECRYPTFS_KERNEL_H */
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
index 1548be26b5e6..83e94fedd4e9 100644
--- a/fs/ecryptfs/inode.c
+++ b/fs/ecryptfs/inode.c
@@ -800,6 +800,25 @@ int ecryptfs_truncate(struct dentry *dentry, loff_t new_length)
800 goto out_fput; 800 goto out_fput;
801 } 801 }
802 } else { /* new_length < i_size_read(inode) */ 802 } else { /* new_length < i_size_read(inode) */
803 pgoff_t index = 0;
804 int end_pos_in_page = -1;
805
806 if (new_length != 0) {
807 index = ((new_length - 1) >> PAGE_CACHE_SHIFT);
808 end_pos_in_page = ((new_length - 1) & ~PAGE_CACHE_MASK);
809 }
810 if (end_pos_in_page != (PAGE_CACHE_SIZE - 1)) {
811 if ((rc = ecryptfs_write_zeros(&fake_ecryptfs_file,
812 index,
813 (end_pos_in_page + 1),
814 ((PAGE_CACHE_SIZE - 1)
815 - end_pos_in_page)))) {
816 printk(KERN_ERR "Error attempting to zero out "
817 "the remainder of the end page on "
818 "reducing truncate; rc = [%d]\n", rc);
819 goto out_fput;
820 }
821 }
803 vmtruncate(inode, new_length); 822 vmtruncate(inode, new_length);
804 rc = ecryptfs_write_inode_size_to_metadata( 823 rc = ecryptfs_write_inode_size_to_metadata(
805 lower_file, lower_dentry->d_inode, inode, dentry, 824 lower_file, lower_dentry->d_inode, inode, dentry,
@@ -875,9 +894,54 @@ static int ecryptfs_setattr(struct dentry *dentry, struct iattr *ia)
875 struct ecryptfs_crypt_stat *crypt_stat; 894 struct ecryptfs_crypt_stat *crypt_stat;
876 895
877 crypt_stat = &ecryptfs_inode_to_private(dentry->d_inode)->crypt_stat; 896 crypt_stat = &ecryptfs_inode_to_private(dentry->d_inode)->crypt_stat;
878 lower_dentry = ecryptfs_dentry_to_lower(dentry); 897 if (!(crypt_stat->flags & ECRYPTFS_STRUCT_INITIALIZED))
898 ecryptfs_init_crypt_stat(crypt_stat);
879 inode = dentry->d_inode; 899 inode = dentry->d_inode;
880 lower_inode = ecryptfs_inode_to_lower(inode); 900 lower_inode = ecryptfs_inode_to_lower(inode);
901 lower_dentry = ecryptfs_dentry_to_lower(dentry);
902 mutex_lock(&crypt_stat->cs_mutex);
903 if (S_ISDIR(dentry->d_inode->i_mode))
904 crypt_stat->flags &= ~(ECRYPTFS_ENCRYPTED);
905 else if (!(crypt_stat->flags & ECRYPTFS_POLICY_APPLIED)
906 || !(crypt_stat->flags & ECRYPTFS_KEY_VALID)) {
907 struct vfsmount *lower_mnt;
908 struct file *lower_file = NULL;
909 struct ecryptfs_mount_crypt_stat *mount_crypt_stat;
910 int lower_flags;
911
912 lower_mnt = ecryptfs_dentry_to_lower_mnt(dentry);
913 lower_flags = O_RDONLY;
914 if ((rc = ecryptfs_open_lower_file(&lower_file, lower_dentry,
915 lower_mnt, lower_flags))) {
916 printk(KERN_ERR
917 "Error opening lower file; rc = [%d]\n", rc);
918 mutex_unlock(&crypt_stat->cs_mutex);
919 goto out;
920 }
921 mount_crypt_stat = &ecryptfs_superblock_to_private(
922 dentry->d_sb)->mount_crypt_stat;
923 if ((rc = ecryptfs_read_metadata(dentry, lower_file))) {
924 if (!(mount_crypt_stat->flags
925 & ECRYPTFS_PLAINTEXT_PASSTHROUGH_ENABLED)) {
926 rc = -EIO;
927 printk(KERN_WARNING "Attempt to read file that "
928 "is not in a valid eCryptfs format, "
929 "and plaintext passthrough mode is not "
930 "enabled; returning -EIO\n");
931
932 mutex_unlock(&crypt_stat->cs_mutex);
933 fput(lower_file);
934 goto out;
935 }
936 rc = 0;
937 crypt_stat->flags &= ~(ECRYPTFS_ENCRYPTED);
938 mutex_unlock(&crypt_stat->cs_mutex);
939 fput(lower_file);
940 goto out;
941 }
942 fput(lower_file);
943 }
944 mutex_unlock(&crypt_stat->cs_mutex);
881 if (ia->ia_valid & ATTR_SIZE) { 945 if (ia->ia_valid & ATTR_SIZE) {
882 ecryptfs_printk(KERN_DEBUG, 946 ecryptfs_printk(KERN_DEBUG,
883 "ia->ia_valid = [0x%x] ATTR_SIZE" " = [0x%x]\n", 947 "ia->ia_valid = [0x%x] ATTR_SIZE" " = [0x%x]\n",
diff --git a/fs/ecryptfs/mmap.c b/fs/ecryptfs/mmap.c
index 55cec98a84e7..7d5a43cb0d5c 100644
--- a/fs/ecryptfs/mmap.c
+++ b/fs/ecryptfs/mmap.c
@@ -56,9 +56,6 @@ static struct page *ecryptfs_get1page(struct file *file, int index)
56 return read_mapping_page(mapping, index, (void *)file); 56 return read_mapping_page(mapping, index, (void *)file);
57} 57}
58 58
59static
60int write_zeros(struct file *file, pgoff_t index, int start, int num_zeros);
61
62/** 59/**
63 * ecryptfs_fill_zeros 60 * ecryptfs_fill_zeros
64 * @file: The ecryptfs file 61 * @file: The ecryptfs file
@@ -101,10 +98,13 @@ int ecryptfs_fill_zeros(struct file *file, loff_t new_length)
101 if (old_end_page_index == new_end_page_index) { 98 if (old_end_page_index == new_end_page_index) {
102 /* Start and end are in the same page; we just need to 99 /* Start and end are in the same page; we just need to
103 * set a portion of the existing page to zero's */ 100 * set a portion of the existing page to zero's */
104 rc = write_zeros(file, index, (old_end_pos_in_page + 1), 101 rc = ecryptfs_write_zeros(file, index,
105 (new_end_pos_in_page - old_end_pos_in_page)); 102 (old_end_pos_in_page + 1),
103 (new_end_pos_in_page
104 - old_end_pos_in_page));
106 if (rc) 105 if (rc)
107 ecryptfs_printk(KERN_ERR, "write_zeros(file=[%p], " 106 ecryptfs_printk(KERN_ERR, "ecryptfs_write_zeros("
107 "file=[%p], "
108 "index=[0x%.16x], " 108 "index=[0x%.16x], "
109 "old_end_pos_in_page=[d], " 109 "old_end_pos_in_page=[d], "
110 "(PAGE_CACHE_SIZE - new_end_pos_in_page" 110 "(PAGE_CACHE_SIZE - new_end_pos_in_page"
@@ -117,10 +117,10 @@ int ecryptfs_fill_zeros(struct file *file, loff_t new_length)
117 goto out; 117 goto out;
118 } 118 }
119 /* Fill the remainder of the previous last page with zeros */ 119 /* Fill the remainder of the previous last page with zeros */
120 rc = write_zeros(file, index, (old_end_pos_in_page + 1), 120 rc = ecryptfs_write_zeros(file, index, (old_end_pos_in_page + 1),
121 ((PAGE_CACHE_SIZE - 1) - old_end_pos_in_page)); 121 ((PAGE_CACHE_SIZE - 1) - old_end_pos_in_page));
122 if (rc) { 122 if (rc) {
123 ecryptfs_printk(KERN_ERR, "write_zeros(file=[%p], " 123 ecryptfs_printk(KERN_ERR, "ecryptfs_write_zeros(file=[%p], "
124 "index=[0x%.16x], old_end_pos_in_page=[d], " 124 "index=[0x%.16x], old_end_pos_in_page=[d], "
125 "(PAGE_CACHE_SIZE - old_end_pos_in_page)=[d]) " 125 "(PAGE_CACHE_SIZE - old_end_pos_in_page)=[d]) "
126 "returned [%d]\n", file, index, 126 "returned [%d]\n", file, index,
@@ -131,9 +131,10 @@ int ecryptfs_fill_zeros(struct file *file, loff_t new_length)
131 index++; 131 index++;
132 while (index < new_end_page_index) { 132 while (index < new_end_page_index) {
133 /* Fill all intermediate pages with zeros */ 133 /* Fill all intermediate pages with zeros */
134 rc = write_zeros(file, index, 0, PAGE_CACHE_SIZE); 134 rc = ecryptfs_write_zeros(file, index, 0, PAGE_CACHE_SIZE);
135 if (rc) { 135 if (rc) {
136 ecryptfs_printk(KERN_ERR, "write_zeros(file=[%p], " 136 ecryptfs_printk(KERN_ERR, "ecryptfs_write_zeros("
137 "file=[%p], "
137 "index=[0x%.16x], " 138 "index=[0x%.16x], "
138 "old_end_pos_in_page=[d], " 139 "old_end_pos_in_page=[d], "
139 "(PAGE_CACHE_SIZE - new_end_pos_in_page" 140 "(PAGE_CACHE_SIZE - new_end_pos_in_page"
@@ -149,9 +150,9 @@ int ecryptfs_fill_zeros(struct file *file, loff_t new_length)
149 } 150 }
150 /* Fill the portion at the beginning of the last new page with 151 /* Fill the portion at the beginning of the last new page with
151 * zero's */ 152 * zero's */
152 rc = write_zeros(file, index, 0, (new_end_pos_in_page + 1)); 153 rc = ecryptfs_write_zeros(file, index, 0, (new_end_pos_in_page + 1));
153 if (rc) { 154 if (rc) {
154 ecryptfs_printk(KERN_ERR, "write_zeros(file=" 155 ecryptfs_printk(KERN_ERR, "ecryptfs_write_zeros(file="
155 "[%p], index=[0x%.16x], 0, " 156 "[%p], index=[0x%.16x], 0, "
156 "new_end_pos_in_page=[%d]" 157 "new_end_pos_in_page=[%d]"
157 "returned [%d]\n", file, index, 158 "returned [%d]\n", file, index,
@@ -400,7 +401,6 @@ out:
400static int ecryptfs_prepare_write(struct file *file, struct page *page, 401static int ecryptfs_prepare_write(struct file *file, struct page *page,
401 unsigned from, unsigned to) 402 unsigned from, unsigned to)
402{ 403{
403 loff_t pos;
404 int rc = 0; 404 int rc = 0;
405 405
406 if (from == 0 && to == PAGE_CACHE_SIZE) 406 if (from == 0 && to == PAGE_CACHE_SIZE)
@@ -408,15 +408,22 @@ static int ecryptfs_prepare_write(struct file *file, struct page *page,
408 up to date. */ 408 up to date. */
409 if (!PageUptodate(page)) 409 if (!PageUptodate(page))
410 rc = ecryptfs_do_readpage(file, page, page->index); 410 rc = ecryptfs_do_readpage(file, page, page->index);
411 pos = ((loff_t)page->index << PAGE_CACHE_SHIFT) + to; 411 if (page->index != 0) {
412 if (pos > i_size_read(page->mapping->host)) { 412 loff_t end_of_prev_pg_pos =
413 rc = ecryptfs_truncate(file->f_path.dentry, pos); 413 (((loff_t)page->index << PAGE_CACHE_SHIFT) - 1);
414 if (rc) { 414
415 printk(KERN_ERR "Error on attempt to " 415 if (end_of_prev_pg_pos > i_size_read(page->mapping->host)) {
416 "truncate to (higher) offset [%lld];" 416 rc = ecryptfs_truncate(file->f_path.dentry,
417 " rc = [%d]\n", pos, rc); 417 end_of_prev_pg_pos);
418 goto out; 418 if (rc) {
419 printk(KERN_ERR "Error on attempt to "
420 "truncate to (higher) offset [%lld];"
421 " rc = [%d]\n", end_of_prev_pg_pos, rc);
422 goto out;
423 }
419 } 424 }
425 if (end_of_prev_pg_pos + 1 > i_size_read(page->mapping->host))
426 zero_user_page(page, 0, PAGE_CACHE_SIZE, KM_USER0);
420 } 427 }
421out: 428out:
422 return rc; 429 return rc;
@@ -753,7 +760,7 @@ out:
753} 760}
754 761
755/** 762/**
756 * write_zeros 763 * ecryptfs_write_zeros
757 * @file: The ecryptfs file 764 * @file: The ecryptfs file
758 * @index: The index in which we are writing 765 * @index: The index in which we are writing
759 * @start: The position after the last block of data 766 * @start: The position after the last block of data
@@ -763,8 +770,8 @@ out:
763 * 770 *
764 * (start + num_zeros) must be less than or equal to PAGE_CACHE_SIZE 771 * (start + num_zeros) must be less than or equal to PAGE_CACHE_SIZE
765 */ 772 */
766static 773int
767int write_zeros(struct file *file, pgoff_t index, int start, int num_zeros) 774ecryptfs_write_zeros(struct file *file, pgoff_t index, int start, int num_zeros)
768{ 775{
769 int rc = 0; 776 int rc = 0;
770 struct page *tmp_page; 777 struct page *tmp_page;
diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index c9fd8cf6eaa9..5de5061eb331 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -1043,6 +1043,7 @@ static int ext2_remount (struct super_block * sb, int * flags, char * data)
1043 1043
1044 if ((ext2_use_xip(sb)) && (sb->s_blocksize != PAGE_SIZE)) { 1044 if ((ext2_use_xip(sb)) && (sb->s_blocksize != PAGE_SIZE)) {
1045 printk("XIP: Unsupported blocksize\n"); 1045 printk("XIP: Unsupported blocksize\n");
1046 err = -EINVAL;
1046 goto restore_opts; 1047 goto restore_opts;
1047 } 1048 }
1048 1049
diff --git a/fs/signalfd.c b/fs/signalfd.c
index f1da89203a9a..3b07f26d984d 100644
--- a/fs/signalfd.c
+++ b/fs/signalfd.c
@@ -133,7 +133,8 @@ static unsigned int signalfd_poll(struct file *file, poll_table *wait)
133 * the peer disconnects. 133 * the peer disconnects.
134 */ 134 */
135 if (signalfd_lock(ctx, &lk)) { 135 if (signalfd_lock(ctx, &lk)) {
136 if (next_signal(&lk.tsk->pending, &ctx->sigmask) > 0 || 136 if ((lk.tsk == current &&
137 next_signal(&lk.tsk->pending, &ctx->sigmask) > 0) ||
137 next_signal(&lk.tsk->signal->shared_pending, 138 next_signal(&lk.tsk->signal->shared_pending,
138 &ctx->sigmask) > 0) 139 &ctx->sigmask) > 0)
139 events |= POLLIN; 140 events |= POLLIN;
diff --git a/fs/sync.c b/fs/sync.c
index 2f97576355b8..7cd005ea7639 100644
--- a/fs/sync.c
+++ b/fs/sync.c
@@ -236,6 +236,14 @@ out:
236 return ret; 236 return ret;
237} 237}
238 238
239/* It would be nice if people remember that not all the world's an i386
240 when they introduce new system calls */
241asmlinkage long sys_sync_file_range2(int fd, unsigned int flags,
242 loff_t offset, loff_t nbytes)
243{
244 return sys_sync_file_range(fd, offset, nbytes, flags);
245}
246
239/* 247/*
240 * `endbyte' is inclusive 248 * `endbyte' is inclusive
241 */ 249 */
diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h
index 250d7f145aca..bfdbebebdc1b 100644
--- a/include/asm-arm/unistd.h
+++ b/include/asm-arm/unistd.h
@@ -367,6 +367,7 @@
367#define __NR_get_robust_list (__NR_SYSCALL_BASE+339) 367#define __NR_get_robust_list (__NR_SYSCALL_BASE+339)
368#define __NR_splice (__NR_SYSCALL_BASE+340) 368#define __NR_splice (__NR_SYSCALL_BASE+340)
369#define __NR_arm_sync_file_range (__NR_SYSCALL_BASE+341) 369#define __NR_arm_sync_file_range (__NR_SYSCALL_BASE+341)
370#define __NR_sync_file_range2 __NR_arm_sync_file_range
370#define __NR_tee (__NR_SYSCALL_BASE+342) 371#define __NR_tee (__NR_SYSCALL_BASE+342)
371#define __NR_vmsplice (__NR_SYSCALL_BASE+343) 372#define __NR_vmsplice (__NR_SYSCALL_BASE+343)
372#define __NR_move_pages (__NR_SYSCALL_BASE+344) 373#define __NR_move_pages (__NR_SYSCALL_BASE+344)
diff --git a/include/asm-ia64/sn/sn_sal.h b/include/asm-ia64/sn/sn_sal.h
index 291e8ceed6e6..d3566a298fa4 100644
--- a/include/asm-ia64/sn/sn_sal.h
+++ b/include/asm-ia64/sn/sn_sal.h
@@ -696,8 +696,8 @@ static inline int
696sn_change_coherence(u64 *new_domain, u64 *old_domain) 696sn_change_coherence(u64 *new_domain, u64 *old_domain)
697{ 697{
698 struct ia64_sal_retval ret_stuff; 698 struct ia64_sal_retval ret_stuff;
699 ia64_sal_oemcall(&ret_stuff, SN_SAL_COHERENCE, (u64)new_domain, 699 ia64_sal_oemcall_nolock(&ret_stuff, SN_SAL_COHERENCE, (u64)new_domain,
700 (u64)old_domain, 0, 0, 0, 0, 0); 700 (u64)old_domain, 0, 0, 0, 0, 0);
701 return ret_stuff.status; 701 return ret_stuff.status;
702} 702}
703 703
diff --git a/include/asm-powerpc/systbl.h b/include/asm-powerpc/systbl.h
index 700ca5928741..1cc3f9cb6f4e 100644
--- a/include/asm-powerpc/systbl.h
+++ b/include/asm-powerpc/systbl.h
@@ -311,3 +311,4 @@ COMPAT_SYS_SPU(utimensat)
311COMPAT_SYS_SPU(signalfd) 311COMPAT_SYS_SPU(signalfd)
312COMPAT_SYS_SPU(timerfd) 312COMPAT_SYS_SPU(timerfd)
313SYSCALL_SPU(eventfd) 313SYSCALL_SPU(eventfd)
314COMPAT_SYS_SPU(sync_file_range2)
diff --git a/include/asm-powerpc/unistd.h b/include/asm-powerpc/unistd.h
index e3c28dc31abf..f71c6061f1ec 100644
--- a/include/asm-powerpc/unistd.h
+++ b/include/asm-powerpc/unistd.h
@@ -330,10 +330,11 @@
330#define __NR_signalfd 305 330#define __NR_signalfd 305
331#define __NR_timerfd 306 331#define __NR_timerfd 306
332#define __NR_eventfd 307 332#define __NR_eventfd 307
333#define __NR_sync_file_range2 308
333 334
334#ifdef __KERNEL__ 335#ifdef __KERNEL__
335 336
336#define __NR_syscalls 308 337#define __NR_syscalls 309
337 338
338#define __NR__exit __NR_exit 339#define __NR__exit __NR_exit
339#define NR_syscalls __NR_syscalls 340#define NR_syscalls __NR_syscalls
diff --git a/include/linux/eventfd.h b/include/linux/eventfd.h
index 0d6ecc60b94d..b489fc6d0b62 100644
--- a/include/linux/eventfd.h
+++ b/include/linux/eventfd.h
@@ -19,7 +19,8 @@ int eventfd_signal(struct file *file, int n);
19#else /* CONFIG_EVENTFD */ 19#else /* CONFIG_EVENTFD */
20 20
21#define eventfd_fget(fd) ERR_PTR(-ENOSYS) 21#define eventfd_fget(fd) ERR_PTR(-ENOSYS)
22#define eventfd_signal(f, n) 0 22static inline int eventfd_signal(struct file *file, int n)
23{ return 0; }
23 24
24#endif /* CONFIG_EVENTFD */ 25#endif /* CONFIG_EVENTFD */
25 26
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 745c4f9b4caa..620da7be07b7 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -298,7 +298,6 @@ enum {
298 ATA_HORKAGE_NODMA = (1 << 1), /* DMA problems */ 298 ATA_HORKAGE_NODMA = (1 << 1), /* DMA problems */
299 ATA_HORKAGE_NONCQ = (1 << 2), /* Don't use NCQ */ 299 ATA_HORKAGE_NONCQ = (1 << 2), /* Don't use NCQ */
300 ATA_HORKAGE_MAX_SEC_128 = (1 << 3), /* Limit max sects to 128 */ 300 ATA_HORKAGE_MAX_SEC_128 = (1 << 3), /* Limit max sects to 128 */
301 ATA_HORKAGE_DMA_RW_ONLY = (1 << 4), /* ATAPI DMA for RW only */
302}; 301};
303 302
304enum hsm_task_states { 303enum hsm_task_states {
@@ -1088,11 +1087,9 @@ static inline u8 ata_wait_idle(struct ata_port *ap)
1088{ 1087{
1089 u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000); 1088 u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000);
1090 1089
1091 if (status != 0xff && (status & (ATA_BUSY | ATA_DRQ))) { 1090 if (status != 0xff && (status & (ATA_BUSY | ATA_DRQ)))
1092 if (ata_msg_warn(ap)) 1091 DPRINTK("ATA: abnormal status 0x%X on port 0x%p\n",
1093 printk(KERN_WARNING "ATA: abnormal status 0x%X on port 0x%p\n", 1092 status, ap->ioaddr.status_addr);
1094 status, ap->ioaddr.status_addr);
1095 }
1096 1093
1097 return status; 1094 return status;
1098} 1095}
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index b02070eac422..83d0ec11235e 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -598,6 +598,8 @@ asmlinkage long sys_tee(int fdin, int fdout, size_t len, unsigned int flags);
598 598
599asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes, 599asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes,
600 unsigned int flags); 600 unsigned int flags);
601asmlinkage long sys_sync_file_range2(int fd, unsigned int flags,
602 loff_t offset, loff_t nbytes);
601asmlinkage long sys_get_robust_list(int pid, 603asmlinkage long sys_get_robust_list(int pid,
602 struct robust_list_head __user * __user *head_ptr, 604 struct robust_list_head __user * __user *head_ptr,
603 size_t __user *len_ptr); 605 size_t __user *len_ptr);
diff --git a/kernel/relay.c b/kernel/relay.c
index 4311101b0ca7..95db8c79fe8f 100644
--- a/kernel/relay.c
+++ b/kernel/relay.c
@@ -812,7 +812,10 @@ static void relay_file_read_consume(struct rchan_buf *buf,
812 } 812 }
813 813
814 buf->bytes_consumed += bytes_consumed; 814 buf->bytes_consumed += bytes_consumed;
815 read_subbuf = read_pos / buf->chan->subbuf_size; 815 if (!read_pos)
816 read_subbuf = buf->subbufs_consumed % n_subbufs;
817 else
818 read_subbuf = read_pos / buf->chan->subbuf_size;
816 if (buf->bytes_consumed + buf->padding[read_subbuf] == subbuf_size) { 819 if (buf->bytes_consumed + buf->padding[read_subbuf] == subbuf_size) {
817 if ((read_subbuf == buf->subbufs_produced % n_subbufs) && 820 if ((read_subbuf == buf->subbufs_produced % n_subbufs) &&
818 (buf->offset == subbuf_size)) 821 (buf->offset == subbuf_size))
@@ -841,8 +844,9 @@ static int relay_file_read_avail(struct rchan_buf *buf, size_t read_pos)
841 } 844 }
842 845
843 if (unlikely(produced - consumed >= n_subbufs)) { 846 if (unlikely(produced - consumed >= n_subbufs)) {
844 consumed = (produced / n_subbufs) * n_subbufs; 847 consumed = produced - n_subbufs + 1;
845 buf->subbufs_consumed = consumed; 848 buf->subbufs_consumed = consumed;
849 buf->bytes_consumed = 0;
846 } 850 }
847 851
848 produced = (produced % n_subbufs) * subbuf_size + buf->offset; 852 produced = (produced % n_subbufs) * subbuf_size + buf->offset;
@@ -899,7 +903,10 @@ static size_t relay_file_read_start_pos(size_t read_pos,
899 size_t read_subbuf, padding, padding_start, padding_end; 903 size_t read_subbuf, padding, padding_start, padding_end;
900 size_t subbuf_size = buf->chan->subbuf_size; 904 size_t subbuf_size = buf->chan->subbuf_size;
901 size_t n_subbufs = buf->chan->n_subbufs; 905 size_t n_subbufs = buf->chan->n_subbufs;
906 size_t consumed = buf->subbufs_consumed % n_subbufs;
902 907
908 if (!read_pos)
909 read_pos = consumed * subbuf_size + buf->bytes_consumed;
903 read_subbuf = read_pos / subbuf_size; 910 read_subbuf = read_pos / subbuf_size;
904 padding = buf->padding[read_subbuf]; 911 padding = buf->padding[read_subbuf];
905 padding_start = (read_subbuf + 1) * subbuf_size - padding; 912 padding_start = (read_subbuf + 1) * subbuf_size - padding;
diff --git a/mm/rmap.c b/mm/rmap.c
index 850165d32b7a..61e492597a0b 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -53,24 +53,6 @@
53 53
54struct kmem_cache *anon_vma_cachep; 54struct kmem_cache *anon_vma_cachep;
55 55
56static inline void validate_anon_vma(struct vm_area_struct *find_vma)
57{
58#ifdef CONFIG_DEBUG_VM
59 struct anon_vma *anon_vma = find_vma->anon_vma;
60 struct vm_area_struct *vma;
61 unsigned int mapcount = 0;
62 int found = 0;
63
64 list_for_each_entry(vma, &anon_vma->head, anon_vma_node) {
65 mapcount++;
66 BUG_ON(mapcount > 100000);
67 if (vma == find_vma)
68 found = 1;
69 }
70 BUG_ON(!found);
71#endif
72}
73
74/* This must be called under the mmap_sem. */ 56/* This must be called under the mmap_sem. */
75int anon_vma_prepare(struct vm_area_struct *vma) 57int anon_vma_prepare(struct vm_area_struct *vma)
76{ 58{
@@ -121,10 +103,8 @@ void __anon_vma_link(struct vm_area_struct *vma)
121{ 103{
122 struct anon_vma *anon_vma = vma->anon_vma; 104 struct anon_vma *anon_vma = vma->anon_vma;
123 105
124 if (anon_vma) { 106 if (anon_vma)
125 list_add_tail(&vma->anon_vma_node, &anon_vma->head); 107 list_add_tail(&vma->anon_vma_node, &anon_vma->head);
126 validate_anon_vma(vma);
127 }
128} 108}
129 109
130void anon_vma_link(struct vm_area_struct *vma) 110void anon_vma_link(struct vm_area_struct *vma)
@@ -134,7 +114,6 @@ void anon_vma_link(struct vm_area_struct *vma)
134 if (anon_vma) { 114 if (anon_vma) {
135 spin_lock(&anon_vma->lock); 115 spin_lock(&anon_vma->lock);
136 list_add_tail(&vma->anon_vma_node, &anon_vma->head); 116 list_add_tail(&vma->anon_vma_node, &anon_vma->head);
137 validate_anon_vma(vma);
138 spin_unlock(&anon_vma->lock); 117 spin_unlock(&anon_vma->lock);
139 } 118 }
140} 119}
@@ -148,7 +127,6 @@ void anon_vma_unlink(struct vm_area_struct *vma)
148 return; 127 return;
149 128
150 spin_lock(&anon_vma->lock); 129 spin_lock(&anon_vma->lock);
151 validate_anon_vma(vma);
152 list_del(&vma->anon_vma_node); 130 list_del(&vma->anon_vma_node);
153 131
154 /* We must garbage collect the anon_vma if it's empty */ 132 /* We must garbage collect the anon_vma if it's empty */
diff --git a/scripts/checksyscalls.sh b/scripts/checksyscalls.sh
index f98171f5a3df..0dcc01ce45a6 100755
--- a/scripts/checksyscalls.sh
+++ b/scripts/checksyscalls.sh
@@ -99,6 +99,11 @@ cat << EOF
99#define __IGNORE_setfsuid32 99#define __IGNORE_setfsuid32
100#define __IGNORE_setfsgid32 100#define __IGNORE_setfsgid32
101 101
102/* sync_file_range had a stupid ABI. Allow sync_file_range2 instead */
103#ifdef __NR_sync_file_range2
104#define __IGNORE_sync_file_range
105#endif
106
102/* Unmerged syscalls for AFS, STREAMS, etc. */ 107/* Unmerged syscalls for AFS, STREAMS, etc. */
103#define __IGNORE_afs_syscall 108#define __IGNORE_afs_syscall
104#define __IGNORE_getpmsg 109#define __IGNORE_getpmsg
diff --git a/sound/isa/opl3sa2.c b/sound/isa/opl3sa2.c
index 61a323cc0e49..4f6800b43b0e 100644
--- a/sound/isa/opl3sa2.c
+++ b/sound/isa/opl3sa2.c
@@ -953,7 +953,7 @@ static int snd_opl3sa2_isa_resume(struct device *dev, unsigned int n)
953static struct isa_driver snd_opl3sa2_isa_driver = { 953static struct isa_driver snd_opl3sa2_isa_driver = {
954 .match = snd_opl3sa2_isa_match, 954 .match = snd_opl3sa2_isa_match,
955 .probe = snd_opl3sa2_isa_probe, 955 .probe = snd_opl3sa2_isa_probe,
956 .remove = __devexit( snd_opl3sa2_isa_remove), 956 .remove = __devexit_p(snd_opl3sa2_isa_remove),
957#ifdef CONFIG_PM 957#ifdef CONFIG_PM
958 .suspend = snd_opl3sa2_isa_suspend, 958 .suspend = snd_opl3sa2_isa_suspend,
959 .resume = snd_opl3sa2_isa_resume, 959 .resume = snd_opl3sa2_isa_resume,
diff --git a/sound/pci/ice1712/prodigy192.c b/sound/pci/ice1712/prodigy192.c
index f03c02c07743..4bae7305a79b 100644
--- a/sound/pci/ice1712/prodigy192.c
+++ b/sound/pci/ice1712/prodigy192.c
@@ -705,7 +705,7 @@ static int ak4114_input_sw_put(struct snd_kcontrol *kcontrol,
705} 705}
706 706
707 707
708static const struct snd_kcontrol_new ak4114_controls[] __devinitdata = { 708static struct snd_kcontrol_new ak4114_controls[] __devinitdata = {
709 { 709 {
710 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 710 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
711 .name = "MIODIO IEC958 Capture Input", 711 .name = "MIODIO IEC958 Capture Input",