aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/00-INDEX2
-rw-r--r--Documentation/ManagementStyle2
-rw-r--r--Documentation/SubmittingPatches2
-rw-r--r--Documentation/filesystems/00-INDEX2
-rw-r--r--Documentation/filesystems/ocfs2.txt13
-rw-r--r--Documentation/kernel-parameters.txt23
-rw-r--r--Documentation/networking/multiqueue.txt10
-rw-r--r--Documentation/video4linux/cx2341x/fw-encoder-api.txt4
-rw-r--r--arch/arm/mach-realview/realview_eb.c2
-rw-r--r--arch/arm/vfp/vfpmodule.c1
-rw-r--r--arch/h8300/Kconfig.debug2
-rw-r--r--arch/i386/kernel/cpu/intel_cacheinfo.c4
-rw-r--r--arch/i386/mach-generic/Makefile2
-rw-r--r--arch/i386/mach-voyager/Makefile2
-rw-r--r--arch/i386/mm/highmem.c7
-rw-r--r--arch/i386/pci/irq.c1
-rw-r--r--arch/i386/pci/pcbios.c2
-rw-r--r--arch/m68k/kernel/entry.S10
-rw-r--r--arch/m68knommu/kernel/syscalltable.S10
-rw-r--r--arch/mips/kernel/cpu-probe.c9
-rw-r--r--arch/mips/kernel/rtlx.c4
-rw-r--r--arch/mips/kernel/scall64-n32.S2
-rw-r--r--arch/mips/kernel/time.c1
-rw-r--r--arch/mips/mips-boards/malta/malta_int.c2
-rw-r--r--arch/mips/mm/init.c5
-rw-r--r--arch/mips/mm/tlbex.c26
-rw-r--r--arch/mips/sgi-ip22/ip22-platform.c4
-rw-r--r--arch/mips/sgi-ip22/ip22-time.c4
-rw-r--r--arch/powerpc/kernel/legacy_serial.c2
-rw-r--r--arch/powerpc/platforms/85xx/mpc8544_ds.c2
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_cds.c2
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_mds.c2
-rw-r--r--arch/powerpc/platforms/86xx/mpc86xx_hpcn.c2
-rw-r--r--arch/powerpc/platforms/Kconfig1
-rw-r--r--arch/powerpc/sysdev/cpm2_common.c2
-rw-r--r--arch/ppc/kernel/head_8xx.S2
-rw-r--r--arch/sparc64/kernel/pci.c13
-rw-r--r--arch/x86_64/vdso/vclock_gettime.c5
-rw-r--r--block/ll_rw_blk.c23
-rw-r--r--drivers/ata/pata_ali.c7
-rw-r--r--drivers/block/DAC960.c17
-rw-r--r--drivers/block/DAC960.h7
-rw-r--r--drivers/bluetooth/hci_usb.c5
-rw-r--r--drivers/char/agp/intel-agp.c10
-rw-r--r--drivers/char/tty_ioctl.c4
-rw-r--r--drivers/edac/e752x_edac.c2
-rw-r--r--drivers/edac/edac_core.h2
-rw-r--r--drivers/ide/Kconfig4
-rw-r--r--drivers/ide/ide-iops.c3
-rw-r--r--drivers/ide/pci/alim15x3.c7
-rw-r--r--drivers/ide/pci/hpt366.c138
-rw-r--r--drivers/ide/pci/pdc202xx_new.c9
-rw-r--r--drivers/ide/pci/via82cxxx.c15
-rw-r--r--drivers/ide/ppc/mpc8xx.c1
-rw-r--r--drivers/ide/setup-pci.c41
-rw-r--r--drivers/input/serio/i8042-x86ia64io.h10
-rw-r--r--drivers/input/serio/i8042.c2
-rw-r--r--drivers/input/touchscreen/usbtouchscreen.c2
-rw-r--r--drivers/kvm/kvm.h10
-rw-r--r--drivers/kvm/mmu.c5
-rw-r--r--drivers/lguest/lguest.c7
-rw-r--r--drivers/md/dm-bio-list.h3
-rw-r--r--drivers/md/raid5.c17
-rw-r--r--drivers/media/video/cx88/cx88-mpeg.c2
-rw-r--r--drivers/media/video/ivtv/ivtv-fileops.c6
-rw-r--r--drivers/media/video/ivtv/ivtv-ioctl.c17
-rw-r--r--drivers/media/video/pwc/pwc-if.c2
-rw-r--r--drivers/media/video/saa7134/saa7134-cards.c12
-rw-r--r--drivers/media/video/saa7191.c4
-rw-r--r--drivers/mmc/host/at91_mci.c6
-rw-r--r--drivers/net/tg3.c13
-rw-r--r--drivers/pci/probe.c2
-rw-r--r--drivers/pci/quirks.c16
-rw-r--r--drivers/pnp/quirks.c103
-rw-r--r--drivers/rtc/rtc-v3020.c9
-rw-r--r--drivers/s390/scsi/zfcp_aux.c4
-rw-r--r--drivers/s390/scsi/zfcp_qdio.c10
-rw-r--r--drivers/s390/scsi/zfcp_scsi.c4
-rw-r--r--drivers/scsi/libiscsi.c65
-rw-r--r--drivers/scsi/qla2xxx/qla_dbg.c21
-rw-r--r--drivers/scsi/qla2xxx/qla_def.h1
-rw-r--r--drivers/scsi/qla2xxx/qla_gs.c28
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c51
-rw-r--r--drivers/scsi/qla2xxx/qla_isr.c1
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c2
-rw-r--r--drivers/scsi/qla2xxx/qla_version.h2
-rw-r--r--drivers/serial/Kconfig8
-rw-r--r--drivers/serial/sb1250-duart.c6
-rw-r--r--drivers/spi/spi_mpc83xx.c7
-rw-r--r--drivers/usb/core/driver.c2
-rw-r--r--drivers/usb/core/quirks.c31
-rw-r--r--drivers/usb/gadget/serial.c25
-rw-r--r--drivers/usb/misc/sisusbvga/sisusb.c1
-rw-r--r--drivers/usb/serial/bus.c2
-rw-r--r--drivers/usb/serial/ftdi_sio.c1
-rw-r--r--drivers/usb/serial/ftdi_sio.h8
-rw-r--r--drivers/usb/serial/option.c3
-rw-r--r--drivers/usb/serial/oti6858.c15
-rw-r--r--drivers/usb/storage/scsiglue.c13
-rw-r--r--drivers/usb/storage/unusual_devs.h30
-rw-r--r--drivers/usb/storage/usb.c27
-rw-r--r--drivers/video/aty/ati_ids.h12
-rw-r--r--drivers/video/aty/radeon_base.c6
-rw-r--r--drivers/video/intelfb/intelfbhw.c6
-rw-r--r--fs/Kconfig3
-rw-r--r--fs/afs/mntpt.c2
-rw-r--r--fs/ext3/super.c11
-rw-r--r--fs/ext4/super.c11
-rw-r--r--fs/locks.c2
-rw-r--r--fs/ocfs2/alloc.c1
-rw-r--r--fs/ocfs2/aops.c4
-rw-r--r--fs/ocfs2/file.c1
-rw-r--r--fs/ocfs2/super.c69
-rw-r--r--fs/proc/inode.c3
-rw-r--r--fs/reiserfs/super.c13
-rw-r--r--fs/select.c2
-rw-r--r--include/asm-generic/termios.h2
-rw-r--r--include/asm-m68k/unistd.h12
-rw-r--r--include/asm-m68knommu/unistd.h12
-rw-r--r--include/asm-mips/mach-generic/ide.h31
-rw-r--r--include/asm-mips/sibyte/bcm1480_regs.h5
-rw-r--r--include/linux/aer.h25
-rw-r--r--include/linux/ide.h13
-rw-r--r--include/linux/input.h2
-rw-r--r--include/linux/kernel.h1
-rw-r--r--include/linux/keyboard.h4
-rw-r--r--include/linux/leds.h1
-rw-r--r--include/linux/netfilter.h5
-rw-r--r--include/linux/pci_ids.h2
-rw-r--r--include/linux/poll.h2
-rw-r--r--include/media/v4l2-dev.h5
-rw-r--r--include/scsi/libiscsi.h7
-rw-r--r--kernel/futex_compat.c4
-rw-r--r--kernel/kmod.c2
-rw-r--r--kernel/time/ntp.c2
-rw-r--r--mm/slub.c38
-rw-r--r--net/bluetooth/hci_core.c8
-rw-r--r--net/bluetooth/hci_sock.c28
-rw-r--r--net/bridge/netfilter/ebtables.c1
-rw-r--r--net/core/datagram.c3
-rw-r--r--net/decnet/dn_dev.c2
-rw-r--r--net/ipv4/devinet.c2
-rw-r--r--net/ipv4/inet_diag.c4
-rw-r--r--net/ipv4/ipvs/ip_vs_ctl.c1
-rw-r--r--net/ipv4/netfilter/arp_tables.c1
-rw-r--r--net/ipv4/netfilter/ip_tables.c1
-rw-r--r--net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c11
-rw-r--r--net/ipv6/ip6_output.c5
-rw-r--r--net/ipv6/ndisc.c2
-rw-r--r--net/ipv6/netfilter/ip6_tables.c1
-rw-r--r--net/netfilter/nf_sockopt.c36
-rw-r--r--net/sunrpc/svcsock.c2
152 files changed, 918 insertions, 613 deletions
diff --git a/Documentation/00-INDEX b/Documentation/00-INDEX
index 8b0563633442..43e89b1537d9 100644
--- a/Documentation/00-INDEX
+++ b/Documentation/00-INDEX
@@ -134,8 +134,6 @@ dvb/
134 - info on Linux Digital Video Broadcast (DVB) subsystem. 134 - info on Linux Digital Video Broadcast (DVB) subsystem.
135early-userspace/ 135early-userspace/
136 - info about initramfs, klibc, and userspace early during boot. 136 - info about initramfs, klibc, and userspace early during boot.
137ecryptfs.txt
138 - docs on eCryptfs: stacked cryptographic filesystem for Linux.
139eisa.txt 137eisa.txt
140 - info on EISA bus support. 138 - info on EISA bus support.
141exception.txt 139exception.txt
diff --git a/Documentation/ManagementStyle b/Documentation/ManagementStyle
index cbbebfb51ffe..49a8efa5afeb 100644
--- a/Documentation/ManagementStyle
+++ b/Documentation/ManagementStyle
@@ -166,7 +166,7 @@ To solve this problem, you really only have two options:
166The option of being unfailingly polite really doesn't exist. Nobody will 166The option of being unfailingly polite really doesn't exist. Nobody will
167trust somebody who is so clearly hiding his true character. 167trust somebody who is so clearly hiding his true character.
168 168
169(*) Paul Simon sang "Fifty Ways to Lose Your Lover", because quite 169(*) Paul Simon sang "Fifty Ways to Leave Your Lover", because quite
170frankly, "A Million Ways to Tell a Developer He Is a D*ckhead" doesn't 170frankly, "A Million Ways to Tell a Developer He Is a D*ckhead" doesn't
171scan nearly as well. But I'm sure he thought about it. 171scan nearly as well. But I'm sure he thought about it.
172 172
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index 397575880dc4..a30dd4480ad4 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -126,7 +126,7 @@ the reviewers time and will get your patch rejected, probably
126without even being read. 126without even being read.
127 127
128At a minimum you should check your patches with the patch style 128At a minimum you should check your patches with the patch style
129checker prior to submission (scripts/patchcheck.pl). You should 129checker prior to submission (scripts/checkpatch.pl). You should
130be able to justify all violations that remain in your patch. 130be able to justify all violations that remain in your patch.
131 131
132 132
diff --git a/Documentation/filesystems/00-INDEX b/Documentation/filesystems/00-INDEX
index 571785887a4f..59db1bca7027 100644
--- a/Documentation/filesystems/00-INDEX
+++ b/Documentation/filesystems/00-INDEX
@@ -32,6 +32,8 @@ directory-locking
32 - info about the locking scheme used for directory operations. 32 - info about the locking scheme used for directory operations.
33dlmfs.txt 33dlmfs.txt
34 - info on the userspace interface to the OCFS2 DLM. 34 - info on the userspace interface to the OCFS2 DLM.
35ecryptfs.txt
36 - docs on eCryptfs: stacked cryptographic filesystem for Linux.
35ext2.txt 37ext2.txt
36 - info, mount options and specifications for the Ext2 filesystem. 38 - info, mount options and specifications for the Ext2 filesystem.
37ext3.txt 39ext3.txt
diff --git a/Documentation/filesystems/ocfs2.txt b/Documentation/filesystems/ocfs2.txt
index 8ccf0c1b58ed..ed55238023a9 100644
--- a/Documentation/filesystems/ocfs2.txt
+++ b/Documentation/filesystems/ocfs2.txt
@@ -28,11 +28,7 @@ Manish Singh <manish.singh@oracle.com>
28Caveats 28Caveats
29======= 29=======
30Features which OCFS2 does not support yet: 30Features which OCFS2 does not support yet:
31 - sparse files
32 - extended attributes 31 - extended attributes
33 - shared writable mmap
34 - loopback is supported, but data written will not
35 be cluster coherent.
36 - quotas 32 - quotas
37 - cluster aware flock 33 - cluster aware flock
38 - cluster aware lockf 34 - cluster aware lockf
@@ -57,3 +53,12 @@ nointr Do not allow signals to interrupt cluster
57atime_quantum=60(*) OCFS2 will not update atime unless this number 53atime_quantum=60(*) OCFS2 will not update atime unless this number
58 of seconds has passed since the last update. 54 of seconds has passed since the last update.
59 Set to zero to always update atime. 55 Set to zero to always update atime.
56data=ordered (*) All data are forced directly out to the main file
57 system prior to its metadata being committed to the
58 journal.
59data=writeback Data ordering is not preserved, data may be written
60 into the main file system after its metadata has been
61 committed to the journal.
62preferred_slot=0(*) During mount, try to use this filesystem slot first. If
63 it is in use by another node, the first empty one found
64 will be chosen. Invalid values will be ignored.
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index b41cde31d112..586b6f85d4e0 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1,5 +1,5 @@
1 Kernel Parameters 1 Kernel Parameters
2 ~~~~~~~~~~~~~~~~~ 2 ~~~~~~~~~~~~~~~~~
3 3
4The following is a consolidated list of the kernel parameters as implemented 4The following is a consolidated list of the kernel parameters as implemented
5(mostly) by the __setup() macro and sorted into English Dictionary order 5(mostly) by the __setup() macro and sorted into English Dictionary order
@@ -468,9 +468,6 @@ and is between 256 and 4096 characters. It is defined in the file
468 Format: 468 Format:
469 <first_slot>,<last_slot>,<port>,<enum_bit>[,<debug>] 469 <first_slot>,<last_slot>,<port>,<enum_bit>[,<debug>]
470 470
471 cpia_pp= [HW,PPT]
472 Format: { parport<nr> | auto | none }
473
474 crashkernel=nn[KMG]@ss[KMG] 471 crashkernel=nn[KMG]@ss[KMG]
475 [KNL] Reserve a chunk of physical memory to 472 [KNL] Reserve a chunk of physical memory to
476 hold a kernel to switch to with kexec on panic. 473 hold a kernel to switch to with kexec on panic.
@@ -1465,7 +1462,7 @@ and is between 256 and 4096 characters. It is defined in the file
1465 1462
1466 reboot= [BUGS=X86-32,BUGS=ARM,BUGS=IA-64] Rebooting mode 1463 reboot= [BUGS=X86-32,BUGS=ARM,BUGS=IA-64] Rebooting mode
1467 Format: <reboot_mode>[,<reboot_mode2>[,...]] 1464 Format: <reboot_mode>[,<reboot_mode2>[,...]]
1468 See arch/*/kernel/reboot.c or arch/*/kernel/process.c 1465 See arch/*/kernel/reboot.c or arch/*/kernel/process.c
1469 1466
1470 reserve= [KNL,BUGS] Force the kernel to ignore some iomem area 1467 reserve= [KNL,BUGS] Force the kernel to ignore some iomem area
1471 1468
@@ -1553,12 +1550,12 @@ and is between 256 and 4096 characters. It is defined in the file
1553 1550
1554 selinux_compat_net = 1551 selinux_compat_net =
1555 [SELINUX] Set initial selinux_compat_net flag value. 1552 [SELINUX] Set initial selinux_compat_net flag value.
1556 Format: { "0" | "1" } 1553 Format: { "0" | "1" }
1557 0 -- use new secmark-based packet controls 1554 0 -- use new secmark-based packet controls
1558 1 -- use legacy packet controls 1555 1 -- use legacy packet controls
1559 Default value is 0 (preferred). 1556 Default value is 0 (preferred).
1560 Value can be changed at runtime via 1557 Value can be changed at runtime via
1561 /selinux/compat_net. 1558 /selinux/compat_net.
1562 1559
1563 serialnumber [BUGS=X86-32] 1560 serialnumber [BUGS=X86-32]
1564 1561
@@ -1957,7 +1954,7 @@ and is between 256 and 4096 characters. It is defined in the file
1957 norandmaps Don't use address space randomization 1954 norandmaps Don't use address space randomization
1958 Equivalent to echo 0 > /proc/sys/kernel/randomize_va_space 1955 Equivalent to echo 0 > /proc/sys/kernel/randomize_va_space
1959 1956
1960 unwind_debug=N N > 0 will enable dwarf2 unwinder debugging 1957 unwind_debug=N N > 0 will enable dwarf2 unwinder debugging
1961 This is useful to get more information why 1958 This is useful to get more information why
1962 you got a "dwarf2 unwinder stuck" 1959 you got a "dwarf2 unwinder stuck"
1963 1960
diff --git a/Documentation/networking/multiqueue.txt b/Documentation/networking/multiqueue.txt
index 00b60cce2224..ea5a42e8f79f 100644
--- a/Documentation/networking/multiqueue.txt
+++ b/Documentation/networking/multiqueue.txt
@@ -58,9 +58,13 @@ software, so it's a straight round-robin qdisc. It uses the same syntax and
58classification priomap that sch_prio uses, so it should be intuitive to 58classification priomap that sch_prio uses, so it should be intuitive to
59configure for people who've used sch_prio. 59configure for people who've used sch_prio.
60 60
61The PRIO qdisc naturally plugs into a multiqueue device. If PRIO has been 61In order to utilitize the multiqueue features of the qdiscs, the network
62built with NET_SCH_PRIO_MQ, then upon load, it will make sure the number of 62device layer needs to enable multiple queue support. This can be done by
63bands requested is equal to the number of queues on the hardware. If they 63selecting NETDEVICES_MULTIQUEUE under Drivers.
64
65The PRIO qdisc naturally plugs into a multiqueue device. If
66NETDEVICES_MULTIQUEUE is selected, then on qdisc load, the number of
67bands requested is compared to the number of queues on the hardware. If they
64are equal, it sets a one-to-one mapping up between the queues and bands. If 68are equal, it sets a one-to-one mapping up between the queues and bands. If
65they're not equal, it will not load the qdisc. This is the same behavior 69they're not equal, it will not load the qdisc. This is the same behavior
66for RR. Once the association is made, any skb that is classified will have 70for RR. Once the association is made, any skb that is classified will have
diff --git a/Documentation/video4linux/cx2341x/fw-encoder-api.txt b/Documentation/video4linux/cx2341x/fw-encoder-api.txt
index 5dd3109a8b3f..5a27af2ee1c6 100644
--- a/Documentation/video4linux/cx2341x/fw-encoder-api.txt
+++ b/Documentation/video4linux/cx2341x/fw-encoder-api.txt
@@ -407,8 +407,10 @@ Description
407 u32 length; // Length of this frame 407 u32 length; // Length of this frame
408 u32 offset_low; // Offset in the file of the 408 u32 offset_low; // Offset in the file of the
409 u32 offset_high; // start of this frame 409 u32 offset_high; // start of this frame
410 u32 mask1; // Bits 0-1 are the type mask: 410 u32 mask1; // Bits 0-2 are the type mask:
411 // 1=I, 2=P, 4=B 411 // 1=I, 2=P, 4=B
412 // 0=End of Program Index, other fields
413 // are invalid.
412 u32 pts; // The PTS of the frame 414 u32 pts; // The PTS of the frame
413 u32 mask2; // Bit 0 is bit 32 of the pts. 415 u32 mask2; // Bit 0 is bit 32 of the pts.
414 }; 416 };
diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c
index 3dba666151db..ecec2f85c4cd 100644
--- a/arch/arm/mach-realview/realview_eb.c
+++ b/arch/arm/mach-realview/realview_eb.c
@@ -165,7 +165,7 @@ static void __init gic_init_irq(void)
165#endif 165#endif
166 gic_dist_init(0, __io_address(REALVIEW_GIC_DIST_BASE), 29); 166 gic_dist_init(0, __io_address(REALVIEW_GIC_DIST_BASE), 29);
167 gic_cpu_init(0, __io_address(REALVIEW_GIC_CPU_BASE)); 167 gic_cpu_init(0, __io_address(REALVIEW_GIC_CPU_BASE));
168#ifdef CONFIG_REALVIEW_MPCORE 168#if defined(CONFIG_REALVIEW_MPCORE) && !defined(CONFIG_REALVIEW_MPCORE_REVB)
169 gic_dist_init(1, __io_address(REALVIEW_GIC1_DIST_BASE), 64); 169 gic_dist_init(1, __io_address(REALVIEW_GIC1_DIST_BASE), 64);
170 gic_cpu_init(1, __io_address(REALVIEW_GIC1_CPU_BASE)); 170 gic_cpu_init(1, __io_address(REALVIEW_GIC1_CPU_BASE));
171 gic_cascade_irq(1, IRQ_EB_IRQ1); 171 gic_cascade_irq(1, IRQ_EB_IRQ1);
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index 04ddab2bd876..eea3f50743d5 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -323,6 +323,7 @@ static int __init vfp_init(void)
323 * we just need to read the VFPSID register. 323 * we just need to read the VFPSID register.
324 */ 324 */
325 vfp_vector = vfp_testing_entry; 325 vfp_vector = vfp_testing_entry;
326 barrier();
326 vfpsid = fmrx(FPSID); 327 vfpsid = fmrx(FPSID);
327 barrier(); 328 barrier();
328 vfp_vector = vfp_null_entry; 329 vfp_vector = vfp_null_entry;
diff --git a/arch/h8300/Kconfig.debug b/arch/h8300/Kconfig.debug
index 554efe604a08..996d97e953b0 100644
--- a/arch/h8300/Kconfig.debug
+++ b/arch/h8300/Kconfig.debug
@@ -59,7 +59,7 @@ config BLKDEV_RESERVE
59 help 59 help
60 Reserved BLKDEV area. 60 Reserved BLKDEV area.
61 61
62config CONFIG_BLKDEV_RESERVE_ADDRESS 62config BLKDEV_RESERVE_ADDRESS
63 hex 'start address' 63 hex 'start address'
64 depends on BLKDEV_RESERVE 64 depends on BLKDEV_RESERVE
65 help 65 help
diff --git a/arch/i386/kernel/cpu/intel_cacheinfo.c b/arch/i386/kernel/cpu/intel_cacheinfo.c
index d5a456d27d82..db6c25aa5776 100644
--- a/arch/i386/kernel/cpu/intel_cacheinfo.c
+++ b/arch/i386/kernel/cpu/intel_cacheinfo.c
@@ -515,7 +515,7 @@ static int __cpuinit detect_cache_attributes(unsigned int cpu)
515 515
516 cpuid4_info[cpu] = kzalloc( 516 cpuid4_info[cpu] = kzalloc(
517 sizeof(struct _cpuid4_info) * num_cache_leaves, GFP_KERNEL); 517 sizeof(struct _cpuid4_info) * num_cache_leaves, GFP_KERNEL);
518 if (unlikely(cpuid4_info[cpu] == NULL)) 518 if (cpuid4_info[cpu] == NULL)
519 return -ENOMEM; 519 return -ENOMEM;
520 520
521 oldmask = current->cpus_allowed; 521 oldmask = current->cpus_allowed;
@@ -748,6 +748,8 @@ static void __cpuinit cache_remove_dev(struct sys_device * sys_dev)
748 unsigned int cpu = sys_dev->id; 748 unsigned int cpu = sys_dev->id;
749 unsigned long i; 749 unsigned long i;
750 750
751 if (cpuid4_info[cpu] == NULL)
752 return;
751 for (i = 0; i < num_cache_leaves; i++) { 753 for (i = 0; i < num_cache_leaves; i++) {
752 cache_remove_shared_cpu_map(cpu, i); 754 cache_remove_shared_cpu_map(cpu, i);
753 kobject_unregister(&(INDEX_KOBJECT_PTR(cpu,i)->kobj)); 755 kobject_unregister(&(INDEX_KOBJECT_PTR(cpu,i)->kobj));
diff --git a/arch/i386/mach-generic/Makefile b/arch/i386/mach-generic/Makefile
index 77fbc9f64fbc..6914485c0d85 100644
--- a/arch/i386/mach-generic/Makefile
+++ b/arch/i386/mach-generic/Makefile
@@ -2,6 +2,6 @@
2# Makefile for the generic architecture 2# Makefile for the generic architecture
3# 3#
4 4
5EXTRA_CFLAGS += -I../kernel 5EXTRA_CFLAGS := -Iarch/i386/kernel
6 6
7obj-y := probe.o summit.o bigsmp.o es7000.o default.o ../mach-es7000/ 7obj-y := probe.o summit.o bigsmp.o es7000.o default.o ../mach-es7000/
diff --git a/arch/i386/mach-voyager/Makefile b/arch/i386/mach-voyager/Makefile
index f24d29651318..33b74cf0dd22 100644
--- a/arch/i386/mach-voyager/Makefile
+++ b/arch/i386/mach-voyager/Makefile
@@ -2,7 +2,7 @@
2# Makefile for the linux kernel. 2# Makefile for the linux kernel.
3# 3#
4 4
5EXTRA_CFLAGS += -I../kernel 5EXTRA_CFLAGS := -Iarch/i386/kernel
6obj-y := setup.o voyager_basic.o voyager_thread.o 6obj-y := setup.o voyager_basic.o voyager_thread.o
7 7
8obj-$(CONFIG_SMP) += voyager_smp.o voyager_cat.o 8obj-$(CONFIG_SMP) += voyager_smp.o voyager_cat.o
diff --git a/arch/i386/mm/highmem.c b/arch/i386/mm/highmem.c
index ad8d86cc683e..1c3bf95f7356 100644
--- a/arch/i386/mm/highmem.c
+++ b/arch/i386/mm/highmem.c
@@ -34,17 +34,16 @@ void *kmap_atomic_prot(struct page *page, enum km_type type, pgprot_t prot)
34 /* even !CONFIG_PREEMPT needs this, for in_atomic in do_page_fault */ 34 /* even !CONFIG_PREEMPT needs this, for in_atomic in do_page_fault */
35 pagefault_disable(); 35 pagefault_disable();
36 36
37 idx = type + KM_TYPE_NR*smp_processor_id();
38 BUG_ON(!pte_none(*(kmap_pte-idx)));
39
40 if (!PageHighMem(page)) 37 if (!PageHighMem(page))
41 return page_address(page); 38 return page_address(page);
42 39
40 idx = type + KM_TYPE_NR*smp_processor_id();
43 vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); 41 vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
42 BUG_ON(!pte_none(*(kmap_pte-idx)));
44 set_pte(kmap_pte-idx, mk_pte(page, prot)); 43 set_pte(kmap_pte-idx, mk_pte(page, prot));
45 arch_flush_lazy_mmu_mode(); 44 arch_flush_lazy_mmu_mode();
46 45
47 return (void*) vaddr; 46 return (void *)vaddr;
48} 47}
49 48
50void *kmap_atomic(struct page *page, enum km_type type) 49void *kmap_atomic(struct page *page, enum km_type type)
diff --git a/arch/i386/pci/irq.c b/arch/i386/pci/irq.c
index 665db063a40a..8434f2323b87 100644
--- a/arch/i386/pci/irq.c
+++ b/arch/i386/pci/irq.c
@@ -550,6 +550,7 @@ static __init int intel_router_probe(struct irq_router *r, struct pci_dev *route
550 case PCI_DEVICE_ID_INTEL_ICH9_3: 550 case PCI_DEVICE_ID_INTEL_ICH9_3:
551 case PCI_DEVICE_ID_INTEL_ICH9_4: 551 case PCI_DEVICE_ID_INTEL_ICH9_4:
552 case PCI_DEVICE_ID_INTEL_ICH9_5: 552 case PCI_DEVICE_ID_INTEL_ICH9_5:
553 case PCI_DEVICE_ID_INTEL_TOLAPAI_0:
553 r->name = "PIIX/ICH"; 554 r->name = "PIIX/ICH";
554 r->get = pirq_piix_get; 555 r->get = pirq_piix_get;
555 r->set = pirq_piix_set; 556 r->set = pirq_piix_set;
diff --git a/arch/i386/pci/pcbios.c b/arch/i386/pci/pcbios.c
index 5f5193401bea..10ac8c316c46 100644
--- a/arch/i386/pci/pcbios.c
+++ b/arch/i386/pci/pcbios.c
@@ -412,7 +412,7 @@ struct irq_routing_options {
412 u16 segment; 412 u16 segment;
413} __attribute__((packed)); 413} __attribute__((packed));
414 414
415struct irq_routing_table * __devinit pcibios_get_irq_routing_table(void) 415struct irq_routing_table * pcibios_get_irq_routing_table(void)
416{ 416{
417 struct irq_routing_options opt; 417 struct irq_routing_options opt;
418 struct irq_routing_table *rt = NULL; 418 struct irq_routing_table *rt = NULL;
diff --git a/arch/m68k/kernel/entry.S b/arch/m68k/kernel/entry.S
index e162ee685d20..918f5dbeaef6 100644
--- a/arch/m68k/kernel/entry.S
+++ b/arch/m68k/kernel/entry.S
@@ -735,4 +735,14 @@ sys_call_table:
735 .long sys_tee 735 .long sys_tee
736 .long sys_vmsplice 736 .long sys_vmsplice
737 .long sys_move_pages /* 310 */ 737 .long sys_move_pages /* 310 */
738 .long sys_sched_setaffinity
739 .long sys_sched_getaffinity
740 .long sys_kexec_load
741 .long sys_getcpu
742 .long sys_epoll_pwait /* 315 */
743 .long sys_utimensat
744 .long sys_signalfd
745 .long sys_timerfd
746 .long sys_eventfd
747 .long sys_fallocate /* 320 */
738 748
diff --git a/arch/m68knommu/kernel/syscalltable.S b/arch/m68knommu/kernel/syscalltable.S
index 4603f4f3c935..9620093514bc 100644
--- a/arch/m68knommu/kernel/syscalltable.S
+++ b/arch/m68knommu/kernel/syscalltable.S
@@ -329,6 +329,16 @@ ENTRY(sys_call_table)
329 .long sys_tee 329 .long sys_tee
330 .long sys_vmsplice 330 .long sys_vmsplice
331 .long sys_move_pages /* 310 */ 331 .long sys_move_pages /* 310 */
332 .long sys_sched_setaffinity
333 .long sys_sched_getaffinity
334 .long sys_kexec_load
335 .long sys_getcpu
336 .long sys_epoll_pwait /* 315 */
337 .long sys_utimensat
338 .long sys_signalfd
339 .long sys_timerfd
340 .long sys_eventfd
341 .long sys_fallocate /* 320 */
332 342
333 .rept NR_syscalls-(.-sys_call_table)/4 343 .rept NR_syscalls-(.-sys_call_table)/4
334 .long sys_ni_syscall 344 .long sys_ni_syscall
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index 06448a9656dc..3e004161ebd5 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -199,7 +199,14 @@ static inline void check_wait(void)
199 if ((c->processor_id & 0xff) <= 0x64) 199 if ((c->processor_id & 0xff) <= 0x64)
200 break; 200 break;
201 201
202 cpu_wait = r4k_wait; 202 /*
203 * Another rev is incremeting c0_count at a reduced clock
204 * rate while in WAIT mode. So we basically have the choice
205 * between using the cp0 timer as clocksource or avoiding
206 * the WAIT instruction. Until more details are known,
207 * disable the use of WAIT for 20Kc entirely.
208 cpu_wait = r4k_wait;
209 */
203 break; 210 break;
204 case CPU_RM9000: 211 case CPU_RM9000:
205 if ((c->processor_id & 0x00ff) >= 0x40) 212 if ((c->processor_id & 0x00ff) >= 0x40)
diff --git a/arch/mips/kernel/rtlx.c b/arch/mips/kernel/rtlx.c
index aab89e97abb5..1ba00c15505b 100644
--- a/arch/mips/kernel/rtlx.c
+++ b/arch/mips/kernel/rtlx.c
@@ -56,8 +56,6 @@ static struct chan_waitqueues {
56 struct mutex mutex; 56 struct mutex mutex;
57} channel_wqs[RTLX_CHANNELS]; 57} channel_wqs[RTLX_CHANNELS];
58 58
59static struct irqaction irq;
60static int irq_num;
61static struct vpe_notifications notify; 59static struct vpe_notifications notify;
62static int sp_stopping = 0; 60static int sp_stopping = 0;
63 61
@@ -111,7 +109,7 @@ static void __used dump_rtlx(void)
111static int rtlx_init(struct rtlx_info *rtlxi) 109static int rtlx_init(struct rtlx_info *rtlxi)
112{ 110{
113 if (rtlxi->id != RTLX_ID) { 111 if (rtlxi->id != RTLX_ID) {
114 printk(KERN_ERR "no valid RTLX id at 0x%p 0x%x\n", rtlxi, rtlxi->id); 112 printk(KERN_ERR "no valid RTLX id at 0x%p 0x%lx\n", rtlxi, rtlxi->id);
115 return -ENOEXEC; 113 return -ENOEXEC;
116 } 114 }
117 115
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S
index 53d7a977193c..118be24224f2 100644
--- a/arch/mips/kernel/scall64-n32.S
+++ b/arch/mips/kernel/scall64-n32.S
@@ -375,7 +375,7 @@ EXPORT(sysn32_call_table)
375 PTR sys_mkdirat 375 PTR sys_mkdirat
376 PTR sys_mknodat 376 PTR sys_mknodat
377 PTR sys_fchownat 377 PTR sys_fchownat
378 PTR sys_futimesat /* 6255 */ 378 PTR compat_sys_futimesat /* 6255 */
379 PTR sys_newfstatat 379 PTR sys_newfstatat
380 PTR sys_unlinkat 380 PTR sys_unlinkat
381 PTR sys_renameat 381 PTR sys_renameat
diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c
index d48d1d5bea0a..9a5596bf8571 100644
--- a/arch/mips/kernel/time.c
+++ b/arch/mips/kernel/time.c
@@ -16,6 +16,7 @@
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/sched.h> 17#include <linux/sched.h>
18#include <linux/param.h> 18#include <linux/param.h>
19#include <linux/profile.h>
19#include <linux/time.h> 20#include <linux/time.h>
20#include <linux/timex.h> 21#include <linux/timex.h>
21#include <linux/smp.h> 22#include <linux/smp.h>
diff --git a/arch/mips/mips-boards/malta/malta_int.c b/arch/mips/mips-boards/malta/malta_int.c
index 97aeb8c4e601..b73f21823c5e 100644
--- a/arch/mips/mips-boards/malta/malta_int.c
+++ b/arch/mips/mips-boards/malta/malta_int.c
@@ -256,7 +256,7 @@ asmlinkage void plat_irq_dispatch(void)
256 256
257 if (irq == MIPSCPU_INT_I8259A) 257 if (irq == MIPSCPU_INT_I8259A)
258 malta_hw0_irqdispatch(); 258 malta_hw0_irqdispatch();
259 else if (irq > 0) 259 else if (irq >= 0)
260 do_IRQ(MIPS_CPU_IRQ_BASE + irq); 260 do_IRQ(MIPS_CPU_IRQ_BASE + irq);
261 else 261 else
262 spurious_interrupt(); 262 spurious_interrupt();
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index 09d91505b90c..5240432e6d1d 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -8,6 +8,7 @@
8 * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com 8 * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com
9 * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved. 9 * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved.
10 */ 10 */
11#include <linux/bug.h>
11#include <linux/init.h> 12#include <linux/init.h>
12#include <linux/module.h> 13#include <linux/module.h>
13#include <linux/signal.h> 14#include <linux/signal.h>
@@ -132,6 +133,8 @@ void *kmap_coherent(struct page *page, unsigned long addr)
132 pte_t pte; 133 pte_t pte;
133 int tlbidx; 134 int tlbidx;
134 135
136 BUG_ON(Page_dcache_dirty(page));
137
135 inc_preempt_count(); 138 inc_preempt_count();
136 idx = (addr >> PAGE_SHIFT) & (FIX_N_COLOURS - 1); 139 idx = (addr >> PAGE_SHIFT) & (FIX_N_COLOURS - 1);
137#ifdef CONFIG_MIPS_MT_SMTC 140#ifdef CONFIG_MIPS_MT_SMTC
@@ -208,7 +211,7 @@ void copy_user_highpage(struct page *to, struct page *from,
208 void *vfrom, *vto; 211 void *vfrom, *vto;
209 212
210 vto = kmap_atomic(to, KM_USER1); 213 vto = kmap_atomic(to, KM_USER1);
211 if (cpu_has_dc_aliases) { 214 if (cpu_has_dc_aliases && !Page_dcache_dirty(from)) {
212 vfrom = kmap_coherent(from, vaddr); 215 vfrom = kmap_coherent(from, vaddr);
213 copy_page(vto, vfrom); 216 copy_page(vto, vfrom);
214 kunmap_coherent(); 217 kunmap_coherent();
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index 9cb39644b6f1..6c425b052442 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -58,6 +58,21 @@ static __init int __maybe_unused r10000_llsc_war(void)
58} 58}
59 59
60/* 60/*
61 * Found by experiment: At least some revisions of the 4kc throw under
62 * some circumstances a machine check exception, triggered by invalid
63 * values in the index register. Delaying the tlbp instruction until
64 * after the next branch, plus adding an additional nop in front of
65 * tlbwi/tlbwr avoids the invalid index register values. Nobody knows
66 * why; it's not an issue caused by the core RTL.
67 *
68 */
69static __init int __attribute__((unused)) m4kc_tlbp_war(void)
70{
71 return (current_cpu_data.processor_id & 0xffff00) ==
72 (PRID_COMP_MIPS | PRID_IMP_4KC);
73}
74
75/*
61 * A little micro-assembler, intended for TLB refill handler 76 * A little micro-assembler, intended for TLB refill handler
62 * synthesizing. It is intentionally kept simple, does only support 77 * synthesizing. It is intentionally kept simple, does only support
63 * a subset of instructions, and does not try to hide pipeline effects 78 * a subset of instructions, and does not try to hide pipeline effects
@@ -894,6 +909,8 @@ static __init void build_tlb_write_entry(u32 **p, struct label **l,
894 case CPU_20KC: 909 case CPU_20KC:
895 case CPU_25KF: 910 case CPU_25KF:
896 case CPU_LOONGSON2: 911 case CPU_LOONGSON2:
912 if (m4kc_tlbp_war())
913 i_nop(p);
897 tlbw(p); 914 tlbw(p);
898 break; 915 break;
899 916
@@ -1705,7 +1722,8 @@ build_r4000_tlbchange_handler_head(u32 **p, struct label **l,
1705 l_smp_pgtable_change(l, *p); 1722 l_smp_pgtable_change(l, *p);
1706# endif 1723# endif
1707 iPTE_LW(p, l, pte, ptr); /* get even pte */ 1724 iPTE_LW(p, l, pte, ptr); /* get even pte */
1708 build_tlb_probe_entry(p); 1725 if (!m4kc_tlbp_war())
1726 build_tlb_probe_entry(p);
1709} 1727}
1710 1728
1711static void __init 1729static void __init
@@ -1747,6 +1765,8 @@ static void __init build_r4000_tlb_load_handler(void)
1747 1765
1748 build_r4000_tlbchange_handler_head(&p, &l, &r, K0, K1); 1766 build_r4000_tlbchange_handler_head(&p, &l, &r, K0, K1);
1749 build_pte_present(&p, &l, &r, K0, K1, label_nopage_tlbl); 1767 build_pte_present(&p, &l, &r, K0, K1, label_nopage_tlbl);
1768 if (m4kc_tlbp_war())
1769 build_tlb_probe_entry(&p);
1750 build_make_valid(&p, &r, K0, K1); 1770 build_make_valid(&p, &r, K0, K1);
1751 build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1); 1771 build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1);
1752 1772
@@ -1781,6 +1801,8 @@ static void __init build_r4000_tlb_store_handler(void)
1781 1801
1782 build_r4000_tlbchange_handler_head(&p, &l, &r, K0, K1); 1802 build_r4000_tlbchange_handler_head(&p, &l, &r, K0, K1);
1783 build_pte_writable(&p, &l, &r, K0, K1, label_nopage_tlbs); 1803 build_pte_writable(&p, &l, &r, K0, K1, label_nopage_tlbs);
1804 if (m4kc_tlbp_war())
1805 build_tlb_probe_entry(&p);
1784 build_make_write(&p, &r, K0, K1); 1806 build_make_write(&p, &r, K0, K1);
1785 build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1); 1807 build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1);
1786 1808
@@ -1815,6 +1837,8 @@ static void __init build_r4000_tlb_modify_handler(void)
1815 1837
1816 build_r4000_tlbchange_handler_head(&p, &l, &r, K0, K1); 1838 build_r4000_tlbchange_handler_head(&p, &l, &r, K0, K1);
1817 build_pte_modifiable(&p, &l, &r, K0, K1, label_nopage_tlbm); 1839 build_pte_modifiable(&p, &l, &r, K0, K1, label_nopage_tlbm);
1840 if (m4kc_tlbp_war())
1841 build_tlb_probe_entry(&p);
1818 /* Present and writable bits set, set accessed and dirty bits. */ 1842 /* Present and writable bits set, set accessed and dirty bits. */
1819 build_make_write(&p, &r, K0, K1); 1843 build_make_write(&p, &r, K0, K1);
1820 build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1); 1844 build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1);
diff --git a/arch/mips/sgi-ip22/ip22-platform.c b/arch/mips/sgi-ip22/ip22-platform.c
index 78b608d2d4e1..28ffec8e5d1a 100644
--- a/arch/mips/sgi-ip22/ip22-platform.c
+++ b/arch/mips/sgi-ip22/ip22-platform.c
@@ -150,8 +150,8 @@ static int __init sgiseeq_devinit(void)
150 return res; 150 return res;
151 151
152 /* Second HPC is missing? */ 152 /* Second HPC is missing? */
153 if (ip22_is_fullhouse() || 153 if (!ip22_is_fullhouse() ||
154 !get_dbe(tmp, (unsigned int *)&hpc3c1->pbdma[1])) 154 get_dbe(tmp, (unsigned int *)&hpc3c1->pbdma[1]))
155 return 0; 155 return 0;
156 156
157 sgimc->giopar |= SGIMC_GIOPAR_MASTEREXP1 | SGIMC_GIOPAR_EXP164 | 157 sgimc->giopar |= SGIMC_GIOPAR_MASTEREXP1 | SGIMC_GIOPAR_EXP164 |
diff --git a/arch/mips/sgi-ip22/ip22-time.c b/arch/mips/sgi-ip22/ip22-time.c
index 8e88a442b22a..de3d01823ad5 100644
--- a/arch/mips/sgi-ip22/ip22-time.c
+++ b/arch/mips/sgi-ip22/ip22-time.c
@@ -114,8 +114,8 @@ static unsigned long dosample(void)
114 } while (msb); 114 } while (msb);
115 115
116 /* Stop the counter. */ 116 /* Stop the counter. */
117 writeb(sgint->tcword, (SGINT_TCWORD_CNT2 | SGINT_TCWORD_CALL | 117 writeb(SGINT_TCWORD_CNT2 | SGINT_TCWORD_CALL | SGINT_TCWORD_MSWST,
118 SGINT_TCWORD_MSWST)); 118 &sgint->tcword);
119 /* 119 /*
120 * Return the difference, this is how far the r4k counter increments 120 * Return the difference, this is how far the r4k counter increments
121 * for every 1/HZ seconds. We round off the nearest 1 MHz of master 121 * for every 1/HZ seconds. We round off the nearest 1 MHz of master
diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c
index cea8045ba40b..90fa11c72e1c 100644
--- a/arch/powerpc/kernel/legacy_serial.c
+++ b/arch/powerpc/kernel/legacy_serial.c
@@ -493,7 +493,7 @@ static int __init serial_dev_init(void)
493 493
494 return platform_device_register(&serial_device); 494 return platform_device_register(&serial_device);
495} 495}
496arch_initcall(serial_dev_init); 496device_initcall(serial_dev_init);
497 497
498 498
499/* 499/*
diff --git a/arch/powerpc/platforms/85xx/mpc8544_ds.c b/arch/powerpc/platforms/85xx/mpc8544_ds.c
index 0f834d8be444..48983bc56d46 100644
--- a/arch/powerpc/platforms/85xx/mpc8544_ds.c
+++ b/arch/powerpc/platforms/85xx/mpc8544_ds.c
@@ -178,7 +178,9 @@ define_machine(mpc8544_ds) {
178 .probe = mpc8544_ds_probe, 178 .probe = mpc8544_ds_probe,
179 .setup_arch = mpc8544_ds_setup_arch, 179 .setup_arch = mpc8544_ds_setup_arch,
180 .init_IRQ = mpc8544_ds_pic_init, 180 .init_IRQ = mpc8544_ds_pic_init,
181#ifdef CONFIG_PCI
181 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 182 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
183#endif
182 .get_irq = mpic_get_irq, 184 .get_irq = mpic_get_irq,
183 .restart = mpc85xx_restart, 185 .restart = mpc85xx_restart,
184 .calibrate_decr = generic_calibrate_decr, 186 .calibrate_decr = generic_calibrate_decr,
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
index 6a171e9abf7d..2d4cb7847604 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -351,10 +351,10 @@ define_machine(mpc85xx_cds) {
351 .get_irq = mpic_get_irq, 351 .get_irq = mpic_get_irq,
352#ifdef CONFIG_PCI 352#ifdef CONFIG_PCI
353 .restart = mpc85xx_cds_restart, 353 .restart = mpc85xx_cds_restart,
354 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
354#else 355#else
355 .restart = mpc85xx_restart, 356 .restart = mpc85xx_restart,
356#endif 357#endif
357 .calibrate_decr = generic_calibrate_decr, 358 .calibrate_decr = generic_calibrate_decr,
358 .progress = udbg_progress, 359 .progress = udbg_progress,
359 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
360}; 360};
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index be25ecd911ba..7ca7e676f1c4 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -207,5 +207,7 @@ define_machine(mpc85xx_mds) {
207 .restart = mpc85xx_restart, 207 .restart = mpc85xx_restart,
208 .calibrate_decr = generic_calibrate_decr, 208 .calibrate_decr = generic_calibrate_decr,
209 .progress = udbg_progress, 209 .progress = udbg_progress,
210#ifdef CONFIG_PCI
210 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 211 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
212#endif
211}; 213};
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
index 56b27caf7a27..47aafa76c933 100644
--- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
+++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -250,5 +250,7 @@ define_machine(mpc86xx_hpcn) {
250 .time_init = mpc86xx_time_init, 250 .time_init = mpc86xx_time_init,
251 .calibrate_decr = generic_calibrate_decr, 251 .calibrate_decr = generic_calibrate_decr,
252 .progress = udbg_progress, 252 .progress = udbg_progress,
253#ifdef CONFIG_PCI
253 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 254 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
255#endif
254}; 256};
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
index cfc249741592..19d4628edf79 100644
--- a/arch/powerpc/platforms/Kconfig
+++ b/arch/powerpc/platforms/Kconfig
@@ -285,6 +285,7 @@ config AXON_RAM
285config FSL_ULI1575 285config FSL_ULI1575
286 bool 286 bool
287 default n 287 default n
288 select GENERIC_ISA_DMA
288 help 289 help
289 Supports for the ULI1575 PCIe south bridge that exists on some 290 Supports for the ULI1575 PCIe south bridge that exists on some
290 Freescale reference boards. The boards all use the ULI in pretty 291 Freescale reference boards. The boards all use the ULI in pretty
diff --git a/arch/powerpc/sysdev/cpm2_common.c b/arch/powerpc/sysdev/cpm2_common.c
index 924412974795..c827715a5090 100644
--- a/arch/powerpc/sysdev/cpm2_common.c
+++ b/arch/powerpc/sysdev/cpm2_common.c
@@ -102,7 +102,7 @@ cpm_setbrg(uint brg, uint rate)
102 brg -= 4; 102 brg -= 4;
103 } 103 }
104 bp += brg; 104 bp += brg;
105 *bp = ((BRG_UART_CLK / rate) << 1) | CPM_BRG_EN; 105 out_be32(bp, (((BRG_UART_CLK / rate) - 1) << 1) | CPM_BRG_EN);
106 106
107 cpm2_unmap(bp); 107 cpm2_unmap(bp);
108} 108}
diff --git a/arch/ppc/kernel/head_8xx.S b/arch/ppc/kernel/head_8xx.S
index 944c35c24278..eb8d26f87362 100644
--- a/arch/ppc/kernel/head_8xx.S
+++ b/arch/ppc/kernel/head_8xx.S
@@ -495,9 +495,7 @@ LoadLargeDTLB:
495 lwz r11, 4(r0) 495 lwz r11, 4(r0)
496 496
497 lwz r12, 16(r0) 497 lwz r12, 16(r0)
498#ifdef CONFIG_8xx_CPU6
499 lwz r3, 8(r0) 498 lwz r3, 8(r0)
500#endif
501 rfi 499 rfi
502 500
503/* This is the data TLB error on the MPC8xx. This could be due to 501/* This is the data TLB error on the MPC8xx. This could be due to
diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c
index 139b4cff8019..e8dac81d8a0d 100644
--- a/arch/sparc64/kernel/pci.c
+++ b/arch/sparc64/kernel/pci.c
@@ -744,7 +744,7 @@ static void __devinit pci_of_scan_bus(struct pci_pbm_info *pbm,
744{ 744{
745 struct device_node *child; 745 struct device_node *child;
746 const u32 *reg; 746 const u32 *reg;
747 int reglen, devfn; 747 int reglen, devfn, prev_devfn;
748 struct pci_dev *dev; 748 struct pci_dev *dev;
749 749
750 if (ofpci_verbose) 750 if (ofpci_verbose)
@@ -752,14 +752,25 @@ static void __devinit pci_of_scan_bus(struct pci_pbm_info *pbm,
752 node->full_name, bus->number); 752 node->full_name, bus->number);
753 753
754 child = NULL; 754 child = NULL;
755 prev_devfn = -1;
755 while ((child = of_get_next_child(node, child)) != NULL) { 756 while ((child = of_get_next_child(node, child)) != NULL) {
756 if (ofpci_verbose) 757 if (ofpci_verbose)
757 printk(" * %s\n", child->full_name); 758 printk(" * %s\n", child->full_name);
758 reg = of_get_property(child, "reg", &reglen); 759 reg = of_get_property(child, "reg", &reglen);
759 if (reg == NULL || reglen < 20) 760 if (reg == NULL || reglen < 20)
760 continue; 761 continue;
762
761 devfn = (reg[0] >> 8) & 0xff; 763 devfn = (reg[0] >> 8) & 0xff;
762 764
765 /* This is a workaround for some device trees
766 * which list PCI devices twice. On the V100
767 * for example, device number 3 is listed twice.
768 * Once as "pm" and once again as "lomp".
769 */
770 if (devfn == prev_devfn)
771 continue;
772 prev_devfn = devfn;
773
763 /* create a new pci_dev for this device */ 774 /* create a new pci_dev for this device */
764 dev = of_create_pci_dev(pbm, child, bus, devfn, 0); 775 dev = of_create_pci_dev(pbm, child, bus, devfn, 0);
765 if (!dev) 776 if (!dev)
diff --git a/arch/x86_64/vdso/vclock_gettime.c b/arch/x86_64/vdso/vclock_gettime.c
index 17f6a00de712..5b54cdfb2b07 100644
--- a/arch/x86_64/vdso/vclock_gettime.c
+++ b/arch/x86_64/vdso/vclock_gettime.c
@@ -34,10 +34,11 @@ static long vdso_fallback_gettime(long clock, struct timespec *ts)
34 34
35static inline long vgetns(void) 35static inline long vgetns(void)
36{ 36{
37 long v;
37 cycles_t (*vread)(void); 38 cycles_t (*vread)(void);
38 vread = gtod->clock.vread; 39 vread = gtod->clock.vread;
39 return ((vread() - gtod->clock.cycle_last) * gtod->clock.mult) >> 40 v = (vread() - gtod->clock.cycle_last) & gtod->clock.mask;
40 gtod->clock.shift; 41 return (v * gtod->clock.mult) >> gtod->clock.shift;
41} 42}
42 43
43static noinline int do_realtime(struct timespec *ts) 44static noinline int do_realtime(struct timespec *ts)
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index a15845c164f2..ed39313c4085 100644
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -1075,12 +1075,6 @@ void blk_queue_end_tag(struct request_queue *q, struct request *rq)
1075 */ 1075 */
1076 return; 1076 return;
1077 1077
1078 if (unlikely(!__test_and_clear_bit(tag, bqt->tag_map))) {
1079 printk(KERN_ERR "%s: attempt to clear non-busy tag (%d)\n",
1080 __FUNCTION__, tag);
1081 return;
1082 }
1083
1084 list_del_init(&rq->queuelist); 1078 list_del_init(&rq->queuelist);
1085 rq->cmd_flags &= ~REQ_QUEUED; 1079 rq->cmd_flags &= ~REQ_QUEUED;
1086 rq->tag = -1; 1080 rq->tag = -1;
@@ -1090,6 +1084,19 @@ void blk_queue_end_tag(struct request_queue *q, struct request *rq)
1090 __FUNCTION__, tag); 1084 __FUNCTION__, tag);
1091 1085
1092 bqt->tag_index[tag] = NULL; 1086 bqt->tag_index[tag] = NULL;
1087
1088 /*
1089 * We use test_and_clear_bit's memory ordering properties here.
1090 * The tag_map bit acts as a lock for tag_index[bit], so we need
1091 * a barrer before clearing the bit (precisely: release semantics).
1092 * Could use clear_bit_unlock when it is merged.
1093 */
1094 if (unlikely(!test_and_clear_bit(tag, bqt->tag_map))) {
1095 printk(KERN_ERR "%s: attempt to clear non-busy tag (%d)\n",
1096 __FUNCTION__, tag);
1097 return;
1098 }
1099
1093 bqt->busy--; 1100 bqt->busy--;
1094} 1101}
1095 1102
@@ -1136,6 +1143,10 @@ int blk_queue_start_tag(struct request_queue *q, struct request *rq)
1136 return 1; 1143 return 1;
1137 1144
1138 } while (test_and_set_bit(tag, bqt->tag_map)); 1145 } while (test_and_set_bit(tag, bqt->tag_map));
1146 /*
1147 * We rely on test_and_set_bit providing lock memory ordering semantics
1148 * (could use test_and_set_bit_lock when it is merged).
1149 */
1139 1150
1140 rq->cmd_flags |= REQ_QUEUED; 1151 rq->cmd_flags |= REQ_QUEUED;
1141 rq->tag = tag; 1152 rq->tag = tag;
diff --git a/drivers/ata/pata_ali.c b/drivers/ata/pata_ali.c
index 94e5edc12ac9..71bdc3b3189c 100644
--- a/drivers/ata/pata_ali.c
+++ b/drivers/ata/pata_ali.c
@@ -48,6 +48,13 @@ static struct dmi_system_id cable_dmi_table[] = {
48 DMI_MATCH(DMI_BOARD_VERSION, "OmniBook N32N-736"), 48 DMI_MATCH(DMI_BOARD_VERSION, "OmniBook N32N-736"),
49 }, 49 },
50 }, 50 },
51 {
52 .ident = "Toshiba Satelite S1800-814",
53 .matches = {
54 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
55 DMI_MATCH(DMI_PRODUCT_NAME, "S1800-814"),
56 },
57 },
51 { } 58 { }
52}; 59};
53 60
diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c
index 92bf868ca056..504a95d888b2 100644
--- a/drivers/block/DAC960.c
+++ b/drivers/block/DAC960.c
@@ -17,8 +17,8 @@
17*/ 17*/
18 18
19 19
20#define DAC960_DriverVersion "2.5.48" 20#define DAC960_DriverVersion "2.5.49"
21#define DAC960_DriverDate "14 May 2006" 21#define DAC960_DriverDate "21 Aug 2007"
22 22
23 23
24#include <linux/module.h> 24#include <linux/module.h>
@@ -1165,9 +1165,9 @@ static bool DAC960_V1_EnableMemoryMailboxInterface(DAC960_Controller_T
1165 int i; 1165 int i;
1166 1166
1167 1167
1168 if (pci_set_dma_mask(Controller->PCIDevice, DAC690_V1_PciDmaMask)) 1168 if (pci_set_dma_mask(Controller->PCIDevice, DMA_32BIT_MASK))
1169 return DAC960_Failure(Controller, "DMA mask out of range"); 1169 return DAC960_Failure(Controller, "DMA mask out of range");
1170 Controller->BounceBufferLimit = DAC690_V1_PciDmaMask; 1170 Controller->BounceBufferLimit = DMA_32BIT_MASK;
1171 1171
1172 if ((hw_type == DAC960_PD_Controller) || (hw_type == DAC960_P_Controller)) { 1172 if ((hw_type == DAC960_PD_Controller) || (hw_type == DAC960_P_Controller)) {
1173 CommandMailboxesSize = 0; 1173 CommandMailboxesSize = 0;
@@ -1368,9 +1368,12 @@ static bool DAC960_V2_EnableMemoryMailboxInterface(DAC960_Controller_T
1368 dma_addr_t CommandMailboxDMA; 1368 dma_addr_t CommandMailboxDMA;
1369 DAC960_V2_CommandStatus_T CommandStatus; 1369 DAC960_V2_CommandStatus_T CommandStatus;
1370 1370
1371 if (pci_set_dma_mask(Controller->PCIDevice, DAC690_V2_PciDmaMask)) 1371 if (!pci_set_dma_mask(Controller->PCIDevice, DMA_64BIT_MASK))
1372 return DAC960_Failure(Controller, "DMA mask out of range"); 1372 Controller->BounceBufferLimit = DMA_64BIT_MASK;
1373 Controller->BounceBufferLimit = DAC690_V2_PciDmaMask; 1373 else if (!pci_set_dma_mask(Controller->PCIDevice, DMA_32BIT_MASK))
1374 Controller->BounceBufferLimit = DMA_32BIT_MASK;
1375 else
1376 return DAC960_Failure(Controller, "DMA mask out of range");
1374 1377
1375 /* This is a temporary dma mapping, used only in the scope of this function */ 1378 /* This is a temporary dma mapping, used only in the scope of this function */
1376 CommandMailbox = pci_alloc_consistent(PCI_Device, 1379 CommandMailbox = pci_alloc_consistent(PCI_Device,
diff --git a/drivers/block/DAC960.h b/drivers/block/DAC960.h
index f5e2436c39aa..85fa9bb63759 100644
--- a/drivers/block/DAC960.h
+++ b/drivers/block/DAC960.h
@@ -61,13 +61,6 @@
61#define DAC960_V2_MaxPhysicalDevices 272 61#define DAC960_V2_MaxPhysicalDevices 272
62 62
63/* 63/*
64 Define the pci dma mask supported by DAC960 V1 and V2 Firmware Controlers
65 */
66
67#define DAC690_V1_PciDmaMask 0xffffffff
68#define DAC690_V2_PciDmaMask 0xffffffffffffffffULL
69
70/*
71 Define a 32/64 bit I/O Address data type. 64 Define a 32/64 bit I/O Address data type.
72*/ 65*/
73 66
diff --git a/drivers/bluetooth/hci_usb.c b/drivers/bluetooth/hci_usb.c
index 59b054810ed0..98a9cdeaffb6 100644
--- a/drivers/bluetooth/hci_usb.c
+++ b/drivers/bluetooth/hci_usb.c
@@ -691,15 +691,18 @@ static void hci_usb_rx_complete(struct urb *urb)
691 urb->iso_frame_desc[i].offset, 691 urb->iso_frame_desc[i].offset,
692 urb->iso_frame_desc[i].actual_length); 692 urb->iso_frame_desc[i].actual_length);
693 693
694 if (!urb->iso_frame_desc[i].status) 694 if (!urb->iso_frame_desc[i].status) {
695 husb->hdev->stat.byte_rx += urb->iso_frame_desc[i].actual_length;
695 hci_recv_fragment(husb->hdev, _urb->type, 696 hci_recv_fragment(husb->hdev, _urb->type,
696 urb->transfer_buffer + urb->iso_frame_desc[i].offset, 697 urb->transfer_buffer + urb->iso_frame_desc[i].offset,
697 urb->iso_frame_desc[i].actual_length); 698 urb->iso_frame_desc[i].actual_length);
699 }
698 } 700 }
699#else 701#else
700 ; 702 ;
701#endif 703#endif
702 } else { 704 } else {
705 husb->hdev->stat.byte_rx += count;
703 err = hci_recv_fragment(husb->hdev, _urb->type, urb->transfer_buffer, count); 706 err = hci_recv_fragment(husb->hdev, _urb->type, urb->transfer_buffer, count);
704 if (err < 0) { 707 if (err < 0) {
705 BT_ERR("%s corrupted packet: type %d count %d", 708 BT_ERR("%s corrupted packet: type %d count %d",
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c
index 2c9ca2c64628..7c69bf259caa 100644
--- a/drivers/char/agp/intel-agp.c
+++ b/drivers/char/agp/intel-agp.c
@@ -506,6 +506,11 @@ static void intel_i830_init_gtt_entries(void)
506 break; 506 break;
507 } 507 }
508 } else { 508 } else {
509 /* G33's GTT stolen memory is separate from gfx data
510 * stolen memory.
511 */
512 if (IS_G33)
513 size = 0;
509 switch (gmch_ctrl & I830_GMCH_GMS_MASK) { 514 switch (gmch_ctrl & I830_GMCH_GMS_MASK) {
510 case I855_GMCH_GMS_STOLEN_1M: 515 case I855_GMCH_GMS_STOLEN_1M:
511 gtt_entries = MB(1) - KB(size); 516 gtt_entries = MB(1) - KB(size);
@@ -914,6 +919,7 @@ static int intel_i915_create_gatt_table(struct agp_bridge_data *bridge)
914 struct aper_size_info_fixed *size; 919 struct aper_size_info_fixed *size;
915 int num_entries; 920 int num_entries;
916 u32 temp, temp2; 921 u32 temp, temp2;
922 int gtt_map_size = 256 * 1024;
917 923
918 size = agp_bridge->current_size; 924 size = agp_bridge->current_size;
919 page_order = size->page_order; 925 page_order = size->page_order;
@@ -923,7 +929,9 @@ static int intel_i915_create_gatt_table(struct agp_bridge_data *bridge)
923 pci_read_config_dword(intel_private.pcidev, I915_MMADDR, &temp); 929 pci_read_config_dword(intel_private.pcidev, I915_MMADDR, &temp);
924 pci_read_config_dword(intel_private.pcidev, I915_PTEADDR,&temp2); 930 pci_read_config_dword(intel_private.pcidev, I915_PTEADDR,&temp2);
925 931
926 intel_private.gtt = ioremap(temp2, 256 * 1024); 932 if (IS_G33)
933 gtt_map_size = 1024 * 1024; /* 1M on G33 */
934 intel_private.gtt = ioremap(temp2, gtt_map_size);
927 if (!intel_private.gtt) 935 if (!intel_private.gtt)
928 return -ENOMEM; 936 return -ENOMEM;
929 937
diff --git a/drivers/char/tty_ioctl.c b/drivers/char/tty_ioctl.c
index 3423e9ee6481..4a8969cef315 100644
--- a/drivers/char/tty_ioctl.c
+++ b/drivers/char/tty_ioctl.c
@@ -796,14 +796,14 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file,
796 retval = inq_canon(tty); 796 retval = inq_canon(tty);
797 return put_user(retval, (unsigned int __user *) arg); 797 return put_user(retval, (unsigned int __user *) arg);
798 case TIOCGLCKTRMIOS: 798 case TIOCGLCKTRMIOS:
799 if (kernel_termios_to_user_termios((struct termios __user *)arg, real_tty->termios_locked)) 799 if (kernel_termios_to_user_termios_1((struct termios __user *)arg, real_tty->termios_locked))
800 return -EFAULT; 800 return -EFAULT;
801 return 0; 801 return 0;
802 802
803 case TIOCSLCKTRMIOS: 803 case TIOCSLCKTRMIOS:
804 if (!capable(CAP_SYS_ADMIN)) 804 if (!capable(CAP_SYS_ADMIN))
805 return -EPERM; 805 return -EPERM;
806 if (user_termios_to_kernel_termios(real_tty->termios_locked, (struct termios __user *) arg)) 806 if (user_termios_to_kernel_termios_1(real_tty->termios_locked, (struct termios __user *) arg))
807 return -EFAULT; 807 return -EFAULT;
808 return 0; 808 return 0;
809 809
diff --git a/drivers/edac/e752x_edac.c b/drivers/edac/e752x_edac.c
index 3bba224cb55d..6eb434749cd5 100644
--- a/drivers/edac/e752x_edac.c
+++ b/drivers/edac/e752x_edac.c
@@ -967,7 +967,7 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
967 if (!force_function_unhide && !(stat8 & (1 << 5))) { 967 if (!force_function_unhide && !(stat8 & (1 << 5))) {
968 printk(KERN_INFO "Contact your BIOS vendor to see if the " 968 printk(KERN_INFO "Contact your BIOS vendor to see if the "
969 "E752x error registers can be safely un-hidden\n"); 969 "E752x error registers can be safely un-hidden\n");
970 return -ENOMEM; 970 return -ENODEV;
971 } 971 }
972 stat8 |= (1 << 5); 972 stat8 |= (1 << 5);
973 pci_write_config_byte(pdev, E752X_DEVPRES1, stat8); 973 pci_write_config_byte(pdev, E752X_DEVPRES1, stat8);
diff --git a/drivers/edac/edac_core.h b/drivers/edac/edac_core.h
index 4e6bad15c4ba..e80af67664cc 100644
--- a/drivers/edac/edac_core.h
+++ b/drivers/edac/edac_core.h
@@ -75,7 +75,7 @@ extern int edac_debug_level;
75#define edac_debug_printk(level, fmt, arg...) \ 75#define edac_debug_printk(level, fmt, arg...) \
76 do { \ 76 do { \
77 if (level <= edac_debug_level) \ 77 if (level <= edac_debug_level) \
78 edac_printk(KERN_EMERG, EDAC_DEBUG, fmt, ##arg); \ 78 edac_printk(KERN_DEBUG, EDAC_DEBUG, fmt, ##arg); \
79 } while(0) 79 } while(0)
80 80
81#define debugf0( ... ) edac_debug_printk(0, __VA_ARGS__ ) 81#define debugf0( ... ) edac_debug_printk(0, __VA_ARGS__ )
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index 7adb61bad6ad..4200251ff635 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -781,7 +781,7 @@ endif
781 781
782config BLK_DEV_IDE_PMAC 782config BLK_DEV_IDE_PMAC
783 bool "Builtin PowerMac IDE support" 783 bool "Builtin PowerMac IDE support"
784 depends on PPC_PMAC && IDE=y 784 depends on PPC_PMAC && IDE=y && BLK_DEV_IDE=y
785 help 785 help
786 This driver provides support for the built-in IDE controller on 786 This driver provides support for the built-in IDE controller on
787 most of the recent Apple Power Macintoshes and PowerBooks. 787 most of the recent Apple Power Macintoshes and PowerBooks.
@@ -946,7 +946,7 @@ config BLK_DEV_Q40IDE
946 946
947config BLK_DEV_MPC8xx_IDE 947config BLK_DEV_MPC8xx_IDE
948 bool "MPC8xx IDE support" 948 bool "MPC8xx IDE support"
949 depends on 8xx && IDE=y && BLK_DEV_IDE=y 949 depends on 8xx && IDE=y && BLK_DEV_IDE=y && !PPC_MERGE
950 select IDE_GENERIC 950 select IDE_GENERIC
951 help 951 help
952 This option provides support for IDE on Motorola MPC8xx Systems. 952 This option provides support for IDE on Motorola MPC8xx Systems.
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index f4cd2700cae5..646a54e233d3 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -615,8 +615,7 @@ u8 eighty_ninty_three (ide_drive_t *drive)
615 if (hwif->cbl != ATA_CBL_PATA80 && !ivb) 615 if (hwif->cbl != ATA_CBL_PATA80 && !ivb)
616 goto no_80w; 616 goto no_80w;
617 617
618 /* Check for SATA but only if we are ATA5 or higher */ 618 if (ide_dev_is_sata(id))
619 if (id->hw_config == 0 && (id->major_rev_num & 0x7FE0))
620 return 1; 619 return 1;
621 620
622 /* 621 /*
diff --git a/drivers/ide/pci/alim15x3.c b/drivers/ide/pci/alim15x3.c
index 025689de50e9..11ecb618007c 100644
--- a/drivers/ide/pci/alim15x3.c
+++ b/drivers/ide/pci/alim15x3.c
@@ -596,6 +596,13 @@ static struct dmi_system_id cable_dmi_table[] = {
596 DMI_MATCH(DMI_BOARD_VERSION, "OmniBook N32N-736"), 596 DMI_MATCH(DMI_BOARD_VERSION, "OmniBook N32N-736"),
597 }, 597 },
598 }, 598 },
599 {
600 .ident = "Toshiba Satellite S1800-814",
601 .matches = {
602 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
603 DMI_MATCH(DMI_PRODUCT_NAME, "S1800-814"),
604 },
605 },
599 { } 606 { }
600}; 607};
601 608
diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c
index 2cd74c345a6c..39f1c89f7c86 100644
--- a/drivers/ide/pci/hpt366.c
+++ b/drivers/ide/pci/hpt366.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/drivers/ide/pci/hpt366.c Version 1.10 Jun 29, 2007 2 * linux/drivers/ide/pci/hpt366.c Version 1.12 Aug 19, 2007
3 * 3 *
4 * Copyright (C) 1999-2003 Andre Hedrick <andre@linux-ide.org> 4 * Copyright (C) 1999-2003 Andre Hedrick <andre@linux-ide.org>
5 * Portions Copyright (C) 2001 Sun Microsystems, Inc. 5 * Portions Copyright (C) 2001 Sun Microsystems, Inc.
@@ -68,7 +68,8 @@
68 * HPT37x chip family; save space by introducing the separate transfer mode 68 * HPT37x chip family; save space by introducing the separate transfer mode
69 * table in which the mode lookup is done 69 * table in which the mode lookup is done
70 * - use f_CNT value saved by the HighPoint BIOS as reading it directly gives 70 * - use f_CNT value saved by the HighPoint BIOS as reading it directly gives
71 * the wrong PCI frequency since DPLL has already been calibrated by BIOS 71 * the wrong PCI frequency since DPLL has already been calibrated by BIOS;
72 * read it only from the function 0 of HPT374 chips
72 * - fix the hotswap code: it caused RESET- to glitch when tristating the bus, 73 * - fix the hotswap code: it caused RESET- to glitch when tristating the bus,
73 * and for HPT36x the obsolete HDIO_TRISTATE_HWIF handler was called instead 74 * and for HPT36x the obsolete HDIO_TRISTATE_HWIF handler was called instead
74 * - pass to init_chipset() handlers a copy of the IDE PCI device structure as 75 * - pass to init_chipset() handlers a copy of the IDE PCI device structure as
@@ -113,6 +114,7 @@
113 * unify HPT36x/37x timing setup code and the speedproc handlers by joining 114 * unify HPT36x/37x timing setup code and the speedproc handlers by joining
114 * the register setting lists into the table indexed by the clock selected 115 * the register setting lists into the table indexed by the clock selected
115 * - set the correct hwif->ultra_mask for each individual chip 116 * - set the correct hwif->ultra_mask for each individual chip
117 * - add UltraDMA mode filtering for the HPT37[24] based SATA cards
116 * Sergei Shtylyov, <sshtylyov@ru.mvista.com> or <source@mvista.com> 118 * Sergei Shtylyov, <sshtylyov@ru.mvista.com> or <source@mvista.com>
117 */ 119 */
118 120
@@ -517,42 +519,44 @@ static int check_in_drive_list(ide_drive_t *drive, const char **list)
517} 519}
518 520
519/* 521/*
520 * Note for the future; the SATA hpt37x we must set 522 * The Marvell bridge chips used on the HighPoint SATA cards do not seem
521 * either PIO or UDMA modes 0,4,5 523 * to support the UltraDMA modes 1, 2, and 3 as well as any MWDMA modes...
522 */ 524 */
523 525
524static u8 hpt3xx_udma_filter(ide_drive_t *drive) 526static u8 hpt3xx_udma_filter(ide_drive_t *drive)
525{ 527{
526 struct hpt_info *info = pci_get_drvdata(HWIF(drive)->pci_dev); 528 ide_hwif_t *hwif = HWIF(drive);
527 u8 mask; 529 struct hpt_info *info = pci_get_drvdata(hwif->pci_dev);
530 u8 mask = hwif->ultra_mask;
528 531
529 switch (info->chip_type) { 532 switch (info->chip_type) {
530 case HPT370A:
531 if (!HPT370_ALLOW_ATA100_5 ||
532 check_in_drive_list(drive, bad_ata100_5))
533 return 0x1f;
534 else
535 return 0x3f;
536 case HPT370:
537 if (!HPT370_ALLOW_ATA100_5 ||
538 check_in_drive_list(drive, bad_ata100_5))
539 mask = 0x1f;
540 else
541 mask = 0x3f;
542 break;
543 case HPT36x: 533 case HPT36x:
544 if (!HPT366_ALLOW_ATA66_4 || 534 if (!HPT366_ALLOW_ATA66_4 ||
545 check_in_drive_list(drive, bad_ata66_4)) 535 check_in_drive_list(drive, bad_ata66_4))
546 mask = 0x0f; 536 mask = ATA_UDMA3;
547 else
548 mask = 0x1f;
549 537
550 if (!HPT366_ALLOW_ATA66_3 || 538 if (!HPT366_ALLOW_ATA66_3 ||
551 check_in_drive_list(drive, bad_ata66_3)) 539 check_in_drive_list(drive, bad_ata66_3))
552 mask = 0x07; 540 mask = ATA_UDMA2;
541 break;
542 case HPT370:
543 if (!HPT370_ALLOW_ATA100_5 ||
544 check_in_drive_list(drive, bad_ata100_5))
545 mask = ATA_UDMA4;
553 break; 546 break;
547 case HPT370A:
548 if (!HPT370_ALLOW_ATA100_5 ||
549 check_in_drive_list(drive, bad_ata100_5))
550 return ATA_UDMA4;
551 case HPT372 :
552 case HPT372A:
553 case HPT372N:
554 case HPT374 :
555 if (ide_dev_is_sata(drive->id))
556 mask &= ~0x0e;
557 /* Fall thru */
554 default: 558 default:
555 return 0x7f; 559 return mask;
556 } 560 }
557 561
558 return check_in_drive_list(drive, bad_ata33) ? 0x00 : mask; 562 return check_in_drive_list(drive, bad_ata33) ? 0x00 : mask;
@@ -981,6 +985,7 @@ static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev, const cha
981 struct hpt_info *info = kmalloc(sizeof(struct hpt_info), GFP_KERNEL); 985 struct hpt_info *info = kmalloc(sizeof(struct hpt_info), GFP_KERNEL);
982 unsigned long io_base = pci_resource_start(dev, 4); 986 unsigned long io_base = pci_resource_start(dev, 4);
983 u8 pci_clk, dpll_clk = 0; /* PCI and DPLL clock in MHz */ 987 u8 pci_clk, dpll_clk = 0; /* PCI and DPLL clock in MHz */
988 u8 chip_type;
984 enum ata_clock clock; 989 enum ata_clock clock;
985 990
986 if (info == NULL) { 991 if (info == NULL) {
@@ -992,7 +997,8 @@ static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev, const cha
992 * Copy everything from a static "template" structure 997 * Copy everything from a static "template" structure
993 * to just allocated per-chip hpt_info structure. 998 * to just allocated per-chip hpt_info structure.
994 */ 999 */
995 *info = *(struct hpt_info *)pci_get_drvdata(dev); 1000 memcpy(info, pci_get_drvdata(dev), sizeof(struct hpt_info));
1001 chip_type = info->chip_type;
996 1002
997 pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, (L1_CACHE_BYTES / 4)); 1003 pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, (L1_CACHE_BYTES / 4));
998 pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0x78); 1004 pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0x78);
@@ -1002,7 +1008,7 @@ static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev, const cha
1002 /* 1008 /*
1003 * First, try to estimate the PCI clock frequency... 1009 * First, try to estimate the PCI clock frequency...
1004 */ 1010 */
1005 if (info->chip_type >= HPT370) { 1011 if (chip_type >= HPT370) {
1006 u8 scr1 = 0; 1012 u8 scr1 = 0;
1007 u16 f_cnt = 0; 1013 u16 f_cnt = 0;
1008 u32 temp = 0; 1014 u32 temp = 0;
@@ -1016,7 +1022,7 @@ static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev, const cha
1016 * HighPoint does this for HPT372A. 1022 * HighPoint does this for HPT372A.
1017 * NOTE: This register is only writeable via I/O space. 1023 * NOTE: This register is only writeable via I/O space.
1018 */ 1024 */
1019 if (info->chip_type == HPT372A) 1025 if (chip_type == HPT372A)
1020 outb(0x0e, io_base + 0x9c); 1026 outb(0x0e, io_base + 0x9c);
1021 1027
1022 /* 1028 /*
@@ -1034,13 +1040,28 @@ static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev, const cha
1034 * First try reading the register in which the HighPoint BIOS 1040 * First try reading the register in which the HighPoint BIOS
1035 * saves f_CNT value before reprogramming the DPLL from its 1041 * saves f_CNT value before reprogramming the DPLL from its
1036 * default setting (which differs for the various chips). 1042 * default setting (which differs for the various chips).
1037 * NOTE: This register is only accessible via I/O space.
1038 * 1043 *
1039 * In case the signature check fails, we'll have to resort to 1044 * NOTE: This register is only accessible via I/O space;
1040 * reading the f_CNT register itself in hopes that nobody has 1045 * HPT374 BIOS only saves it for the function 0, so we have to
1041 * touched the DPLL yet... 1046 * always read it from there -- no need to check the result of
1047 * pci_get_slot() for the function 0 as the whole device has
1048 * been already "pinned" (via function 1) in init_setup_hpt374()
1049 */
1050 if (chip_type == HPT374 && (PCI_FUNC(dev->devfn) & 1)) {
1051 struct pci_dev *dev1 = pci_get_slot(dev->bus,
1052 dev->devfn - 1);
1053 unsigned long io_base = pci_resource_start(dev1, 4);
1054
1055 temp = inl(io_base + 0x90);
1056 pci_dev_put(dev1);
1057 } else
1058 temp = inl(io_base + 0x90);
1059
1060 /*
1061 * In case the signature check fails, we'll have to
1062 * resort to reading the f_CNT register itself in hopes
1063 * that nobody has touched the DPLL yet...
1042 */ 1064 */
1043 temp = inl(io_base + 0x90);
1044 if ((temp & 0xFFFFF000) != 0xABCDE000) { 1065 if ((temp & 0xFFFFF000) != 0xABCDE000) {
1045 int i; 1066 int i;
1046 1067
@@ -1120,7 +1141,7 @@ static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev, const cha
1120 * We also don't like using the DPLL because this causes glitches 1141 * We also don't like using the DPLL because this causes glitches
1121 * on PRST-/SRST- when the state engine gets reset... 1142 * on PRST-/SRST- when the state engine gets reset...
1122 */ 1143 */
1123 if (info->chip_type >= HPT374 || info->settings[clock] == NULL) { 1144 if (chip_type >= HPT374 || info->settings[clock] == NULL) {
1124 u16 f_low, delta = pci_clk < 50 ? 2 : 4; 1145 u16 f_low, delta = pci_clk < 50 ? 2 : 4;
1125 int adjust; 1146 int adjust;
1126 1147
@@ -1190,7 +1211,7 @@ static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev, const cha
1190 /* Point to this chip's own instance of the hpt_info structure. */ 1211 /* Point to this chip's own instance of the hpt_info structure. */
1191 pci_set_drvdata(dev, info); 1212 pci_set_drvdata(dev, info);
1192 1213
1193 if (info->chip_type >= HPT370) { 1214 if (chip_type >= HPT370) {
1194 u8 mcr1, mcr4; 1215 u8 mcr1, mcr4;
1195 1216
1196 /* 1217 /*
@@ -1209,7 +1230,7 @@ static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev, const cha
1209 * the MISC. register to stretch the UltraDMA Tss timing. 1230 * the MISC. register to stretch the UltraDMA Tss timing.
1210 * NOTE: This register is only writeable via I/O space. 1231 * NOTE: This register is only writeable via I/O space.
1211 */ 1232 */
1212 if (info->chip_type == HPT371N && clock == ATA_CLOCK_66MHZ) 1233 if (chip_type == HPT371N && clock == ATA_CLOCK_66MHZ)
1213 1234
1214 outb(inb(io_base + 0x9c) | 0x04, io_base + 0x9c); 1235 outb(inb(io_base + 0x9c) | 0x04, io_base + 0x9c);
1215 1236
@@ -1218,25 +1239,24 @@ static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev, const cha
1218 1239
1219static void __devinit init_hwif_hpt366(ide_hwif_t *hwif) 1240static void __devinit init_hwif_hpt366(ide_hwif_t *hwif)
1220{ 1241{
1221 struct pci_dev *dev = hwif->pci_dev; 1242 struct pci_dev *dev = hwif->pci_dev;
1222 struct hpt_info *info = pci_get_drvdata(dev); 1243 struct hpt_info *info = pci_get_drvdata(dev);
1223 int serialize = HPT_SERIALIZE_IO; 1244 int serialize = HPT_SERIALIZE_IO;
1224 u8 scr1 = 0, ata66 = hwif->channel ? 0x01 : 0x02; 1245 u8 scr1 = 0, ata66 = hwif->channel ? 0x01 : 0x02;
1225 u8 chip_type = info->chip_type; 1246 u8 chip_type = info->chip_type;
1226 u8 new_mcr, old_mcr = 0; 1247 u8 new_mcr, old_mcr = 0;
1227 1248
1228 /* Cache the channel's MISC. control registers' offset */ 1249 /* Cache the channel's MISC. control registers' offset */
1229 hwif->select_data = hwif->channel ? 0x54 : 0x50; 1250 hwif->select_data = hwif->channel ? 0x54 : 0x50;
1230 1251
1231 hwif->tuneproc = &hpt3xx_tune_drive; 1252 hwif->tuneproc = &hpt3xx_tune_drive;
1232 hwif->speedproc = &hpt3xx_tune_chipset; 1253 hwif->speedproc = &hpt3xx_tune_chipset;
1233 hwif->quirkproc = &hpt3xx_quirkproc; 1254 hwif->quirkproc = &hpt3xx_quirkproc;
1234 hwif->intrproc = &hpt3xx_intrproc; 1255 hwif->intrproc = &hpt3xx_intrproc;
1235 hwif->maskproc = &hpt3xx_maskproc; 1256 hwif->maskproc = &hpt3xx_maskproc;
1236 hwif->busproc = &hpt3xx_busproc; 1257 hwif->busproc = &hpt3xx_busproc;
1237 1258
1238 if (chip_type <= HPT370A) 1259 hwif->udma_filter = &hpt3xx_udma_filter;
1239 hwif->udma_filter = &hpt3xx_udma_filter;
1240 1260
1241 /* 1261 /*
1242 * HPT3xxN chips have some complications: 1262 * HPT3xxN chips have some complications:
@@ -1486,19 +1506,19 @@ static int __devinit init_setup_hpt366(struct pci_dev *dev, ide_pci_device_t *d)
1486 d->host_flags |= IDE_HFLAG_SINGLE; 1506 d->host_flags |= IDE_HFLAG_SINGLE;
1487 d->enablebits[0].mask = d->enablebits[0].val = 0x10; 1507 d->enablebits[0].mask = d->enablebits[0].val = 0x10;
1488 1508
1489 d->udma_mask = HPT366_ALLOW_ATA66_3 ? 1509 d->udma_mask = HPT366_ALLOW_ATA66_3 ? (HPT366_ALLOW_ATA66_4 ?
1490 (HPT366_ALLOW_ATA66_4 ? 0x1f : 0x0f) : 0x07; 1510 ATA_UDMA4 : ATA_UDMA3) : ATA_UDMA2;
1491 break; 1511 break;
1492 case 3: 1512 case 3:
1493 case 4: 1513 case 4:
1494 d->udma_mask = HPT370_ALLOW_ATA100_5 ? 0x3f : 0x1f; 1514 d->udma_mask = HPT370_ALLOW_ATA100_5 ? ATA_UDMA5 : ATA_UDMA4;
1495 break; 1515 break;
1496 default: 1516 default:
1497 rev = 6; 1517 rev = 6;
1498 /* fall thru */ 1518 /* fall thru */
1499 case 5: 1519 case 5:
1500 case 6: 1520 case 6:
1501 d->udma_mask = HPT372_ALLOW_ATA133_6 ? 0x7f : 0x3f; 1521 d->udma_mask = HPT372_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5;
1502 break; 1522 break;
1503 } 1523 }
1504 1524
@@ -1559,7 +1579,7 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
1559 .init_dma = init_dma_hpt366, 1579 .init_dma = init_dma_hpt366,
1560 .autodma = AUTODMA, 1580 .autodma = AUTODMA,
1561 .enablebits = {{0x50,0x04,0x04}, {0x54,0x04,0x04}}, 1581 .enablebits = {{0x50,0x04,0x04}, {0x54,0x04,0x04}},
1562 .udma_mask = HPT372_ALLOW_ATA133_6 ? 0x7f : 0x3f, 1582 .udma_mask = HPT372_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
1563 .bootable = OFF_BOARD, 1583 .bootable = OFF_BOARD,
1564 .extra = 240, 1584 .extra = 240,
1565 .pio_mask = ATA_PIO4, 1585 .pio_mask = ATA_PIO4,
@@ -1571,7 +1591,7 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
1571 .init_dma = init_dma_hpt366, 1591 .init_dma = init_dma_hpt366,
1572 .autodma = AUTODMA, 1592 .autodma = AUTODMA,
1573 .enablebits = {{0x50,0x04,0x04}, {0x54,0x04,0x04}}, 1593 .enablebits = {{0x50,0x04,0x04}, {0x54,0x04,0x04}},
1574 .udma_mask = HPT302_ALLOW_ATA133_6 ? 0x7f : 0x3f, 1594 .udma_mask = HPT302_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
1575 .bootable = OFF_BOARD, 1595 .bootable = OFF_BOARD,
1576 .extra = 240, 1596 .extra = 240,
1577 .pio_mask = ATA_PIO4, 1597 .pio_mask = ATA_PIO4,
@@ -1583,7 +1603,7 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
1583 .init_dma = init_dma_hpt366, 1603 .init_dma = init_dma_hpt366,
1584 .autodma = AUTODMA, 1604 .autodma = AUTODMA,
1585 .enablebits = {{0x50,0x04,0x04}, {0x54,0x04,0x04}}, 1605 .enablebits = {{0x50,0x04,0x04}, {0x54,0x04,0x04}},
1586 .udma_mask = HPT371_ALLOW_ATA133_6 ? 0x7f : 0x3f, 1606 .udma_mask = HPT371_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
1587 .bootable = OFF_BOARD, 1607 .bootable = OFF_BOARD,
1588 .extra = 240, 1608 .extra = 240,
1589 .pio_mask = ATA_PIO4, 1609 .pio_mask = ATA_PIO4,
@@ -1595,7 +1615,7 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
1595 .init_dma = init_dma_hpt366, 1615 .init_dma = init_dma_hpt366,
1596 .autodma = AUTODMA, 1616 .autodma = AUTODMA,
1597 .enablebits = {{0x50,0x04,0x04}, {0x54,0x04,0x04}}, 1617 .enablebits = {{0x50,0x04,0x04}, {0x54,0x04,0x04}},
1598 .udma_mask = 0x3f, 1618 .udma_mask = ATA_UDMA5,
1599 .bootable = OFF_BOARD, 1619 .bootable = OFF_BOARD,
1600 .extra = 240, 1620 .extra = 240,
1601 .pio_mask = ATA_PIO4, 1621 .pio_mask = ATA_PIO4,
@@ -1607,7 +1627,7 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
1607 .init_dma = init_dma_hpt366, 1627 .init_dma = init_dma_hpt366,
1608 .autodma = AUTODMA, 1628 .autodma = AUTODMA,
1609 .enablebits = {{0x50,0x04,0x04}, {0x54,0x04,0x04}}, 1629 .enablebits = {{0x50,0x04,0x04}, {0x54,0x04,0x04}},
1610 .udma_mask = HPT372_ALLOW_ATA133_6 ? 0x7f : 0x3f, 1630 .udma_mask = HPT372_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
1611 .bootable = OFF_BOARD, 1631 .bootable = OFF_BOARD,
1612 .extra = 240, 1632 .extra = 240,
1613 .pio_mask = ATA_PIO4, 1633 .pio_mask = ATA_PIO4,
diff --git a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c
index f6db2f37efad..7b0e479c355c 100644
--- a/drivers/ide/pci/pdc202xx_new.c
+++ b/drivers/ide/pci/pdc202xx_new.c
@@ -9,7 +9,7 @@
9 * Split from: 9 * Split from:
10 * linux/drivers/ide/pdc202xx.c Version 0.35 Mar. 30, 2002 10 * linux/drivers/ide/pdc202xx.c Version 0.35 Mar. 30, 2002
11 * Copyright (C) 1998-2002 Andre Hedrick <andre@linux-ide.org> 11 * Copyright (C) 1998-2002 Andre Hedrick <andre@linux-ide.org>
12 * Copyright (C) 2005-2006 MontaVista Software, Inc. 12 * Copyright (C) 2005-2007 MontaVista Software, Inc.
13 * Portions Copyright (C) 1999 Promise Technology, Inc. 13 * Portions Copyright (C) 1999 Promise Technology, Inc.
14 * Author: Frank Tiernan (frankt@promise.com) 14 * Author: Frank Tiernan (frankt@promise.com)
15 * Released under terms of General Public License 15 * Released under terms of General Public License
@@ -341,7 +341,7 @@ static long __devinit detect_pll_input_clock(unsigned long dma_base)
341 */ 341 */
342 usec_elapsed = (end_time.tv_sec - start_time.tv_sec) * 1000000 + 342 usec_elapsed = (end_time.tv_sec - start_time.tv_sec) * 1000000 +
343 (end_time.tv_usec - start_time.tv_usec); 343 (end_time.tv_usec - start_time.tv_usec);
344 pll_input = ((start_count - end_count) & 0x3ffffff) / 10 * 344 pll_input = ((start_count - end_count) & 0x3fffffff) / 10 *
345 (10000000 / usec_elapsed); 345 (10000000 / usec_elapsed);
346 346
347 DBG("start[%ld] end[%ld]\n", start_count, end_count); 347 DBG("start[%ld] end[%ld]\n", start_count, end_count);
@@ -535,7 +535,7 @@ static int __devinit init_setup_pdc20270(struct pci_dev *dev,
535 (dev->bus->self->device == PCI_DEVICE_ID_DEC_21150)) { 535 (dev->bus->self->device == PCI_DEVICE_ID_DEC_21150)) {
536 if (PCI_SLOT(dev->devfn) & 2) 536 if (PCI_SLOT(dev->devfn) & 2)
537 return -ENODEV; 537 return -ENODEV;
538 d->extra = 0; 538
539 while ((findev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, findev)) != NULL) { 539 while ((findev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, findev)) != NULL) {
540 if ((findev->vendor == dev->vendor) && 540 if ((findev->vendor == dev->vendor) &&
541 (findev->device == dev->device) && 541 (findev->device == dev->device) &&
@@ -544,7 +544,8 @@ static int __devinit init_setup_pdc20270(struct pci_dev *dev,
544 findev->irq = dev->irq; 544 findev->irq = dev->irq;
545 } 545 }
546 ret = ide_setup_pci_devices(dev, findev, d); 546 ret = ide_setup_pci_devices(dev, findev, d);
547 pci_dev_put(findev); 547 if (ret < 0)
548 pci_dev_put(findev);
548 return ret; 549 return ret;
549 } 550 }
550 } 551 }
diff --git a/drivers/ide/pci/via82cxxx.c b/drivers/ide/pci/via82cxxx.c
index 8c539381d622..a7be7795e6af 100644
--- a/drivers/ide/pci/via82cxxx.c
+++ b/drivers/ide/pci/via82cxxx.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * 2 *
3 * Version 3.46 3 * Version 3.47
4 * 4 *
5 * VIA IDE driver for Linux. Supported southbridges: 5 * VIA IDE driver for Linux. Supported southbridges:
6 * 6 *
@@ -430,19 +430,26 @@ static struct dmi_system_id cable_dmi_table[] = {
430 { } 430 { }
431}; 431};
432 432
433static int via_cable_override(void) 433static int via_cable_override(struct pci_dev *pdev)
434{ 434{
435 /* Systems by DMI */ 435 /* Systems by DMI */
436 if (dmi_check_system(cable_dmi_table)) 436 if (dmi_check_system(cable_dmi_table))
437 return 1; 437 return 1;
438
439 /* Arima W730-K8/Targa Visionary 811/... */
440 if (pdev->subsystem_vendor == 0x161F &&
441 pdev->subsystem_device == 0x2032)
442 return 1;
443
438 return 0; 444 return 0;
439} 445}
440 446
441static u8 __devinit via82cxxx_cable_detect(ide_hwif_t *hwif) 447static u8 __devinit via82cxxx_cable_detect(ide_hwif_t *hwif)
442{ 448{
443 struct via82cxxx_dev *vdev = pci_get_drvdata(hwif->pci_dev); 449 struct pci_dev *pdev = hwif->pci_dev;
450 struct via82cxxx_dev *vdev = pci_get_drvdata(pdev);
444 451
445 if (via_cable_override()) 452 if (via_cable_override(pdev))
446 return ATA_CBL_PATA40_SHORT; 453 return ATA_CBL_PATA40_SHORT;
447 454
448 if ((vdev->via_80w >> hwif->channel) & 1) 455 if ((vdev->via_80w >> hwif->channel) & 1)
diff --git a/drivers/ide/ppc/mpc8xx.c b/drivers/ide/ppc/mpc8xx.c
index 8859fe2f5ac2..dab79afa9b22 100644
--- a/drivers/ide/ppc/mpc8xx.c
+++ b/drivers/ide/ppc/mpc8xx.c
@@ -32,7 +32,6 @@
32#include <asm/mpc8xx.h> 32#include <asm/mpc8xx.h>
33#include <asm/mmu.h> 33#include <asm/mmu.h>
34#include <asm/processor.h> 34#include <asm/processor.h>
35#include <asm/residual.h>
36#include <asm/io.h> 35#include <asm/io.h>
37#include <asm/pgtable.h> 36#include <asm/pgtable.h>
38#include <asm/ide.h> 37#include <asm/ide.h>
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c
index 30e596c0f120..1129f8c30840 100644
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -816,19 +816,15 @@ static int __init ide_scan_pcidev(struct pci_dev *dev)
816 struct list_head *l; 816 struct list_head *l;
817 struct pci_driver *d; 817 struct pci_driver *d;
818 818
819 list_for_each(l, &ide_pci_drivers) 819 list_for_each(l, &ide_pci_drivers) {
820 {
821 d = list_entry(l, struct pci_driver, node); 820 d = list_entry(l, struct pci_driver, node);
822 if(d->id_table) 821 if (d->id_table) {
823 { 822 const struct pci_device_id *id = pci_match_id(d->id_table,
824 const struct pci_device_id *id = pci_match_id(d->id_table, dev); 823 dev);
825 if(id != NULL) 824 if (id != NULL && d->probe(dev, id) >= 0) {
826 { 825 dev->driver = d;
827 if(d->probe(dev, id) >= 0) 826 pci_dev_get(dev);
828 { 827 return 1;
829 dev->driver = d;
830 return 1;
831 }
832 } 828 }
833 } 829 }
834 } 830 }
@@ -851,15 +847,13 @@ void __init ide_scan_pcibus (int scan_direction)
851 struct list_head *l, *n; 847 struct list_head *l, *n;
852 848
853 pre_init = 0; 849 pre_init = 0;
854 if (!scan_direction) { 850 if (!scan_direction)
855 while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { 851 while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL)
856 ide_scan_pcidev(dev); 852 ide_scan_pcidev(dev);
857 } 853 else
858 } else { 854 while ((dev = pci_get_device_reverse(PCI_ANY_ID, PCI_ANY_ID, dev))
859 while ((dev = pci_get_device_reverse(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { 855 != NULL)
860 ide_scan_pcidev(dev); 856 ide_scan_pcidev(dev);
861 }
862 }
863 857
864 /* 858 /*
865 * Hand the drivers over to the PCI layer now we 859 * Hand the drivers over to the PCI layer now we
@@ -869,12 +863,9 @@ void __init ide_scan_pcibus (int scan_direction)
869 list_for_each_safe(l, n, &ide_pci_drivers) { 863 list_for_each_safe(l, n, &ide_pci_drivers) {
870 list_del(l); 864 list_del(l);
871 d = list_entry(l, struct pci_driver, node); 865 d = list_entry(l, struct pci_driver, node);
872 if (__pci_register_driver(d, d->driver.owner, 866 if (__pci_register_driver(d, d->driver.owner, d->driver.mod_name))
873 d->driver.mod_name)) { 867 printk(KERN_ERR "%s: failed to register driver for %s\n",
874 printk(KERN_ERR "%s: failed to register driver " 868 __FUNCTION__, d->driver.mod_name);
875 "for %s\n", __FUNCTION__,
876 d->driver.mod_name);
877 }
878 } 869 }
879} 870}
880#endif 871#endif
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
index 702a526cf45b..f8fe42148093 100644
--- a/drivers/input/serio/i8042-x86ia64io.h
+++ b/drivers/input/serio/i8042-x86ia64io.h
@@ -211,6 +211,16 @@ static struct dmi_system_id __initdata i8042_dmi_nomux_table[] = {
211 }, 211 },
212 }, 212 },
213 { 213 {
214 /*
215 * Like DV4017EA does not raise AUXERR for errors on MUX ports.
216 */
217 .ident = "HP Pavilion DV4270ca",
218 .matches = {
219 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
220 DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EH476UA#ABL)"),
221 },
222 },
223 {
214 .ident = "Toshiba P10", 224 .ident = "Toshiba P10",
215 .matches = { 225 .matches = {
216 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), 226 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index 06b05dd22485..c2eea2767e10 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -1040,7 +1040,7 @@ static void __devinit i8042_register_ports(void)
1040 } 1040 }
1041} 1041}
1042 1042
1043static void __devinit i8042_unregister_ports(void) 1043static void __devexit i8042_unregister_ports(void)
1044{ 1044{
1045 int i; 1045 int i;
1046 1046
diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c
index b407028ffc59..741f6c6f1e50 100644
--- a/drivers/input/touchscreen/usbtouchscreen.c
+++ b/drivers/input/touchscreen/usbtouchscreen.c
@@ -767,7 +767,7 @@ static int usbtouch_probe(struct usb_interface *intf,
767 le16_to_cpu(udev->descriptor.idProduct)); 767 le16_to_cpu(udev->descriptor.idProduct));
768 768
769 usb_make_path(udev, usbtouch->phys, sizeof(usbtouch->phys)); 769 usb_make_path(udev, usbtouch->phys, sizeof(usbtouch->phys));
770 strlcpy(usbtouch->phys, "/input0", sizeof(usbtouch->phys)); 770 strlcat(usbtouch->phys, "/input0", sizeof(usbtouch->phys));
771 771
772 input_dev->name = usbtouch->name; 772 input_dev->name = usbtouch->name;
773 input_dev->phys = usbtouch->phys; 773 input_dev->phys = usbtouch->phys;
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index 3ac9cbce3369..336be86c6f5a 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -619,7 +619,7 @@ unsigned long segment_base(u16 selector);
619void kvm_mmu_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa, 619void kvm_mmu_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa,
620 const u8 *old, const u8 *new, int bytes); 620 const u8 *old, const u8 *new, int bytes);
621int kvm_mmu_unprotect_page_virt(struct kvm_vcpu *vcpu, gva_t gva); 621int kvm_mmu_unprotect_page_virt(struct kvm_vcpu *vcpu, gva_t gva);
622void kvm_mmu_free_some_pages(struct kvm_vcpu *vcpu); 622void __kvm_mmu_free_some_pages(struct kvm_vcpu *vcpu);
623int kvm_mmu_load(struct kvm_vcpu *vcpu); 623int kvm_mmu_load(struct kvm_vcpu *vcpu);
624void kvm_mmu_unload(struct kvm_vcpu *vcpu); 624void kvm_mmu_unload(struct kvm_vcpu *vcpu);
625 625
@@ -628,11 +628,15 @@ int kvm_hypercall(struct kvm_vcpu *vcpu, struct kvm_run *run);
628static inline int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t gva, 628static inline int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t gva,
629 u32 error_code) 629 u32 error_code)
630{ 630{
631 if (unlikely(vcpu->kvm->n_free_mmu_pages < KVM_MIN_FREE_MMU_PAGES))
632 kvm_mmu_free_some_pages(vcpu);
633 return vcpu->mmu.page_fault(vcpu, gva, error_code); 631 return vcpu->mmu.page_fault(vcpu, gva, error_code);
634} 632}
635 633
634static inline void kvm_mmu_free_some_pages(struct kvm_vcpu *vcpu)
635{
636 if (unlikely(vcpu->kvm->n_free_mmu_pages < KVM_MIN_FREE_MMU_PAGES))
637 __kvm_mmu_free_some_pages(vcpu);
638}
639
636static inline int kvm_mmu_reload(struct kvm_vcpu *vcpu) 640static inline int kvm_mmu_reload(struct kvm_vcpu *vcpu)
637{ 641{
638 if (likely(vcpu->mmu.root_hpa != INVALID_PAGE)) 642 if (likely(vcpu->mmu.root_hpa != INVALID_PAGE))
diff --git a/drivers/kvm/mmu.c b/drivers/kvm/mmu.c
index 1a87ba9d5156..23965aa5ee78 100644
--- a/drivers/kvm/mmu.c
+++ b/drivers/kvm/mmu.c
@@ -273,12 +273,14 @@ static int mmu_topup_memory_caches(struct kvm_vcpu *vcpu)
273 int r; 273 int r;
274 274
275 r = __mmu_topup_memory_caches(vcpu, GFP_NOWAIT); 275 r = __mmu_topup_memory_caches(vcpu, GFP_NOWAIT);
276 kvm_mmu_free_some_pages(vcpu);
276 if (r < 0) { 277 if (r < 0) {
277 spin_unlock(&vcpu->kvm->lock); 278 spin_unlock(&vcpu->kvm->lock);
278 kvm_arch_ops->vcpu_put(vcpu); 279 kvm_arch_ops->vcpu_put(vcpu);
279 r = __mmu_topup_memory_caches(vcpu, GFP_KERNEL); 280 r = __mmu_topup_memory_caches(vcpu, GFP_KERNEL);
280 kvm_arch_ops->vcpu_load(vcpu); 281 kvm_arch_ops->vcpu_load(vcpu);
281 spin_lock(&vcpu->kvm->lock); 282 spin_lock(&vcpu->kvm->lock);
283 kvm_mmu_free_some_pages(vcpu);
282 } 284 }
283 return r; 285 return r;
284} 286}
@@ -1208,7 +1210,7 @@ int kvm_mmu_unprotect_page_virt(struct kvm_vcpu *vcpu, gva_t gva)
1208 return kvm_mmu_unprotect_page(vcpu, gpa >> PAGE_SHIFT); 1210 return kvm_mmu_unprotect_page(vcpu, gpa >> PAGE_SHIFT);
1209} 1211}
1210 1212
1211void kvm_mmu_free_some_pages(struct kvm_vcpu *vcpu) 1213void __kvm_mmu_free_some_pages(struct kvm_vcpu *vcpu)
1212{ 1214{
1213 while (vcpu->kvm->n_free_mmu_pages < KVM_REFILL_PAGES) { 1215 while (vcpu->kvm->n_free_mmu_pages < KVM_REFILL_PAGES) {
1214 struct kvm_mmu_page *page; 1216 struct kvm_mmu_page *page;
@@ -1218,7 +1220,6 @@ void kvm_mmu_free_some_pages(struct kvm_vcpu *vcpu)
1218 kvm_mmu_zap_page(vcpu->kvm, page); 1220 kvm_mmu_zap_page(vcpu->kvm, page);
1219 } 1221 }
1220} 1222}
1221EXPORT_SYMBOL_GPL(kvm_mmu_free_some_pages);
1222 1223
1223static void free_mmu_pages(struct kvm_vcpu *vcpu) 1224static void free_mmu_pages(struct kvm_vcpu *vcpu)
1224{ 1225{
diff --git a/drivers/lguest/lguest.c b/drivers/lguest/lguest.c
index 6e135ac0834f..ee1c6d05c3d3 100644
--- a/drivers/lguest/lguest.c
+++ b/drivers/lguest/lguest.c
@@ -964,11 +964,12 @@ __init void lguest_init(void *boot)
964{ 964{
965 /* Copy boot parameters first: the Launcher put the physical location 965 /* Copy boot parameters first: the Launcher put the physical location
966 * in %esi, and head.S converted that to a virtual address and handed 966 * in %esi, and head.S converted that to a virtual address and handed
967 * it to us. */ 967 * it to us. We use "__memcpy" because "memcpy" sometimes tries to do
968 memcpy(&boot_params, boot, PARAM_SIZE); 968 * tricky things to go faster, and we're not ready for that. */
969 __memcpy(&boot_params, boot, PARAM_SIZE);
969 /* The boot parameters also tell us where the command-line is: save 970 /* The boot parameters also tell us where the command-line is: save
970 * that, too. */ 971 * that, too. */
971 memcpy(boot_command_line, __va(boot_params.hdr.cmd_line_ptr), 972 __memcpy(boot_command_line, __va(boot_params.hdr.cmd_line_ptr),
972 COMMAND_LINE_SIZE); 973 COMMAND_LINE_SIZE);
973 974
974 /* We're under lguest, paravirt is enabled, and we're running at 975 /* We're under lguest, paravirt is enabled, and we're running at
diff --git a/drivers/md/dm-bio-list.h b/drivers/md/dm-bio-list.h
index 16ee3b018b3a..3f7b827649e3 100644
--- a/drivers/md/dm-bio-list.h
+++ b/drivers/md/dm-bio-list.h
@@ -9,6 +9,8 @@
9 9
10#include <linux/bio.h> 10#include <linux/bio.h>
11 11
12#ifdef CONFIG_BLOCK
13
12struct bio_list { 14struct bio_list {
13 struct bio *head; 15 struct bio *head;
14 struct bio *tail; 16 struct bio *tail;
@@ -106,4 +108,5 @@ static inline struct bio *bio_list_get(struct bio_list *bl)
106 return bio; 108 return bio;
107} 109}
108 110
111#endif /* CONFIG_BLOCK */
109#endif 112#endif
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 2aff4be35dc4..4d63773ee73a 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -2541,7 +2541,7 @@ static void handle_stripe_expansion(raid5_conf_t *conf, struct stripe_head *sh,
2541 struct dma_async_tx_descriptor *tx = NULL; 2541 struct dma_async_tx_descriptor *tx = NULL;
2542 clear_bit(STRIPE_EXPAND_SOURCE, &sh->state); 2542 clear_bit(STRIPE_EXPAND_SOURCE, &sh->state);
2543 for (i = 0; i < sh->disks; i++) 2543 for (i = 0; i < sh->disks; i++)
2544 if (i != sh->pd_idx && (r6s && i != r6s->qd_idx)) { 2544 if (i != sh->pd_idx && (!r6s || i != r6s->qd_idx)) {
2545 int dd_idx, pd_idx, j; 2545 int dd_idx, pd_idx, j;
2546 struct stripe_head *sh2; 2546 struct stripe_head *sh2;
2547 2547
@@ -2574,7 +2574,8 @@ static void handle_stripe_expansion(raid5_conf_t *conf, struct stripe_head *sh,
2574 set_bit(R5_UPTODATE, &sh2->dev[dd_idx].flags); 2574 set_bit(R5_UPTODATE, &sh2->dev[dd_idx].flags);
2575 for (j = 0; j < conf->raid_disks; j++) 2575 for (j = 0; j < conf->raid_disks; j++)
2576 if (j != sh2->pd_idx && 2576 if (j != sh2->pd_idx &&
2577 (r6s && j != r6s->qd_idx) && 2577 (!r6s || j != raid6_next_disk(sh2->pd_idx,
2578 sh2->disks)) &&
2578 !test_bit(R5_Expanded, &sh2->dev[j].flags)) 2579 !test_bit(R5_Expanded, &sh2->dev[j].flags))
2579 break; 2580 break;
2580 if (j == conf->raid_disks) { 2581 if (j == conf->raid_disks) {
@@ -2583,12 +2584,12 @@ static void handle_stripe_expansion(raid5_conf_t *conf, struct stripe_head *sh,
2583 } 2584 }
2584 release_stripe(sh2); 2585 release_stripe(sh2);
2585 2586
2586 /* done submitting copies, wait for them to complete */
2587 if (i + 1 >= sh->disks) {
2588 async_tx_ack(tx);
2589 dma_wait_for_async_tx(tx);
2590 }
2591 } 2587 }
2588 /* done submitting copies, wait for them to complete */
2589 if (tx) {
2590 async_tx_ack(tx);
2591 dma_wait_for_async_tx(tx);
2592 }
2592} 2593}
2593 2594
2594/* 2595/*
@@ -2855,7 +2856,7 @@ static void handle_stripe5(struct stripe_head *sh)
2855 sh->disks = conf->raid_disks; 2856 sh->disks = conf->raid_disks;
2856 sh->pd_idx = stripe_to_pdidx(sh->sector, conf, 2857 sh->pd_idx = stripe_to_pdidx(sh->sector, conf,
2857 conf->raid_disks); 2858 conf->raid_disks);
2858 s.locked += handle_write_operations5(sh, 0, 1); 2859 s.locked += handle_write_operations5(sh, 1, 1);
2859 } else if (s.expanded && 2860 } else if (s.expanded &&
2860 !test_bit(STRIPE_OP_POSTXOR, &sh->ops.pending)) { 2861 !test_bit(STRIPE_OP_POSTXOR, &sh->ops.pending)) {
2861 clear_bit(STRIPE_EXPAND_READY, &sh->state); 2862 clear_bit(STRIPE_EXPAND_READY, &sh->state);
diff --git a/drivers/media/video/cx88/cx88-mpeg.c b/drivers/media/video/cx88/cx88-mpeg.c
index 317a2a3f9cc1..da7a6b591a67 100644
--- a/drivers/media/video/cx88/cx88-mpeg.c
+++ b/drivers/media/video/cx88/cx88-mpeg.c
@@ -580,7 +580,7 @@ struct cx8802_dev * cx8802_get_device(struct inode *inode)
580 580
581 list_for_each(list,&cx8802_devlist) { 581 list_for_each(list,&cx8802_devlist) {
582 h = list_entry(list, struct cx8802_dev, devlist); 582 h = list_entry(list, struct cx8802_dev, devlist);
583 if (h->mpeg_dev->minor == minor) 583 if (h->mpeg_dev && h->mpeg_dev->minor == minor)
584 return h; 584 return h;
585 } 585 }
586 586
diff --git a/drivers/media/video/ivtv/ivtv-fileops.c b/drivers/media/video/ivtv/ivtv-fileops.c
index 5dd519caf81d..0285c4a830eb 100644
--- a/drivers/media/video/ivtv/ivtv-fileops.c
+++ b/drivers/media/video/ivtv/ivtv-fileops.c
@@ -190,7 +190,9 @@ static void ivtv_update_pgm_info(struct ivtv *itv)
190 int idx = (itv->pgm_info_write_idx + i) % itv->pgm_info_num; 190 int idx = (itv->pgm_info_write_idx + i) % itv->pgm_info_num;
191 struct v4l2_enc_idx_entry *e = itv->pgm_info + idx; 191 struct v4l2_enc_idx_entry *e = itv->pgm_info + idx;
192 u32 addr = itv->pgm_info_offset + 4 + idx * 24; 192 u32 addr = itv->pgm_info_offset + 4 + idx * 24;
193 const int mapping[] = { V4L2_ENC_IDX_FRAME_P, V4L2_ENC_IDX_FRAME_I, V4L2_ENC_IDX_FRAME_B, 0 }; 193 const int mapping[8] = { -1, V4L2_ENC_IDX_FRAME_I, V4L2_ENC_IDX_FRAME_P, -1,
194 V4L2_ENC_IDX_FRAME_B, -1, -1, -1 };
195 // 1=I, 2=P, 4=B
194 196
195 e->offset = read_enc(addr + 4) + ((u64)read_enc(addr + 8) << 32); 197 e->offset = read_enc(addr + 4) + ((u64)read_enc(addr + 8) << 32);
196 if (e->offset > itv->mpg_data_received) { 198 if (e->offset > itv->mpg_data_received) {
@@ -199,7 +201,7 @@ static void ivtv_update_pgm_info(struct ivtv *itv)
199 e->offset += itv->vbi_data_inserted; 201 e->offset += itv->vbi_data_inserted;
200 e->length = read_enc(addr); 202 e->length = read_enc(addr);
201 e->pts = read_enc(addr + 16) + ((u64)(read_enc(addr + 20) & 1) << 32); 203 e->pts = read_enc(addr + 16) + ((u64)(read_enc(addr + 20) & 1) << 32);
202 e->flags = mapping[read_enc(addr + 12) & 3]; 204 e->flags = mapping[read_enc(addr + 12) & 7];
203 i++; 205 i++;
204 } 206 }
205 itv->pgm_info_write_idx = (itv->pgm_info_write_idx + i) % itv->pgm_info_num; 207 itv->pgm_info_write_idx = (itv->pgm_info_write_idx + i) % itv->pgm_info_num;
diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c b/drivers/media/video/ivtv/ivtv-ioctl.c
index 5977a79619c2..dfe0aedc60fd 100644
--- a/drivers/media/video/ivtv/ivtv-ioctl.c
+++ b/drivers/media/video/ivtv/ivtv-ioctl.c
@@ -1099,14 +1099,21 @@ int ivtv_v4l2_ioctls(struct ivtv *itv, struct file *filp, unsigned int cmd, void
1099 1099
1100 case VIDIOC_G_ENC_INDEX: { 1100 case VIDIOC_G_ENC_INDEX: {
1101 struct v4l2_enc_idx *idx = arg; 1101 struct v4l2_enc_idx *idx = arg;
1102 struct v4l2_enc_idx_entry *e = idx->entry;
1103 int entries;
1102 int i; 1104 int i;
1103 1105
1104 idx->entries = (itv->pgm_info_write_idx + IVTV_MAX_PGM_INDEX - itv->pgm_info_read_idx) % 1106 entries = (itv->pgm_info_write_idx + IVTV_MAX_PGM_INDEX - itv->pgm_info_read_idx) %
1105 IVTV_MAX_PGM_INDEX; 1107 IVTV_MAX_PGM_INDEX;
1106 if (idx->entries > V4L2_ENC_IDX_ENTRIES) 1108 if (entries > V4L2_ENC_IDX_ENTRIES)
1107 idx->entries = V4L2_ENC_IDX_ENTRIES; 1109 entries = V4L2_ENC_IDX_ENTRIES;
1108 for (i = 0; i < idx->entries; i++) { 1110 idx->entries = 0;
1109 idx->entry[i] = itv->pgm_info[(itv->pgm_info_read_idx + i) % IVTV_MAX_PGM_INDEX]; 1111 for (i = 0; i < entries; i++) {
1112 *e = itv->pgm_info[(itv->pgm_info_read_idx + i) % IVTV_MAX_PGM_INDEX];
1113 if ((e->flags & V4L2_ENC_IDX_FRAME_MASK) <= V4L2_ENC_IDX_FRAME_B) {
1114 idx->entries++;
1115 e++;
1116 }
1110 } 1117 }
1111 itv->pgm_info_read_idx = (itv->pgm_info_read_idx + idx->entries) % IVTV_MAX_PGM_INDEX; 1118 itv->pgm_info_read_idx = (itv->pgm_info_read_idx + idx->entries) % IVTV_MAX_PGM_INDEX;
1112 break; 1119 break;
diff --git a/drivers/media/video/pwc/pwc-if.c b/drivers/media/video/pwc/pwc-if.c
index 3d81966d8c42..931b274bffca 100644
--- a/drivers/media/video/pwc/pwc-if.c
+++ b/drivers/media/video/pwc/pwc-if.c
@@ -1243,7 +1243,7 @@ static int pwc_video_close(struct inode *inode, struct file *file)
1243 PWC_ERROR("Failed to power down camera (%d)\n", i); 1243 PWC_ERROR("Failed to power down camera (%d)\n", i);
1244 } 1244 }
1245 pdev->vopen--; 1245 pdev->vopen--;
1246 PWC_DEBUG_OPEN("<< video_close() vopen=%d\n", i); 1246 PWC_DEBUG_OPEN("<< video_close() vopen=%d\n", pdev->vopen);
1247 } else { 1247 } else {
1248 pwc_cleanup(pdev); 1248 pwc_cleanup(pdev);
1249 /* Free memory (don't set pdev to 0 just yet) */ 1249 /* Free memory (don't set pdev to 0 just yet) */
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c
index 8ec83bd70094..25ec16810818 100644
--- a/drivers/media/video/saa7134/saa7134-cards.c
+++ b/drivers/media/video/saa7134/saa7134-cards.c
@@ -1537,18 +1537,18 @@ struct saa7134_board saa7134_boards[] = {
1537 },{ 1537 },{
1538 .name = name_comp1, 1538 .name = name_comp1,
1539 .vmux = 0, 1539 .vmux = 0,
1540 .amux = LINE2, 1540 .amux = LINE1,
1541 .gpio = 0x00, 1541 .gpio = 0x02,
1542 },{ 1542 },{
1543 .name = name_comp2, 1543 .name = name_comp2,
1544 .vmux = 3, 1544 .vmux = 3,
1545 .amux = LINE2, 1545 .amux = LINE1,
1546 .gpio = 0x00, 1546 .gpio = 0x02,
1547 },{ 1547 },{
1548 .name = name_svideo, 1548 .name = name_svideo,
1549 .vmux = 8, 1549 .vmux = 8,
1550 .amux = LINE2, 1550 .amux = LINE1,
1551 .gpio = 0x00, 1551 .gpio = 0x02,
1552 }}, 1552 }},
1553 .radio = { 1553 .radio = {
1554 .name = name_radio, 1554 .name = name_radio,
diff --git a/drivers/media/video/saa7191.c b/drivers/media/video/saa7191.c
index 8615a6081a5d..b4018cce3285 100644
--- a/drivers/media/video/saa7191.c
+++ b/drivers/media/video/saa7191.c
@@ -130,7 +130,7 @@ static int saa7191_write_reg(struct i2c_client *client, u8 reg,
130 130
131/* the first byte of data must be the first subaddress number (register) */ 131/* the first byte of data must be the first subaddress number (register) */
132static int saa7191_write_block(struct i2c_client *client, 132static int saa7191_write_block(struct i2c_client *client,
133 u8 length, u8 *data) 133 u8 length, const u8 *data)
134{ 134{
135 int i; 135 int i;
136 int ret; 136 int ret;
@@ -592,7 +592,7 @@ static int saa7191_attach(struct i2c_adapter *adap, int addr, int kind)
592 if (err) 592 if (err)
593 goto out_free_decoder; 593 goto out_free_decoder;
594 594
595 err = saa7191_write_block(client, sizeof(initseq), (u8 *)initseq); 595 err = saa7191_write_block(client, sizeof(initseq), initseq);
596 if (err) { 596 if (err) {
597 printk(KERN_ERR "SAA7191 initialization failed\n"); 597 printk(KERN_ERR "SAA7191 initialization failed\n");
598 goto out_detach_client; 598 goto out_detach_client;
diff --git a/drivers/mmc/host/at91_mci.c b/drivers/mmc/host/at91_mci.c
index bfebd2fa7ada..955ea60583b5 100644
--- a/drivers/mmc/host/at91_mci.c
+++ b/drivers/mmc/host/at91_mci.c
@@ -941,7 +941,7 @@ static int __exit at91_mci_remove(struct platform_device *pdev)
941 941
942 host = mmc_priv(mmc); 942 host = mmc_priv(mmc);
943 943
944 if (host->present != -1) { 944 if (host->board->det_pin) {
945 device_init_wakeup(&pdev->dev, 0); 945 device_init_wakeup(&pdev->dev, 0);
946 free_irq(host->board->det_pin, host); 946 free_irq(host->board->det_pin, host);
947 cancel_delayed_work(&host->mmc->detect); 947 cancel_delayed_work(&host->mmc->detect);
@@ -972,7 +972,7 @@ static int at91_mci_suspend(struct platform_device *pdev, pm_message_t state)
972 struct at91mci_host *host = mmc_priv(mmc); 972 struct at91mci_host *host = mmc_priv(mmc);
973 int ret = 0; 973 int ret = 0;
974 974
975 if (device_may_wakeup(&pdev->dev)) 975 if (host->board->det_pin && device_may_wakeup(&pdev->dev))
976 enable_irq_wake(host->board->det_pin); 976 enable_irq_wake(host->board->det_pin);
977 977
978 if (mmc) 978 if (mmc)
@@ -987,7 +987,7 @@ static int at91_mci_resume(struct platform_device *pdev)
987 struct at91mci_host *host = mmc_priv(mmc); 987 struct at91mci_host *host = mmc_priv(mmc);
988 int ret = 0; 988 int ret = 0;
989 989
990 if (device_may_wakeup(&pdev->dev)) 990 if (host->board->det_pin && device_may_wakeup(&pdev->dev))
991 disable_irq_wake(host->board->det_pin); 991 disable_irq_wake(host->board->det_pin);
992 992
993 if (mmc) 993 if (mmc)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 58740428dd07..9034a05734ef 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -64,8 +64,8 @@
64 64
65#define DRV_MODULE_NAME "tg3" 65#define DRV_MODULE_NAME "tg3"
66#define PFX DRV_MODULE_NAME ": " 66#define PFX DRV_MODULE_NAME ": "
67#define DRV_MODULE_VERSION "3.80" 67#define DRV_MODULE_VERSION "3.81"
68#define DRV_MODULE_RELDATE "August 2, 2007" 68#define DRV_MODULE_RELDATE "September 5, 2007"
69 69
70#define TG3_DEF_MAC_MODE 0 70#define TG3_DEF_MAC_MODE 0
71#define TG3_DEF_RX_MODE 0 71#define TG3_DEF_RX_MODE 0
@@ -7127,6 +7127,10 @@ static int tg3_open(struct net_device *dev)
7127 } else if (pci_enable_msi(tp->pdev) == 0) { 7127 } else if (pci_enable_msi(tp->pdev) == 0) {
7128 u32 msi_mode; 7128 u32 msi_mode;
7129 7129
7130 /* Hardware bug - MSI won't work if INTX disabled. */
7131 if (tp->tg3_flags2 & TG3_FLG2_5780_CLASS)
7132 pci_intx(tp->pdev, 1);
7133
7130 msi_mode = tr32(MSGINT_MODE); 7134 msi_mode = tr32(MSGINT_MODE);
7131 tw32(MSGINT_MODE, msi_mode | MSGINT_MODE_ENABLE); 7135 tw32(MSGINT_MODE, msi_mode | MSGINT_MODE_ENABLE);
7132 tp->tg3_flags2 |= TG3_FLG2_USING_MSI; 7136 tp->tg3_flags2 |= TG3_FLG2_USING_MSI;
@@ -12172,6 +12176,11 @@ static int tg3_resume(struct pci_dev *pdev)
12172 if (err) 12176 if (err)
12173 return err; 12177 return err;
12174 12178
12179 /* Hardware bug - MSI won't work if INTX disabled. */
12180 if ((tp->tg3_flags2 & TG3_FLG2_5780_CLASS) &&
12181 (tp->tg3_flags2 & TG3_FLG2_USING_MSI))
12182 pci_intx(tp->pdev, 1);
12183
12175 netif_device_attach(dev); 12184 netif_device_attach(dev);
12176 12185
12177 tg3_full_lock(tp, 0); 12186 tg3_full_lock(tp, 0);
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 27e00b2d7b5b..171ca712e523 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -285,7 +285,7 @@ static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom)
285 } 285 }
286} 286}
287 287
288void __devinit pci_read_bridge_bases(struct pci_bus *child) 288void pci_read_bridge_bases(struct pci_bus *child)
289{ 289{
290 struct pci_dev *dev = child->self; 290 struct pci_dev *dev = child->self;
291 u8 io_base_lo, io_limit_lo; 291 u8 io_base_lo, io_limit_lo;
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 2d40f437b9fc..7dcaa09b3c20 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -972,8 +972,8 @@ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237, k8t_sound_ho
972 * 972 *
973 * The SMBus PCI Device can be activated by setting a bit in the ICH LPC 973 * The SMBus PCI Device can be activated by setting a bit in the ICH LPC
974 * bridge. Unfortunately, this device has no subvendor/subdevice ID. So it 974 * bridge. Unfortunately, this device has no subvendor/subdevice ID. So it
975 * becomes necessary to do this tweak in two steps -- I've chosen the Host 975 * becomes necessary to do this tweak in two steps -- the chosen trigger
976 * bridge as trigger. 976 * is either the Host bridge (preferred) or on-board VGA controller.
977 * 977 *
978 * Note that we used to unhide the SMBus that way on Toshiba laptops 978 * Note that we used to unhide the SMBus that way on Toshiba laptops
979 * (Satellite A40 and Tecra M2) but then found that the thermal management 979 * (Satellite A40 and Tecra M2) but then found that the thermal management
@@ -1070,6 +1070,14 @@ static void __init asus_hides_smbus_hostbridge(struct pci_dev *dev)
1070 case 0x0058: /* Compaq Evo N620c */ 1070 case 0x0058: /* Compaq Evo N620c */
1071 asus_hides_smbus = 1; 1071 asus_hides_smbus = 1;
1072 } 1072 }
1073 else if (dev->device == PCI_DEVICE_ID_INTEL_82810_IG3)
1074 switch(dev->subsystem_device) {
1075 case 0xB16C: /* Compaq Deskpro EP 401963-001 (PCA# 010174) */
1076 /* Motherboard doesn't have Host bridge
1077 * subvendor/subdevice IDs, therefore checking
1078 * its on-board VGA controller */
1079 asus_hides_smbus = 1;
1080 }
1073 } 1081 }
1074} 1082}
1075DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82845_HB, asus_hides_smbus_hostbridge ); 1083DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82845_HB, asus_hides_smbus_hostbridge );
@@ -1082,6 +1090,8 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82855PM_HB, as
1082DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82855GM_HB, asus_hides_smbus_hostbridge ); 1090DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82855GM_HB, asus_hides_smbus_hostbridge );
1083DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82915GM_HB, asus_hides_smbus_hostbridge ); 1091DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82915GM_HB, asus_hides_smbus_hostbridge );
1084 1092
1093DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82810_IG3, asus_hides_smbus_hostbridge );
1094
1085static void asus_hides_smbus_lpc(struct pci_dev *dev) 1095static void asus_hides_smbus_lpc(struct pci_dev *dev)
1086{ 1096{
1087 u16 val; 1097 u16 val;
@@ -1099,12 +1109,14 @@ static void asus_hides_smbus_lpc(struct pci_dev *dev)
1099 printk(KERN_INFO "PCI: Enabled i801 SMBus device\n"); 1109 printk(KERN_INFO "PCI: Enabled i801 SMBus device\n");
1100 } 1110 }
1101} 1111}
1112DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AA_0, asus_hides_smbus_lpc );
1102DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_0, asus_hides_smbus_lpc ); 1113DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_0, asus_hides_smbus_lpc );
1103DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_0, asus_hides_smbus_lpc ); 1114DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_0, asus_hides_smbus_lpc );
1104DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_0, asus_hides_smbus_lpc ); 1115DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_0, asus_hides_smbus_lpc );
1105DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_12, asus_hides_smbus_lpc ); 1116DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_12, asus_hides_smbus_lpc );
1106DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_12, asus_hides_smbus_lpc ); 1117DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_12, asus_hides_smbus_lpc );
1107DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0, asus_hides_smbus_lpc ); 1118DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0, asus_hides_smbus_lpc );
1119DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AA_0, asus_hides_smbus_lpc );
1108DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_0, asus_hides_smbus_lpc ); 1120DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_0, asus_hides_smbus_lpc );
1109DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_0, asus_hides_smbus_lpc ); 1121DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_0, asus_hides_smbus_lpc );
1110DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_0, asus_hides_smbus_lpc ); 1122DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_0, asus_hides_smbus_lpc );
diff --git a/drivers/pnp/quirks.c b/drivers/pnp/quirks.c
index 90755d4cdb9f..6b0cf0c2a088 100644
--- a/drivers/pnp/quirks.c
+++ b/drivers/pnp/quirks.c
@@ -107,108 +107,6 @@ static void quirk_sb16audio_resources(struct pnp_dev *dev)
107 "pnp: SB audio device quirk - increasing port range\n"); 107 "pnp: SB audio device quirk - increasing port range\n");
108} 108}
109 109
110static int quirk_smc_fir_enabled(struct pnp_dev *dev)
111{
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}
136
137static void quirk_smc_enable(struct pnp_dev *dev)
138{
139 struct resource fir, sir, irq;
140
141 pnp_activate_dev(dev);
142 if (quirk_smc_fir_enabled(dev))
143 return;
144
145 /*
146 * Sometimes the BIOS claims the device is enabled, but it reports
147 * the wrong FIR resources or doesn't properly configure ISA or LPC
148 * bridges on the way to the device.
149 *
150 * HP nc6000 and nc8000/nw8000 laptops have known problems like
151 * this. Fortunately, they do fix things up if we auto-configure
152 * the device using its _PRS and _SRS methods.
153 */
154 dev_err(&dev->dev, "%s not responding at SIR 0x%lx, FIR 0x%lx; "
155 "auto-configuring\n", dev->id->id,
156 (unsigned long)pnp_port_start(dev, 0),
157 (unsigned long)pnp_port_start(dev, 1));
158
159 pnp_disable_dev(dev);
160 pnp_init_resource_table(&dev->res);
161 pnp_auto_config_dev(dev);
162 pnp_activate_dev(dev);
163 if (quirk_smc_fir_enabled(dev)) {
164 dev_err(&dev->dev, "responds at SIR 0x%lx, FIR 0x%lx\n",
165 (unsigned long)pnp_port_start(dev, 0),
166 (unsigned long)pnp_port_start(dev, 1));
167 return;
168 }
169
170 /*
171 * The Toshiba Portege 4000 _CRS reports the FIR region first,
172 * followed by the SIR region. The BIOS will configure the bridge,
173 * but only if we call _SRS with SIR first, then FIR. It also
174 * reports the IRQ as active high, when it is really active low.
175 */
176 dev_err(&dev->dev, "not responding at SIR 0x%lx, FIR 0x%lx; "
177 "swapping SIR/FIR and reconfiguring\n",
178 (unsigned long)pnp_port_start(dev, 0),
179 (unsigned long)pnp_port_start(dev, 1));
180
181 /*
182 * Clear IORESOURCE_AUTO so pnp_activate_dev() doesn't reassign
183 * these resources any more.
184 */
185 fir = dev->res.port_resource[0];
186 sir = dev->res.port_resource[1];
187 fir.flags &= ~IORESOURCE_AUTO;
188 sir.flags &= ~IORESOURCE_AUTO;
189
190 irq = dev->res.irq_resource[0];
191 irq.flags &= ~IORESOURCE_AUTO;
192 irq.flags &= ~IORESOURCE_BITS;
193 irq.flags |= IORESOURCE_IRQ_LOWEDGE;
194
195 pnp_disable_dev(dev);
196 dev->res.port_resource[0] = sir;
197 dev->res.port_resource[1] = fir;
198 dev->res.irq_resource[0] = irq;
199 pnp_activate_dev(dev);
200
201 if (quirk_smc_fir_enabled(dev)) {
202 dev_err(&dev->dev, "responds at SIR 0x%lx, FIR 0x%lx\n",
203 (unsigned long)pnp_port_start(dev, 0),
204 (unsigned long)pnp_port_start(dev, 1));
205 return;
206 }
207
208 dev_err(&dev->dev, "giving up; try \"smsc-ircc2.nopnp\" and "
209 "email bjorn.helgaas@hp.com\n");
210}
211
212/* 110/*
213 * PnP Quirks 111 * PnP Quirks
214 * Cards or devices that need some tweaking due to incomplete resource info 112 * Cards or devices that need some tweaking due to incomplete resource info
@@ -229,7 +127,6 @@ static struct pnp_fixup pnp_fixups[] = {
229 {"CTL0043", quirk_sb16audio_resources}, 127 {"CTL0043", quirk_sb16audio_resources},
230 {"CTL0044", quirk_sb16audio_resources}, 128 {"CTL0044", quirk_sb16audio_resources},
231 {"CTL0045", quirk_sb16audio_resources}, 129 {"CTL0045", quirk_sb16audio_resources},
232 {"SMCf010", quirk_smc_enable},
233 {""} 130 {""}
234}; 131};
235 132
diff --git a/drivers/rtc/rtc-v3020.c b/drivers/rtc/rtc-v3020.c
index 3b58d3d5d38a..a6b572978dc0 100644
--- a/drivers/rtc/rtc-v3020.c
+++ b/drivers/rtc/rtc-v3020.c
@@ -26,6 +26,7 @@
26#include <linux/types.h> 26#include <linux/types.h>
27#include <linux/bcd.h> 27#include <linux/bcd.h>
28#include <linux/rtc-v3020.h> 28#include <linux/rtc-v3020.h>
29#include <linux/delay.h>
29 30
30#include <asm/io.h> 31#include <asm/io.h>
31 32
@@ -47,6 +48,7 @@ static void v3020_set_reg(struct v3020 *chip, unsigned char address,
47 for (i = 0; i < 4; i++) { 48 for (i = 0; i < 4; i++) {
48 writel((tmp & 1) << chip->leftshift, chip->ioaddress); 49 writel((tmp & 1) << chip->leftshift, chip->ioaddress);
49 tmp >>= 1; 50 tmp >>= 1;
51 udelay(1);
50 } 52 }
51 53
52 /* Commands dont have data */ 54 /* Commands dont have data */
@@ -54,6 +56,7 @@ static void v3020_set_reg(struct v3020 *chip, unsigned char address,
54 for (i = 0; i < 8; i++) { 56 for (i = 0; i < 8; i++) {
55 writel((data & 1) << chip->leftshift, chip->ioaddress); 57 writel((data & 1) << chip->leftshift, chip->ioaddress);
56 data >>= 1; 58 data >>= 1;
59 udelay(1);
57 } 60 }
58 } 61 }
59} 62}
@@ -66,12 +69,14 @@ static unsigned char v3020_get_reg(struct v3020 *chip, unsigned char address)
66 for (i = 0; i < 4; i++) { 69 for (i = 0; i < 4; i++) {
67 writel((address & 1) << chip->leftshift, chip->ioaddress); 70 writel((address & 1) << chip->leftshift, chip->ioaddress);
68 address >>= 1; 71 address >>= 1;
72 udelay(1);
69 } 73 }
70 74
71 for (i = 0; i < 8; i++) { 75 for (i = 0; i < 8; i++) {
72 data >>= 1; 76 data >>= 1;
73 if (readl(chip->ioaddress) & (1 << chip->leftshift)) 77 if (readl(chip->ioaddress) & (1 << chip->leftshift))
74 data |= 0x80; 78 data |= 0x80;
79 udelay(1);
75 } 80 }
76 81
77 return data; 82 return data;
@@ -95,7 +100,7 @@ static int v3020_read_time(struct device *dev, struct rtc_time *dt)
95 tmp = v3020_get_reg(chip, V3020_MONTH_DAY); 100 tmp = v3020_get_reg(chip, V3020_MONTH_DAY);
96 dt->tm_mday = BCD2BIN(tmp); 101 dt->tm_mday = BCD2BIN(tmp);
97 tmp = v3020_get_reg(chip, V3020_MONTH); 102 tmp = v3020_get_reg(chip, V3020_MONTH);
98 dt->tm_mon = BCD2BIN(tmp); 103 dt->tm_mon = BCD2BIN(tmp) - 1;
99 tmp = v3020_get_reg(chip, V3020_WEEK_DAY); 104 tmp = v3020_get_reg(chip, V3020_WEEK_DAY);
100 dt->tm_wday = BCD2BIN(tmp); 105 dt->tm_wday = BCD2BIN(tmp);
101 tmp = v3020_get_reg(chip, V3020_YEAR); 106 tmp = v3020_get_reg(chip, V3020_YEAR);
@@ -135,7 +140,7 @@ static int v3020_set_time(struct device *dev, struct rtc_time *dt)
135 v3020_set_reg(chip, V3020_MINUTES, BIN2BCD(dt->tm_min)); 140 v3020_set_reg(chip, V3020_MINUTES, BIN2BCD(dt->tm_min));
136 v3020_set_reg(chip, V3020_HOURS, BIN2BCD(dt->tm_hour)); 141 v3020_set_reg(chip, V3020_HOURS, BIN2BCD(dt->tm_hour));
137 v3020_set_reg(chip, V3020_MONTH_DAY, BIN2BCD(dt->tm_mday)); 142 v3020_set_reg(chip, V3020_MONTH_DAY, BIN2BCD(dt->tm_mday));
138 v3020_set_reg(chip, V3020_MONTH, BIN2BCD(dt->tm_mon)); 143 v3020_set_reg(chip, V3020_MONTH, BIN2BCD(dt->tm_mon + 1));
139 v3020_set_reg(chip, V3020_WEEK_DAY, BIN2BCD(dt->tm_wday)); 144 v3020_set_reg(chip, V3020_WEEK_DAY, BIN2BCD(dt->tm_wday));
140 v3020_set_reg(chip, V3020_YEAR, BIN2BCD(dt->tm_year % 100)); 145 v3020_set_reg(chip, V3020_YEAR, BIN2BCD(dt->tm_year % 100));
141 146
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c
index ab5ec1feaf4e..90aa53fc4f3e 100644
--- a/drivers/s390/scsi/zfcp_aux.c
+++ b/drivers/s390/scsi/zfcp_aux.c
@@ -1503,7 +1503,7 @@ zfcp_gid_pn_buffers_alloc(struct zfcp_gid_pn_data **gid_pn, mempool_t *pool)
1503 data->ct.pool = pool; 1503 data->ct.pool = pool;
1504 } 1504 }
1505 } else { 1505 } else {
1506 data = kmalloc(sizeof(struct zfcp_gid_pn_data), GFP_ATOMIC); 1506 data = kmem_cache_alloc(zfcp_data.gid_pn_cache, GFP_ATOMIC);
1507 } 1507 }
1508 1508
1509 if (NULL == data) 1509 if (NULL == data)
@@ -1531,7 +1531,7 @@ static void zfcp_gid_pn_buffers_free(struct zfcp_gid_pn_data *gid_pn)
1531 if (gid_pn->ct.pool) 1531 if (gid_pn->ct.pool)
1532 mempool_free(gid_pn, gid_pn->ct.pool); 1532 mempool_free(gid_pn, gid_pn->ct.pool);
1533 else 1533 else
1534 kfree(gid_pn); 1534 kmem_cache_free(zfcp_data.gid_pn_cache, gid_pn);
1535} 1535}
1536 1536
1537/** 1537/**
diff --git a/drivers/s390/scsi/zfcp_qdio.c b/drivers/s390/scsi/zfcp_qdio.c
index 81daa8204bfe..c6899efdc8f6 100644
--- a/drivers/s390/scsi/zfcp_qdio.c
+++ b/drivers/s390/scsi/zfcp_qdio.c
@@ -640,13 +640,9 @@ int
640zfcp_qdio_sbals_from_scsicmnd(struct zfcp_fsf_req *fsf_req, 640zfcp_qdio_sbals_from_scsicmnd(struct zfcp_fsf_req *fsf_req,
641 unsigned long sbtype, struct scsi_cmnd *scsi_cmnd) 641 unsigned long sbtype, struct scsi_cmnd *scsi_cmnd)
642{ 642{
643 if (scsi_sg_count(scsi_cmnd)) 643 return zfcp_qdio_sbals_from_sg(fsf_req, sbtype, scsi_sglist(scsi_cmnd),
644 return zfcp_qdio_sbals_from_sg(fsf_req, sbtype, 644 scsi_sg_count(scsi_cmnd),
645 scsi_sglist(scsi_cmnd), 645 ZFCP_MAX_SBALS_PER_REQ);
646 scsi_sg_count(scsi_cmnd),
647 ZFCP_MAX_SBALS_PER_REQ);
648 else
649 return 0;
650} 646}
651 647
652/** 648/**
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c
index 0acf6db0a08d..ad7eb4a9261c 100644
--- a/drivers/s390/scsi/zfcp_scsi.c
+++ b/drivers/s390/scsi/zfcp_scsi.c
@@ -764,7 +764,9 @@ zfcp_reset_fc_host_stats(struct Scsi_Host *shost)
764 return; 764 return;
765 765
766 ret = zfcp_fsf_exchange_port_data(NULL, adapter, data); 766 ret = zfcp_fsf_exchange_port_data(NULL, adapter, data);
767 if (ret == 0) { 767 if (ret) {
768 kfree(data);
769 } else {
768 adapter->stats_reset = jiffies/HZ; 770 adapter->stats_reset = jiffies/HZ;
769 old_data = adapter->stats_reset_data; 771 old_data = adapter->stats_reset_data;
770 adapter->stats_reset_data = data; /* finally freed in 772 adapter->stats_reset_data = data; /* finally freed in
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index 5606d1e62978..efceed451b46 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -737,12 +737,19 @@ check_mgmt:
737 */ 737 */
738 conn->ctask = list_entry(conn->xmitqueue.next, 738 conn->ctask = list_entry(conn->xmitqueue.next,
739 struct iscsi_cmd_task, running); 739 struct iscsi_cmd_task, running);
740 if (conn->ctask->state == ISCSI_TASK_PENDING) { 740 switch (conn->ctask->state) {
741 case ISCSI_TASK_ABORTING:
742 break;
743 case ISCSI_TASK_PENDING:
741 iscsi_prep_scsi_cmd_pdu(conn->ctask); 744 iscsi_prep_scsi_cmd_pdu(conn->ctask);
742 conn->session->tt->init_cmd_task(conn->ctask); 745 conn->session->tt->init_cmd_task(conn->ctask);
746 /* fall through */
747 default:
748 conn->ctask->state = ISCSI_TASK_RUNNING;
749 break;
743 } 750 }
744 conn->ctask->state = ISCSI_TASK_RUNNING;
745 list_move_tail(conn->xmitqueue.next, &conn->run_list); 751 list_move_tail(conn->xmitqueue.next, &conn->run_list);
752
746 rc = iscsi_xmit_ctask(conn); 753 rc = iscsi_xmit_ctask(conn);
747 if (rc) 754 if (rc)
748 goto again; 755 goto again;
@@ -1049,7 +1056,9 @@ static int iscsi_exec_abort_task(struct scsi_cmnd *sc,
1049 ctask->mtask = __iscsi_conn_send_pdu(conn, (struct iscsi_hdr *)hdr, 1056 ctask->mtask = __iscsi_conn_send_pdu(conn, (struct iscsi_hdr *)hdr,
1050 NULL, 0); 1057 NULL, 0);
1051 if (!ctask->mtask) { 1058 if (!ctask->mtask) {
1059 spin_unlock_bh(&session->lock);
1052 iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED); 1060 iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED);
1061 spin_lock_bh(&session->lock)
1053 debug_scsi("abort sent failure [itt 0x%x]\n", ctask->itt); 1062 debug_scsi("abort sent failure [itt 0x%x]\n", ctask->itt);
1054 return -EPERM; 1063 return -EPERM;
1055 } 1064 }
@@ -1066,6 +1075,7 @@ static int iscsi_exec_abort_task(struct scsi_cmnd *sc,
1066 debug_scsi("abort set timeout [itt 0x%x]\n", ctask->itt); 1075 debug_scsi("abort set timeout [itt 0x%x]\n", ctask->itt);
1067 } 1076 }
1068 spin_unlock_bh(&session->lock); 1077 spin_unlock_bh(&session->lock);
1078 mutex_unlock(&session->eh_mutex);
1069 scsi_queue_work(session->host, &conn->xmitwork); 1079 scsi_queue_work(session->host, &conn->xmitwork);
1070 1080
1071 /* 1081 /*
@@ -1083,6 +1093,7 @@ static int iscsi_exec_abort_task(struct scsi_cmnd *sc,
1083 if (signal_pending(current)) 1093 if (signal_pending(current))
1084 flush_signals(current); 1094 flush_signals(current);
1085 del_timer_sync(&conn->tmabort_timer); 1095 del_timer_sync(&conn->tmabort_timer);
1096 mutex_lock(&session->eh_mutex);
1086 spin_lock_bh(&session->lock); 1097 spin_lock_bh(&session->lock);
1087 return 0; 1098 return 0;
1088} 1099}
@@ -1158,31 +1169,45 @@ static void fail_command(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask,
1158 __iscsi_put_ctask(ctask); 1169 __iscsi_put_ctask(ctask);
1159} 1170}
1160 1171
1172static void iscsi_suspend_tx(struct iscsi_conn *conn)
1173{
1174 set_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx);
1175 scsi_flush_work(conn->session->host);
1176}
1177
1178static void iscsi_start_tx(struct iscsi_conn *conn)
1179{
1180 clear_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx);
1181 scsi_queue_work(conn->session->host, &conn->xmitwork);
1182}
1183
1161int iscsi_eh_abort(struct scsi_cmnd *sc) 1184int iscsi_eh_abort(struct scsi_cmnd *sc)
1162{ 1185{
1186 struct Scsi_Host *host = sc->device->host;
1187 struct iscsi_session *session = iscsi_hostdata(host->hostdata);
1163 struct iscsi_cmd_task *ctask; 1188 struct iscsi_cmd_task *ctask;
1164 struct iscsi_conn *conn; 1189 struct iscsi_conn *conn;
1165 struct iscsi_session *session;
1166 int rc; 1190 int rc;
1167 1191
1192 mutex_lock(&session->eh_mutex);
1193 spin_lock_bh(&session->lock);
1168 /* 1194 /*
1169 * if session was ISCSI_STATE_IN_RECOVERY then we may not have 1195 * if session was ISCSI_STATE_IN_RECOVERY then we may not have
1170 * got the command. 1196 * got the command.
1171 */ 1197 */
1172 if (!sc->SCp.ptr) { 1198 if (!sc->SCp.ptr) {
1173 debug_scsi("sc never reached iscsi layer or it completed.\n"); 1199 debug_scsi("sc never reached iscsi layer or it completed.\n");
1200 spin_unlock_bh(&session->lock);
1201 mutex_unlock(&session->eh_mutex);
1174 return SUCCESS; 1202 return SUCCESS;
1175 } 1203 }
1176 1204
1177 ctask = (struct iscsi_cmd_task *)sc->SCp.ptr; 1205 ctask = (struct iscsi_cmd_task *)sc->SCp.ptr;
1178 conn = ctask->conn; 1206 conn = ctask->conn;
1179 session = conn->session;
1180 1207
1181 conn->eh_abort_cnt++; 1208 conn->eh_abort_cnt++;
1182 debug_scsi("aborting [sc %p itt 0x%x]\n", sc, ctask->itt); 1209 debug_scsi("aborting [sc %p itt 0x%x]\n", sc, ctask->itt);
1183 1210
1184 spin_lock_bh(&session->lock);
1185
1186 /* 1211 /*
1187 * If we are not logged in or we have started a new session 1212 * If we are not logged in or we have started a new session
1188 * then let the host reset code handle this 1213 * then let the host reset code handle this
@@ -1219,6 +1244,7 @@ int iscsi_eh_abort(struct scsi_cmnd *sc)
1219 switch (conn->tmabort_state) { 1244 switch (conn->tmabort_state) {
1220 case TMABORT_SUCCESS: 1245 case TMABORT_SUCCESS:
1221 spin_unlock_bh(&session->lock); 1246 spin_unlock_bh(&session->lock);
1247 iscsi_suspend_tx(conn);
1222 /* 1248 /*
1223 * clean up task if aborted. grab the recv lock as a writer 1249 * clean up task if aborted. grab the recv lock as a writer
1224 */ 1250 */
@@ -1227,11 +1253,7 @@ int iscsi_eh_abort(struct scsi_cmnd *sc)
1227 fail_command(conn, ctask, DID_ABORT << 16); 1253 fail_command(conn, ctask, DID_ABORT << 16);
1228 spin_unlock(&session->lock); 1254 spin_unlock(&session->lock);
1229 write_unlock_bh(conn->recv_lock); 1255 write_unlock_bh(conn->recv_lock);
1230 /* 1256 iscsi_start_tx(conn);
1231 * make sure xmit thread is not still touching the
1232 * ctask/scsi_cmnd
1233 */
1234 scsi_flush_work(session->host);
1235 goto success_unlocked; 1257 goto success_unlocked;
1236 case TMABORT_NOT_FOUND: 1258 case TMABORT_NOT_FOUND:
1237 if (!ctask->sc) { 1259 if (!ctask->sc) {
@@ -1251,12 +1273,14 @@ success:
1251 spin_unlock_bh(&session->lock); 1273 spin_unlock_bh(&session->lock);
1252success_unlocked: 1274success_unlocked:
1253 debug_scsi("abort success [sc %lx itt 0x%x]\n", (long)sc, ctask->itt); 1275 debug_scsi("abort success [sc %lx itt 0x%x]\n", (long)sc, ctask->itt);
1276 mutex_unlock(&session->eh_mutex);
1254 return SUCCESS; 1277 return SUCCESS;
1255 1278
1256failed: 1279failed:
1257 spin_unlock_bh(&session->lock); 1280 spin_unlock_bh(&session->lock);
1258failed_unlocked: 1281failed_unlocked:
1259 debug_scsi("abort failed [sc %lx itt 0x%x]\n", (long)sc, ctask->itt); 1282 debug_scsi("abort failed [sc %lx itt 0x%x]\n", (long)sc, ctask->itt);
1283 mutex_unlock(&session->eh_mutex);
1260 return FAILED; 1284 return FAILED;
1261} 1285}
1262EXPORT_SYMBOL_GPL(iscsi_eh_abort); 1286EXPORT_SYMBOL_GPL(iscsi_eh_abort);
@@ -1403,6 +1427,7 @@ iscsi_session_setup(struct iscsi_transport *iscsit,
1403 session->max_cmdsn = initial_cmdsn + 1; 1427 session->max_cmdsn = initial_cmdsn + 1;
1404 session->max_r2t = 1; 1428 session->max_r2t = 1;
1405 session->tt = iscsit; 1429 session->tt = iscsit;
1430 mutex_init(&session->eh_mutex);
1406 1431
1407 /* initialize SCSI PDU commands pool */ 1432 /* initialize SCSI PDU commands pool */
1408 if (iscsi_pool_init(&session->cmdpool, session->cmds_max, 1433 if (iscsi_pool_init(&session->cmdpool, session->cmds_max,
@@ -1736,9 +1761,22 @@ static void iscsi_start_session_recovery(struct iscsi_session *session,
1736{ 1761{
1737 int old_stop_stage; 1762 int old_stop_stage;
1738 1763
1764 mutex_lock(&session->eh_mutex);
1739 spin_lock_bh(&session->lock); 1765 spin_lock_bh(&session->lock);
1740 if (conn->stop_stage == STOP_CONN_TERM) { 1766 if (conn->stop_stage == STOP_CONN_TERM) {
1741 spin_unlock_bh(&session->lock); 1767 spin_unlock_bh(&session->lock);
1768 mutex_unlock(&session->eh_mutex);
1769 return;
1770 }
1771
1772 /*
1773 * The LLD either freed/unset the lock on us, or userspace called
1774 * stop but did not create a proper connection (connection was never
1775 * bound or it was unbound then stop was called).
1776 */
1777 if (!conn->recv_lock) {
1778 spin_unlock_bh(&session->lock);
1779 mutex_unlock(&session->eh_mutex);
1742 return; 1780 return;
1743 } 1781 }
1744 1782
@@ -1755,9 +1793,9 @@ static void iscsi_start_session_recovery(struct iscsi_session *session,
1755 old_stop_stage = conn->stop_stage; 1793 old_stop_stage = conn->stop_stage;
1756 conn->stop_stage = flag; 1794 conn->stop_stage = flag;
1757 conn->c_stage = ISCSI_CONN_STOPPED; 1795 conn->c_stage = ISCSI_CONN_STOPPED;
1758 set_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx);
1759 spin_unlock_bh(&session->lock); 1796 spin_unlock_bh(&session->lock);
1760 scsi_flush_work(session->host); 1797
1798 iscsi_suspend_tx(conn);
1761 1799
1762 write_lock_bh(conn->recv_lock); 1800 write_lock_bh(conn->recv_lock);
1763 set_bit(ISCSI_SUSPEND_BIT, &conn->suspend_rx); 1801 set_bit(ISCSI_SUSPEND_BIT, &conn->suspend_rx);
@@ -1786,6 +1824,7 @@ static void iscsi_start_session_recovery(struct iscsi_session *session,
1786 fail_all_commands(conn); 1824 fail_all_commands(conn);
1787 flush_control_queues(session, conn); 1825 flush_control_queues(session, conn);
1788 spin_unlock_bh(&session->lock); 1826 spin_unlock_bh(&session->lock);
1827 mutex_unlock(&session->eh_mutex);
1789} 1828}
1790 1829
1791void iscsi_conn_stop(struct iscsi_cls_conn *cls_conn, int flag) 1830void iscsi_conn_stop(struct iscsi_cls_conn *cls_conn, int flag)
diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c
index 563d18f4ff50..c6680348b648 100644
--- a/drivers/scsi/qla2xxx/qla_dbg.c
+++ b/drivers/scsi/qla2xxx/qla_dbg.c
@@ -2050,21 +2050,18 @@ qla25xx_fw_dump_failed:
2050void 2050void
2051qla2x00_dump_regs(scsi_qla_host_t *ha) 2051qla2x00_dump_regs(scsi_qla_host_t *ha)
2052{ 2052{
2053 int i;
2053 struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; 2054 struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;
2055 struct device_reg_24xx __iomem *reg24 = &ha->iobase->isp24;
2056 uint16_t __iomem *mbx_reg;
2057
2058 mbx_reg = IS_FWI2_CAPABLE(ha) ? &reg24->mailbox0:
2059 MAILBOX_REG(ha, reg, 0);
2054 2060
2055 printk("Mailbox registers:\n"); 2061 printk("Mailbox registers:\n");
2056 printk("scsi(%ld): mbox 0 0x%04x \n", 2062 for (i = 0; i < 6; i++)
2057 ha->host_no, RD_MAILBOX_REG(ha, reg, 0)); 2063 printk("scsi(%ld): mbox %d 0x%04x \n", ha->host_no, i,
2058 printk("scsi(%ld): mbox 1 0x%04x \n", 2064 RD_REG_WORD(mbx_reg++));
2059 ha->host_no, RD_MAILBOX_REG(ha, reg, 1));
2060 printk("scsi(%ld): mbox 2 0x%04x \n",
2061 ha->host_no, RD_MAILBOX_REG(ha, reg, 2));
2062 printk("scsi(%ld): mbox 3 0x%04x \n",
2063 ha->host_no, RD_MAILBOX_REG(ha, reg, 3));
2064 printk("scsi(%ld): mbox 4 0x%04x \n",
2065 ha->host_no, RD_MAILBOX_REG(ha, reg, 4));
2066 printk("scsi(%ld): mbox 5 0x%04x \n",
2067 ha->host_no, RD_MAILBOX_REG(ha, reg, 5));
2068} 2065}
2069 2066
2070 2067
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 27ae3a532a55..c1964866a423 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -1502,7 +1502,6 @@ typedef struct {
1502 uint8_t node_name[WWN_SIZE]; 1502 uint8_t node_name[WWN_SIZE];
1503 uint8_t port_name[WWN_SIZE]; 1503 uint8_t port_name[WWN_SIZE];
1504 uint8_t fabric_port_name[WWN_SIZE]; 1504 uint8_t fabric_port_name[WWN_SIZE];
1505 uint16_t fp_speeds;
1506 uint16_t fp_speed; 1505 uint16_t fp_speed;
1507} sw_info_t; 1506} sw_info_t;
1508 1507
diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c
index b06cbb8580d3..a7e23583f899 100644
--- a/drivers/scsi/qla2xxx/qla_gs.c
+++ b/drivers/scsi/qla2xxx/qla_gs.c
@@ -295,6 +295,8 @@ qla2x00_gid_pt(scsi_qla_host_t *ha, sw_info_t *list)
295 list[i].d_id.b.domain = gid_data->port_id[0]; 295 list[i].d_id.b.domain = gid_data->port_id[0];
296 list[i].d_id.b.area = gid_data->port_id[1]; 296 list[i].d_id.b.area = gid_data->port_id[1];
297 list[i].d_id.b.al_pa = gid_data->port_id[2]; 297 list[i].d_id.b.al_pa = gid_data->port_id[2];
298 memset(list[i].fabric_port_name, 0, WWN_SIZE);
299 list[i].fp_speed = PORT_SPEED_UNKNOWN;
298 300
299 /* Last one exit. */ 301 /* Last one exit. */
300 if (gid_data->control_byte & BIT_7) { 302 if (gid_data->control_byte & BIT_7) {
@@ -1707,8 +1709,6 @@ qla2x00_gfpn_id(scsi_qla_host_t *ha, sw_info_t *list)
1707 1709
1708 for (i = 0; i < MAX_FIBRE_DEVICES; i++) { 1710 for (i = 0; i < MAX_FIBRE_DEVICES; i++) {
1709 /* Issue GFPN_ID */ 1711 /* Issue GFPN_ID */
1710 memset(list[i].fabric_port_name, 0, WWN_SIZE);
1711
1712 /* Prepare common MS IOCB */ 1712 /* Prepare common MS IOCB */
1713 ms_pkt = ha->isp_ops->prep_ms_iocb(ha, GFPN_ID_REQ_SIZE, 1713 ms_pkt = ha->isp_ops->prep_ms_iocb(ha, GFPN_ID_REQ_SIZE,
1714 GFPN_ID_RSP_SIZE); 1714 GFPN_ID_RSP_SIZE);
@@ -1821,8 +1821,6 @@ qla2x00_gpsc(scsi_qla_host_t *ha, sw_info_t *list)
1821 1821
1822 for (i = 0; i < MAX_FIBRE_DEVICES; i++) { 1822 for (i = 0; i < MAX_FIBRE_DEVICES; i++) {
1823 /* Issue GFPN_ID */ 1823 /* Issue GFPN_ID */
1824 list[i].fp_speeds = list[i].fp_speed = 0;
1825
1826 /* Prepare common MS IOCB */ 1824 /* Prepare common MS IOCB */
1827 ms_pkt = qla24xx_prep_ms_fm_iocb(ha, GPSC_REQ_SIZE, 1825 ms_pkt = qla24xx_prep_ms_fm_iocb(ha, GPSC_REQ_SIZE,
1828 GPSC_RSP_SIZE); 1826 GPSC_RSP_SIZE);
@@ -1858,9 +1856,21 @@ qla2x00_gpsc(scsi_qla_host_t *ha, sw_info_t *list)
1858 } 1856 }
1859 rval = QLA_FUNCTION_FAILED; 1857 rval = QLA_FUNCTION_FAILED;
1860 } else { 1858 } else {
1861 /* Save portname */ 1859 /* Save port-speed */
1862 list[i].fp_speeds = ct_rsp->rsp.gpsc.speeds; 1860 switch (be16_to_cpu(ct_rsp->rsp.gpsc.speed)) {
1863 list[i].fp_speed = ct_rsp->rsp.gpsc.speed; 1861 case BIT_15:
1862 list[i].fp_speed = PORT_SPEED_1GB;
1863 break;
1864 case BIT_14:
1865 list[i].fp_speed = PORT_SPEED_2GB;
1866 break;
1867 case BIT_13:
1868 list[i].fp_speed = PORT_SPEED_4GB;
1869 break;
1870 case BIT_11:
1871 list[i].fp_speed = PORT_SPEED_8GB;
1872 break;
1873 }
1864 1874
1865 DEBUG2_3(printk("scsi(%ld): GPSC ext entry - " 1875 DEBUG2_3(printk("scsi(%ld): GPSC ext entry - "
1866 "fpn %02x%02x%02x%02x%02x%02x%02x%02x speeds=%04x " 1876 "fpn %02x%02x%02x%02x%02x%02x%02x%02x speeds=%04x "
@@ -1873,8 +1883,8 @@ qla2x00_gpsc(scsi_qla_host_t *ha, sw_info_t *list)
1873 list[i].fabric_port_name[5], 1883 list[i].fabric_port_name[5],
1874 list[i].fabric_port_name[6], 1884 list[i].fabric_port_name[6],
1875 list[i].fabric_port_name[7], 1885 list[i].fabric_port_name[7],
1876 be16_to_cpu(list[i].fp_speeds), 1886 be16_to_cpu(ct_rsp->rsp.gpsc.speeds),
1877 be16_to_cpu(list[i].fp_speed))); 1887 be16_to_cpu(ct_rsp->rsp.gpsc.speed)));
1878 } 1888 }
1879 1889
1880 /* Last device exit. */ 1890 /* Last device exit. */
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 374abe19b547..1a058ec9bd0c 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -2079,17 +2079,7 @@ qla2x00_configure_local_loop(scsi_qla_host_t *ha)
2079 } 2079 }
2080 2080
2081 /* Base iIDMA settings on HBA port speed. */ 2081 /* Base iIDMA settings on HBA port speed. */
2082 switch (ha->link_data_rate) { 2082 fcport->fp_speed = ha->link_data_rate;
2083 case PORT_SPEED_1GB:
2084 fcport->fp_speed = cpu_to_be16(BIT_15);
2085 break;
2086 case PORT_SPEED_2GB:
2087 fcport->fp_speed = cpu_to_be16(BIT_14);
2088 break;
2089 case PORT_SPEED_4GB:
2090 fcport->fp_speed = cpu_to_be16(BIT_13);
2091 break;
2092 }
2093 2083
2094 qla2x00_update_fcport(ha, fcport); 2084 qla2x00_update_fcport(ha, fcport);
2095 2085
@@ -2130,38 +2120,25 @@ static void
2130qla2x00_iidma_fcport(scsi_qla_host_t *ha, fc_port_t *fcport) 2120qla2x00_iidma_fcport(scsi_qla_host_t *ha, fc_port_t *fcport)
2131{ 2121{
2132#define LS_UNKNOWN 2 2122#define LS_UNKNOWN 2
2133 static char *link_speeds[5] = { "1", "2", "?", "4" }; 2123 static char *link_speeds[5] = { "1", "2", "?", "4", "8" };
2134 int rval; 2124 int rval;
2135 uint16_t port_speed, mb[6]; 2125 uint16_t mb[6];
2136 2126
2137 if (!IS_IIDMA_CAPABLE(ha)) 2127 if (!IS_IIDMA_CAPABLE(ha))
2138 return; 2128 return;
2139 2129
2140 switch (be16_to_cpu(fcport->fp_speed)) { 2130 if (fcport->fp_speed == PORT_SPEED_UNKNOWN) {
2141 case BIT_15:
2142 port_speed = PORT_SPEED_1GB;
2143 break;
2144 case BIT_14:
2145 port_speed = PORT_SPEED_2GB;
2146 break;
2147 case BIT_13:
2148 port_speed = PORT_SPEED_4GB;
2149 break;
2150 default:
2151 DEBUG2(printk("scsi(%ld): %02x%02x%02x%02x%02x%02x%02x%02x -- " 2131 DEBUG2(printk("scsi(%ld): %02x%02x%02x%02x%02x%02x%02x%02x -- "
2152 "unsupported FM port operating speed (%04x).\n", 2132 "unsupported FM port operating speed.\n",
2153 ha->host_no, fcport->port_name[0], fcport->port_name[1], 2133 ha->host_no, fcport->port_name[0], fcport->port_name[1],
2154 fcport->port_name[2], fcport->port_name[3], 2134 fcport->port_name[2], fcport->port_name[3],
2155 fcport->port_name[4], fcport->port_name[5], 2135 fcport->port_name[4], fcport->port_name[5],
2156 fcport->port_name[6], fcport->port_name[7], 2136 fcport->port_name[6], fcport->port_name[7]));
2157 be16_to_cpu(fcport->fp_speed)));
2158 port_speed = PORT_SPEED_UNKNOWN;
2159 break;
2160 }
2161 if (port_speed == PORT_SPEED_UNKNOWN)
2162 return; 2137 return;
2138 }
2163 2139
2164 rval = qla2x00_set_idma_speed(ha, fcport->loop_id, port_speed, mb); 2140 rval = qla2x00_set_idma_speed(ha, fcport->loop_id, fcport->fp_speed,
2141 mb);
2165 if (rval != QLA_SUCCESS) { 2142 if (rval != QLA_SUCCESS) {
2166 DEBUG2(printk("scsi(%ld): Unable to adjust iIDMA " 2143 DEBUG2(printk("scsi(%ld): Unable to adjust iIDMA "
2167 "%02x%02x%02x%02x%02x%02x%02x%02x -- %04x %x %04x %04x.\n", 2144 "%02x%02x%02x%02x%02x%02x%02x%02x -- %04x %x %04x %04x.\n",
@@ -2169,12 +2146,12 @@ qla2x00_iidma_fcport(scsi_qla_host_t *ha, fc_port_t *fcport)
2169 fcport->port_name[2], fcport->port_name[3], 2146 fcport->port_name[2], fcport->port_name[3],
2170 fcport->port_name[4], fcport->port_name[5], 2147 fcport->port_name[4], fcport->port_name[5],
2171 fcport->port_name[6], fcport->port_name[7], rval, 2148 fcport->port_name[6], fcport->port_name[7], rval,
2172 port_speed, mb[0], mb[1])); 2149 fcport->fp_speed, mb[0], mb[1]));
2173 } else { 2150 } else {
2174 DEBUG2(qla_printk(KERN_INFO, ha, 2151 DEBUG2(qla_printk(KERN_INFO, ha,
2175 "iIDMA adjusted to %s GB/s on " 2152 "iIDMA adjusted to %s GB/s on "
2176 "%02x%02x%02x%02x%02x%02x%02x%02x.\n", 2153 "%02x%02x%02x%02x%02x%02x%02x%02x.\n",
2177 link_speeds[port_speed], fcport->port_name[0], 2154 link_speeds[fcport->fp_speed], fcport->port_name[0],
2178 fcport->port_name[1], fcport->port_name[2], 2155 fcport->port_name[1], fcport->port_name[2],
2179 fcport->port_name[3], fcport->port_name[4], 2156 fcport->port_name[3], fcport->port_name[4],
2180 fcport->port_name[5], fcport->port_name[6], 2157 fcport->port_name[5], fcport->port_name[6],
@@ -3354,7 +3331,8 @@ qla2x00_restart_isp(scsi_qla_host_t *ha)
3354 3331
3355 spin_lock_irqsave(&ha->hardware_lock, flags); 3332 spin_lock_irqsave(&ha->hardware_lock, flags);
3356 3333
3357 if (!IS_QLA24XX(ha) && !IS_QLA54XX(ha)) { 3334 if (!IS_QLA24XX(ha) && !IS_QLA54XX(ha) &&
3335 !IS_QLA25XX(ha)) {
3358 /* 3336 /*
3359 * Disable SRAM, Instruction RAM and GP RAM 3337 * Disable SRAM, Instruction RAM and GP RAM
3360 * parity. 3338 * parity.
@@ -3370,7 +3348,8 @@ qla2x00_restart_isp(scsi_qla_host_t *ha)
3370 3348
3371 spin_lock_irqsave(&ha->hardware_lock, flags); 3349 spin_lock_irqsave(&ha->hardware_lock, flags);
3372 3350
3373 if (!IS_QLA24XX(ha) && !IS_QLA54XX(ha)) { 3351 if (!IS_QLA24XX(ha) && !IS_QLA54XX(ha) &&
3352 !IS_QLA25XX(ha)) {
3374 /* Enable proper parity */ 3353 /* Enable proper parity */
3375 if (IS_QLA2300(ha)) 3354 if (IS_QLA2300(ha))
3376 /* SRAM parity */ 3355 /* SRAM parity */
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index 50539da467bf..eecae9905ece 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -490,6 +490,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
490 set_bit(REGISTER_FC4_NEEDED, &ha->dpc_flags); 490 set_bit(REGISTER_FC4_NEEDED, &ha->dpc_flags);
491 491
492 ha->flags.gpsc_supported = 1; 492 ha->flags.gpsc_supported = 1;
493 ha->flags.management_server_logged_in = 0;
493 break; 494 break;
494 495
495 case MBA_CHG_IN_CONNECTION: /* Change in connection mode */ 496 case MBA_CHG_IN_CONNECTION: /* Change in connection mode */
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 93c0c7e4f08f..acca898ce0a2 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -1564,7 +1564,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
1564 struct Scsi_Host *host; 1564 struct Scsi_Host *host;
1565 scsi_qla_host_t *ha; 1565 scsi_qla_host_t *ha;
1566 unsigned long flags = 0; 1566 unsigned long flags = 0;
1567 char pci_info[20]; 1567 char pci_info[30];
1568 char fw_str[30]; 1568 char fw_str[30];
1569 struct scsi_host_template *sht; 1569 struct scsi_host_template *sht;
1570 1570
diff --git a/drivers/scsi/qla2xxx/qla_version.h b/drivers/scsi/qla2xxx/qla_version.h
index dd1f8ceb79c4..18095b9b76f4 100644
--- a/drivers/scsi/qla2xxx/qla_version.h
+++ b/drivers/scsi/qla2xxx/qla_version.h
@@ -7,7 +7,7 @@
7/* 7/*
8 * Driver version 8 * Driver version
9 */ 9 */
10#define QLA2XXX_VERSION "8.02.00-k2" 10#define QLA2XXX_VERSION "8.02.00-k3"
11 11
12#define QLA_DRIVER_MAJOR_VER 8 12#define QLA_DRIVER_MAJOR_VER 8
13#define QLA_DRIVER_MINOR_VER 2 13#define QLA_DRIVER_MINOR_VER 2
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index 64ff6a5f6afd..81b52b7cca21 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -611,7 +611,7 @@ config SERIAL_BFIN
611 611
612config SERIAL_BFIN_CONSOLE 612config SERIAL_BFIN_CONSOLE
613 bool "Console on Blackfin serial port" 613 bool "Console on Blackfin serial port"
614 depends on SERIAL_BFIN 614 depends on SERIAL_BFIN=y
615 select SERIAL_CORE_CONSOLE 615 select SERIAL_CORE_CONSOLE
616 616
617choice 617choice
@@ -832,10 +832,10 @@ config SERIAL_MUX
832 4. Change the kernel command console parameter to: console=ttyB0 832 4. Change the kernel command console parameter to: console=ttyB0
833 833
834config SERIAL_MUX_CONSOLE 834config SERIAL_MUX_CONSOLE
835 bool "Support for console on serial MUX" 835 bool "Support for console on serial MUX"
836 depends on SERIAL_MUX 836 depends on SERIAL_MUX=y
837 select SERIAL_CORE_CONSOLE 837 select SERIAL_CORE_CONSOLE
838 default y 838 default y
839 839
840config PDC_CONSOLE 840config PDC_CONSOLE
841 bool "PDC software console support" 841 bool "PDC software console support"
diff --git a/drivers/serial/sb1250-duart.c b/drivers/serial/sb1250-duart.c
index 201253755011..2d6c08b3dbcf 100644
--- a/drivers/serial/sb1250-duart.c
+++ b/drivers/serial/sb1250-duart.c
@@ -58,6 +58,12 @@
58#define SBD_CTRLREGS(line) A_BCM1480_DUART_CTRLREG((line), 0) 58#define SBD_CTRLREGS(line) A_BCM1480_DUART_CTRLREG((line), 0)
59#define SBD_INT(line) (K_BCM1480_INT_UART_0 + (line)) 59#define SBD_INT(line) (K_BCM1480_INT_UART_0 + (line))
60 60
61#define DUART_CHANREG_SPACING BCM1480_DUART_CHANREG_SPACING
62
63#define R_DUART_IMRREG(line) R_BCM1480_DUART_IMRREG(line)
64#define R_DUART_INCHREG(line) R_BCM1480_DUART_INCHREG(line)
65#define R_DUART_ISRREG(line) R_BCM1480_DUART_ISRREG(line)
66
61#elif defined(CONFIG_SIBYTE_SB1250) || defined(CONFIG_SIBYTE_BCM112X) 67#elif defined(CONFIG_SIBYTE_SB1250) || defined(CONFIG_SIBYTE_BCM112X)
62#include <asm/sibyte/sb1250_regs.h> 68#include <asm/sibyte/sb1250_regs.h>
63#include <asm/sibyte/sb1250_int.h> 69#include <asm/sibyte/sb1250_int.h>
diff --git a/drivers/spi/spi_mpc83xx.c b/drivers/spi/spi_mpc83xx.c
index fcbf1b8a5264..32cda77b31cd 100644
--- a/drivers/spi/spi_mpc83xx.c
+++ b/drivers/spi/spi_mpc83xx.c
@@ -384,11 +384,8 @@ irqreturn_t mpc83xx_spi_irq(s32 irq, void *context_data)
384 384
385 mpc83xx_spi->count -= 1; 385 mpc83xx_spi->count -= 1;
386 if (mpc83xx_spi->count) { 386 if (mpc83xx_spi->count) {
387 if (mpc83xx_spi->tx) { 387 u32 word = mpc83xx_spi->get_tx(mpc83xx_spi);
388 u32 word = mpc83xx_spi->get_tx(mpc83xx_spi); 388 mpc83xx_spi_write_reg(&mpc83xx_spi->base->transmit, word);
389 mpc83xx_spi_write_reg(&mpc83xx_spi->base->transmit,
390 word);
391 }
392 } else { 389 } else {
393 complete(&mpc83xx_spi->done); 390 complete(&mpc83xx_spi->done);
394 } 391 }
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index a1ad11d0c47c..63b1243a9139 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -60,7 +60,7 @@ ssize_t usb_store_new_id(struct usb_dynids *dynids,
60 dynid->id.match_flags = USB_DEVICE_ID_MATCH_DEVICE; 60 dynid->id.match_flags = USB_DEVICE_ID_MATCH_DEVICE;
61 61
62 spin_lock(&dynids->lock); 62 spin_lock(&dynids->lock);
63 list_add_tail(&dynids->list, &dynid->node); 63 list_add_tail(&dynid->node, &dynids->list);
64 spin_unlock(&dynids->lock); 64 spin_unlock(&dynids->lock);
65 65
66 if (get_driver(driver)) { 66 if (get_driver(driver)) {
diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
index 9e467118dc94..ebf3dc20110a 100644
--- a/drivers/usb/core/quirks.c
+++ b/drivers/usb/core/quirks.c
@@ -28,10 +28,16 @@
28 * devices is broken... 28 * devices is broken...
29 */ 29 */
30static const struct usb_device_id usb_quirk_list[] = { 30static const struct usb_device_id usb_quirk_list[] = {
31 /* CBM - Flash disk */
32 { USB_DEVICE(0x0204, 0x6025), .driver_info = USB_QUIRK_RESET_RESUME },
31 /* HP 5300/5370C scanner */ 33 /* HP 5300/5370C scanner */
32 { USB_DEVICE(0x03f0, 0x0701), .driver_info = USB_QUIRK_STRING_FETCH_255 }, 34 { USB_DEVICE(0x03f0, 0x0701), .driver_info = USB_QUIRK_STRING_FETCH_255 },
33 /* Hewlett-Packard PhotoSmart 720 / PhotoSmart 935 (storage) */ 35 /* Hewlett-Packard PhotoSmart 720 / PhotoSmart 935 (storage) */
34 { USB_DEVICE(0x03f0, 0x4002), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, 36 { USB_DEVICE(0x03f0, 0x4002), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
37
38 /* SGS Thomson Microelectronics 4in1 card reader */
39 { USB_DEVICE(0x0483, 0x0321), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
40
35 /* Acer Peripherals Inc. (now BenQ Corp.) Prisa 640BU */ 41 /* Acer Peripherals Inc. (now BenQ Corp.) Prisa 640BU */
36 { USB_DEVICE(0x04a5, 0x207e), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, 42 { USB_DEVICE(0x04a5, 0x207e), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
37 /* Benq S2W 3300U */ 43 /* Benq S2W 3300U */
@@ -66,6 +72,19 @@ static const struct usb_device_id usb_quirk_list[] = {
66 { USB_DEVICE(0x05cc, 0x2267), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, 72 { USB_DEVICE(0x05cc, 0x2267), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
67 /* Ultima Electronics Corp.*/ 73 /* Ultima Electronics Corp.*/
68 { USB_DEVICE(0x05d8, 0x4005), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, 74 { USB_DEVICE(0x05d8, 0x4005), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
75
76 /* Genesys USB-to-IDE */
77 { USB_DEVICE(0x0503, 0x0702), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
78
79 /* USB Graphical LCD - EEH Datalink GmbH */
80 { USB_DEVICE(0x060c, 0x04eb), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
81
82 /* INTEL VALUE SSD */
83 { USB_DEVICE(0x8086, 0xf1a5), .driver_info = USB_QUIRK_RESET_RESUME },
84
85 /* M-Systems Flash Disk Pioneers */
86 { USB_DEVICE(0x08ec, 0x1000), .driver_info = USB_QUIRK_RESET_RESUME },
87
69 /* Agfa Snapscan1212u */ 88 /* Agfa Snapscan1212u */
70 { USB_DEVICE(0x06bd, 0x2061), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, 89 { USB_DEVICE(0x06bd, 0x2061), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
71 /* Seagate RSS LLC */ 90 /* Seagate RSS LLC */
@@ -87,6 +106,12 @@ static const struct usb_device_id usb_quirk_list[] = {
87 { USB_DEVICE(0x0fca, 0x0004), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, 106 { USB_DEVICE(0x0fca, 0x0004), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
88 { USB_DEVICE(0x0fca, 0x0006), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, 107 { USB_DEVICE(0x0fca, 0x0006), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
89 108
109 /* Apple iPhone */
110 { USB_DEVICE(0x05ac, 0x1290), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
111
112 /* SKYMEDI USB_DRIVE */
113 { USB_DEVICE(0x1516, 0x8628), .driver_info = USB_QUIRK_RESET_RESUME },
114
90 { } /* terminating entry must be last */ 115 { } /* terminating entry must be last */
91}; 116};
92 117
@@ -127,4 +152,10 @@ void usb_detect_quirks(struct usb_device *udev)
127 /* do any special quirk handling here if needed */ 152 /* do any special quirk handling here if needed */
128 if (udev->quirks & USB_QUIRK_NO_AUTOSUSPEND) 153 if (udev->quirks & USB_QUIRK_NO_AUTOSUSPEND)
129 usb_autosuspend_quirk(udev); 154 usb_autosuspend_quirk(udev);
155
156 /* By default, disable autosuspend for all non-hubs */
157#ifdef CONFIG_USB_SUSPEND
158 if (udev->descriptor.bDeviceClass != USB_CLASS_HUB)
159 udev->autosuspend_delay = -1;
160#endif
130} 161}
diff --git a/drivers/usb/gadget/serial.c b/drivers/usb/gadget/serial.c
index 9cd98e73dc1d..ce4d2e09633d 100644
--- a/drivers/usb/gadget/serial.c
+++ b/drivers/usb/gadget/serial.c
@@ -1691,14 +1691,12 @@ static int gs_setup_class(struct usb_gadget *gadget,
1691 1691
1692 switch (ctrl->bRequest) { 1692 switch (ctrl->bRequest) {
1693 case USB_CDC_REQ_SET_LINE_CODING: 1693 case USB_CDC_REQ_SET_LINE_CODING:
1694 ret = min(wLength, 1694 /* FIXME Submit req to read the data; have its completion
1695 (u16)sizeof(struct usb_cdc_line_coding)); 1695 * handler copy that data to port->port_line_coding (iff
1696 if (port) { 1696 * it's valid) and maybe pass it on. Until then, fail.
1697 spin_lock(&port->port_lock); 1697 */
1698 memcpy(&port->port_line_coding, req->buf, ret); 1698 printk(KERN_WARNING "gs_setup: set_line_coding "
1699 spin_unlock(&port->port_lock); 1699 "unuspported\n");
1700 }
1701 ret = 0;
1702 break; 1700 break;
1703 1701
1704 case USB_CDC_REQ_GET_LINE_CODING: 1702 case USB_CDC_REQ_GET_LINE_CODING:
@@ -1713,11 +1711,18 @@ static int gs_setup_class(struct usb_gadget *gadget,
1713 break; 1711 break;
1714 1712
1715 case USB_CDC_REQ_SET_CONTROL_LINE_STATE: 1713 case USB_CDC_REQ_SET_CONTROL_LINE_STATE:
1716 ret = 0; 1714 /* FIXME Submit req to read the data; have its completion
1715 * handler use that to set the state (iff it's valid) and
1716 * maybe pass it on. Until then, fail.
1717 */
1718 printk(KERN_WARNING "gs_setup: set_control_line_state "
1719 "unuspported\n");
1717 break; 1720 break;
1718 1721
1719 default: 1722 default:
1720 printk(KERN_ERR "gs_setup: unknown class request, type=%02x, request=%02x, value=%04x, index=%04x, length=%d\n", 1723 printk(KERN_ERR "gs_setup: unknown class request, "
1724 "type=%02x, request=%02x, value=%04x, "
1725 "index=%04x, length=%d\n",
1721 ctrl->bRequestType, ctrl->bRequest, 1726 ctrl->bRequestType, ctrl->bRequest,
1722 wValue, wIndex, wLength); 1727 wValue, wIndex, wLength);
1723 break; 1728 break;
diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c
index 9f37ba44c132..b64ca91d9b02 100644
--- a/drivers/usb/misc/sisusbvga/sisusb.c
+++ b/drivers/usb/misc/sisusbvga/sisusb.c
@@ -3404,6 +3404,7 @@ static void sisusb_disconnect(struct usb_interface *intf)
3404} 3404}
3405 3405
3406static struct usb_device_id sisusb_table [] = { 3406static struct usb_device_id sisusb_table [] = {
3407 { USB_DEVICE(0x0711, 0x0550) },
3407 { USB_DEVICE(0x0711, 0x0900) }, 3408 { USB_DEVICE(0x0711, 0x0900) },
3408 { USB_DEVICE(0x0711, 0x0901) }, 3409 { USB_DEVICE(0x0711, 0x0901) },
3409 { USB_DEVICE(0x0711, 0x0902) }, 3410 { USB_DEVICE(0x0711, 0x0902) },
diff --git a/drivers/usb/serial/bus.c b/drivers/usb/serial/bus.c
index c08a38402b93..a47a24f8820d 100644
--- a/drivers/usb/serial/bus.c
+++ b/drivers/usb/serial/bus.c
@@ -138,7 +138,7 @@ static void free_dynids(struct usb_serial_driver *drv)
138static struct driver_attribute drv_attrs[] = { 138static struct driver_attribute drv_attrs[] = {
139 __ATTR_NULL, 139 __ATTR_NULL,
140}; 140};
141static inline void free_dynids(struct usb_driver *drv) 141static inline void free_dynids(struct usb_serial_driver *drv)
142{ 142{
143} 143}
144#endif 144#endif
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 1370c423d7c2..2d045857b181 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -568,6 +568,7 @@ static struct usb_device_id id_table_combined [] = {
568 { USB_DEVICE(ELEKTOR_VID, ELEKTOR_FT323R_PID) }, 568 { USB_DEVICE(ELEKTOR_VID, ELEKTOR_FT323R_PID) },
569 { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) }, 569 { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) },
570 { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) }, 570 { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) },
571 { USB_DEVICE(TML_VID, TML_USB_SERIAL_PID) },
571 { USB_DEVICE(OLIMEX_VID, OLIMEX_ARM_USB_OCD_PID), 572 { USB_DEVICE(OLIMEX_VID, OLIMEX_ARM_USB_OCD_PID),
572 .driver_info = (kernel_ulong_t)&ftdi_olimex_quirk }, 573 .driver_info = (kernel_ulong_t)&ftdi_olimex_quirk },
573 { }, /* Optional parameter entry */ 574 { }, /* Optional parameter entry */
diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h
index c70e1de6389e..b57b90ae9f9d 100644
--- a/drivers/usb/serial/ftdi_sio.h
+++ b/drivers/usb/serial/ftdi_sio.h
@@ -534,6 +534,14 @@
534#define OLIMEX_VID 0x15BA 534#define OLIMEX_VID 0x15BA
535#define OLIMEX_ARM_USB_OCD_PID 0x0003 535#define OLIMEX_ARM_USB_OCD_PID 0x0003
536 536
537
538/*
539 * The Mobility Lab (TML)
540 * Submitted by Pierre Castella
541 */
542#define TML_VID 0x1B91 /* Vendor ID */
543#define TML_USB_SERIAL_PID 0x0064 /* USB - Serial Converter */
544
537/* Commands */ 545/* Commands */
538#define FTDI_SIO_RESET 0 /* Reset the port */ 546#define FTDI_SIO_RESET 0 /* Reset the port */
539#define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */ 547#define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 4cb3c165742b..a18659e0700c 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -108,6 +108,7 @@ static int option_send_setup(struct usb_serial_port *port);
108#define HUAWEI_VENDOR_ID 0x12D1 108#define HUAWEI_VENDOR_ID 0x12D1
109#define HUAWEI_PRODUCT_E600 0x1001 109#define HUAWEI_PRODUCT_E600 0x1001
110#define HUAWEI_PRODUCT_E220 0x1003 110#define HUAWEI_PRODUCT_E220 0x1003
111#define HUAWEI_PRODUCT_E220BIS 0x1004
111 112
112#define NOVATELWIRELESS_VENDOR_ID 0x1410 113#define NOVATELWIRELESS_VENDOR_ID 0x1410
113#define DELL_VENDOR_ID 0x413C 114#define DELL_VENDOR_ID 0x413C
@@ -158,6 +159,7 @@ static struct usb_device_id option_ids[] = {
158 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_KOI_NETWORK) }, 159 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_KOI_NETWORK) },
159 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) }, 160 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) },
160 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220) }, 161 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220) },
162 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220BIS) },
161 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1100) }, /* Novatel Merlin XS620/S640 */ 163 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1100) }, /* Novatel Merlin XS620/S640 */
162 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1110) }, /* Novatel Merlin S620 */ 164 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1110) }, /* Novatel Merlin S620 */
163 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1120) }, /* Novatel Merlin EX720 */ 165 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1120) }, /* Novatel Merlin EX720 */
@@ -176,6 +178,7 @@ static struct usb_device_id option_ids[] = {
176 { USB_DEVICE(DELL_VENDOR_ID, 0x8117) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO ExpressCard == Novatel Merlin XV620 CDMA/EV-DO */ 178 { USB_DEVICE(DELL_VENDOR_ID, 0x8117) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO ExpressCard == Novatel Merlin XV620 CDMA/EV-DO */
177 { USB_DEVICE(DELL_VENDOR_ID, 0x8118) }, /* Dell Wireless 5510 Mobile Broadband HSDPA ExpressCard == Novatel Merlin XU870 HSDPA/3G */ 179 { USB_DEVICE(DELL_VENDOR_ID, 0x8118) }, /* Dell Wireless 5510 Mobile Broadband HSDPA ExpressCard == Novatel Merlin XU870 HSDPA/3G */
178 { USB_DEVICE(DELL_VENDOR_ID, 0x8128) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite E720 CDMA/EV-DO */ 180 { USB_DEVICE(DELL_VENDOR_ID, 0x8128) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite E720 CDMA/EV-DO */
181 { USB_DEVICE(DELL_VENDOR_ID, 0x8137) }, /* Dell Wireless HSDPA 5520 */
179 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) }, 182 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) },
180 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) }, 183 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) },
181 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_1) }, 184 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_1) },
diff --git a/drivers/usb/serial/oti6858.c b/drivers/usb/serial/oti6858.c
index 833ada47fc54..64f3f66a7a35 100644
--- a/drivers/usb/serial/oti6858.c
+++ b/drivers/usb/serial/oti6858.c
@@ -817,21 +817,6 @@ static int oti6858_ioctl(struct usb_serial_port *port, struct file *file,
817 __FUNCTION__, port->number, cmd, arg); 817 __FUNCTION__, port->number, cmd, arg);
818 818
819 switch (cmd) { 819 switch (cmd) {
820 case TCGETS:
821 if (kernel_termios_to_user_termios((struct ktermios __user *)arg,
822 port->tty->termios))
823 return -EFAULT;
824 return 0;
825
826 case TCSETS:
827 case TCSETSW: /* FIXME: this is not the same! */
828 case TCSETSF: /* FIXME: this is not the same! */
829 if (user_termios_to_kernel_termios(port->tty->termios,
830 (struct ktermios __user *)arg))
831 return -EFAULT;
832 oti6858_set_termios(port, NULL);
833 return 0;
834
835 case TCFLSH: 820 case TCFLSH:
836 /* FIXME */ 821 /* FIXME */
837 return 0; 822 return 0;
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
index 47e56079925d..1ba19eaa1970 100644
--- a/drivers/usb/storage/scsiglue.c
+++ b/drivers/usb/storage/scsiglue.c
@@ -285,15 +285,10 @@ static int device_reset(struct scsi_cmnd *srb)
285 285
286 US_DEBUGP("%s called\n", __FUNCTION__); 286 US_DEBUGP("%s called\n", __FUNCTION__);
287 287
288 result = usb_autopm_get_interface(us->pusb_intf); 288 /* lock the device pointers and do the reset */
289 if (result == 0) { 289 mutex_lock(&(us->dev_mutex));
290 290 result = us->transport_reset(us);
291 /* lock the device pointers and do the reset */ 291 mutex_unlock(&us->dev_mutex);
292 mutex_lock(&(us->dev_mutex));
293 result = us->transport_reset(us);
294 mutex_unlock(&us->dev_mutex);
295 usb_autopm_put_interface(us->pusb_intf);
296 }
297 292
298 return result < 0 ? FAILED : SUCCESS; 293 return result < 0 ? FAILED : SUCCESS;
299} 294}
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index 2d92ce31018f..c6b78ba815ea 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -348,6 +348,13 @@ UNUSUAL_DEV( 0x04b0, 0x0411, 0x0100, 0x0101,
348 US_SC_DEVICE, US_PR_DEVICE, NULL, 348 US_SC_DEVICE, US_PR_DEVICE, NULL,
349 US_FL_FIX_CAPACITY), 349 US_FL_FIX_CAPACITY),
350 350
351/* Reported by Ortwin Glueck <odi@odi.ch> */
352UNUSUAL_DEV( 0x04b0, 0x0413, 0x0110, 0x0110,
353 "NIKON",
354 "NIKON DSC D40",
355 US_SC_DEVICE, US_PR_DEVICE, NULL,
356 US_FL_FIX_CAPACITY),
357
351/* BENQ DC5330 358/* BENQ DC5330
352 * Reported by Manuel Fombuena <mfombuena@ya.com> and 359 * Reported by Manuel Fombuena <mfombuena@ya.com> and
353 * Frank Copeland <fjc@thingy.apana.org.au> */ 360 * Frank Copeland <fjc@thingy.apana.org.au> */
@@ -897,6 +904,22 @@ UNUSUAL_DEV( 0x069b, 0x3004, 0x0001, 0x0001,
897 US_SC_DEVICE, US_PR_DEVICE, NULL, 904 US_SC_DEVICE, US_PR_DEVICE, NULL,
898 US_FL_FIX_CAPACITY ), 905 US_FL_FIX_CAPACITY ),
899 906
907/* Reported by Massimiliano Ghilardi <massimiliano.ghilardi@gmail.com>
908 * This USB MP3/AVI player device fails and disconnects if more than 128
909 * sectors (64kB) are read/written in a single command, and may be present
910 * at least in the following products:
911 * "Magnex Digital Video Panel DVP 1800"
912 * "MP4 AIGO 4GB SLOT SD"
913 * "Teclast TL-C260 MP3"
914 * "i.Meizu PMP MP3/MP4"
915 * "Speed MV8 MP4 Audio Player"
916 */
917UNUSUAL_DEV( 0x071b, 0x3203, 0x0100, 0x0100,
918 "RockChip",
919 "ROCK MP3",
920 US_SC_DEVICE, US_PR_DEVICE, NULL,
921 US_FL_MAX_SECTORS_64),
922
900/* Reported by Olivier Blondeau <zeitoun@gmail.com> */ 923/* Reported by Olivier Blondeau <zeitoun@gmail.com> */
901UNUSUAL_DEV( 0x0727, 0x0306, 0x0100, 0x0100, 924UNUSUAL_DEV( 0x0727, 0x0306, 0x0100, 0x0100,
902 "ATMEL", 925 "ATMEL",
@@ -1393,6 +1416,13 @@ UNUSUAL_DEV( 0x0fce, 0xe030, 0x0000, 0x0000,
1393 US_SC_DEVICE, US_PR_DEVICE, NULL, 1416 US_SC_DEVICE, US_PR_DEVICE, NULL,
1394 US_FL_FIX_CAPACITY | US_FL_IGNORE_RESIDUE ), 1417 US_FL_FIX_CAPACITY | US_FL_IGNORE_RESIDUE ),
1395 1418
1419/* Reported by Ricardo Barberis <ricardo@dattatec.com> */
1420UNUSUAL_DEV( 0x0fce, 0xe092, 0x0000, 0x0000,
1421 "Sony Ericsson",
1422 "P1i",
1423 US_SC_DEVICE, US_PR_DEVICE, NULL,
1424 US_FL_IGNORE_RESIDUE ),
1425
1396/* Reported by Emmanuel Vasilakis <evas@forthnet.gr> */ 1426/* Reported by Emmanuel Vasilakis <evas@forthnet.gr> */
1397UNUSUAL_DEV( 0x0fce, 0xe031, 0x0000, 0x0000, 1427UNUSUAL_DEV( 0x0fce, 0xe031, 0x0000, 0x0000,
1398 "Sony Ericsson", 1428 "Sony Ericsson",
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index 25e557d4fe6b..59181667066c 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -184,14 +184,16 @@ static int storage_suspend(struct usb_interface *iface, pm_message_t message)
184{ 184{
185 struct us_data *us = usb_get_intfdata(iface); 185 struct us_data *us = usb_get_intfdata(iface);
186 186
187 US_DEBUGP("%s\n", __FUNCTION__);
188
189 /* Wait until no command is running */ 187 /* Wait until no command is running */
190 mutex_lock(&us->dev_mutex); 188 mutex_lock(&us->dev_mutex);
191 189
190 US_DEBUGP("%s\n", __FUNCTION__);
192 if (us->suspend_resume_hook) 191 if (us->suspend_resume_hook)
193 (us->suspend_resume_hook)(us, US_SUSPEND); 192 (us->suspend_resume_hook)(us, US_SUSPEND);
194 193
194 /* When runtime PM is working, we'll set a flag to indicate
195 * whether we should autoresume when a SCSI request arrives. */
196
195 mutex_unlock(&us->dev_mutex); 197 mutex_unlock(&us->dev_mutex);
196 return 0; 198 return 0;
197} 199}
@@ -200,11 +202,13 @@ static int storage_resume(struct usb_interface *iface)
200{ 202{
201 struct us_data *us = usb_get_intfdata(iface); 203 struct us_data *us = usb_get_intfdata(iface);
202 204
203 US_DEBUGP("%s\n", __FUNCTION__); 205 mutex_lock(&us->dev_mutex);
204 206
207 US_DEBUGP("%s\n", __FUNCTION__);
205 if (us->suspend_resume_hook) 208 if (us->suspend_resume_hook)
206 (us->suspend_resume_hook)(us, US_RESUME); 209 (us->suspend_resume_hook)(us, US_RESUME);
207 210
211 mutex_unlock(&us->dev_mutex);
208 return 0; 212 return 0;
209} 213}
210 214
@@ -302,7 +306,6 @@ static int usb_stor_control_thread(void * __us)
302{ 306{
303 struct us_data *us = (struct us_data *)__us; 307 struct us_data *us = (struct us_data *)__us;
304 struct Scsi_Host *host = us_to_host(us); 308 struct Scsi_Host *host = us_to_host(us);
305 int autopm_rc;
306 309
307 for(;;) { 310 for(;;) {
308 US_DEBUGP("*** thread sleeping.\n"); 311 US_DEBUGP("*** thread sleeping.\n");
@@ -311,9 +314,6 @@ static int usb_stor_control_thread(void * __us)
311 314
312 US_DEBUGP("*** thread awakened.\n"); 315 US_DEBUGP("*** thread awakened.\n");
313 316
314 /* Autoresume the device */
315 autopm_rc = usb_autopm_get_interface(us->pusb_intf);
316
317 /* lock the device pointers */ 317 /* lock the device pointers */
318 mutex_lock(&(us->dev_mutex)); 318 mutex_lock(&(us->dev_mutex));
319 319
@@ -372,12 +372,6 @@ static int usb_stor_control_thread(void * __us)
372 us->srb->result = SAM_STAT_GOOD; 372 us->srb->result = SAM_STAT_GOOD;
373 } 373 }
374 374
375 /* Did the autoresume fail? */
376 else if (autopm_rc < 0) {
377 US_DEBUGP("Could not wake device\n");
378 us->srb->result = DID_ERROR << 16;
379 }
380
381 /* we've got a command, let's do it! */ 375 /* we've got a command, let's do it! */
382 else { 376 else {
383 US_DEBUG(usb_stor_show_command(us->srb)); 377 US_DEBUG(usb_stor_show_command(us->srb));
@@ -420,10 +414,6 @@ SkipForAbort:
420 414
421 /* unlock the device pointers */ 415 /* unlock the device pointers */
422 mutex_unlock(&us->dev_mutex); 416 mutex_unlock(&us->dev_mutex);
423
424 /* Start an autosuspend */
425 if (autopm_rc == 0)
426 usb_autopm_put_interface(us->pusb_intf);
427 } /* for (;;) */ 417 } /* for (;;) */
428 418
429 /* Wait until we are told to stop */ 419 /* Wait until we are told to stop */
@@ -941,7 +931,6 @@ retry:
941 /* Should we unbind if no devices were detected? */ 931 /* Should we unbind if no devices were detected? */
942 } 932 }
943 933
944 usb_autopm_put_interface(us->pusb_intf);
945 complete_and_exit(&us->scanning_done, 0); 934 complete_and_exit(&us->scanning_done, 0);
946} 935}
947 936
@@ -1027,7 +1016,6 @@ static int storage_probe(struct usb_interface *intf,
1027 goto BadDevice; 1016 goto BadDevice;
1028 } 1017 }
1029 1018
1030 usb_autopm_get_interface(intf); /* dropped in the scanning thread */
1031 wake_up_process(th); 1019 wake_up_process(th);
1032 1020
1033 return 0; 1021 return 0;
@@ -1065,7 +1053,6 @@ static struct usb_driver usb_storage_driver = {
1065 .pre_reset = storage_pre_reset, 1053 .pre_reset = storage_pre_reset,
1066 .post_reset = storage_post_reset, 1054 .post_reset = storage_post_reset,
1067 .id_table = storage_usb_ids, 1055 .id_table = storage_usb_ids,
1068 .supports_autosuspend = 1,
1069}; 1056};
1070 1057
1071static int __init usb_stor_init(void) 1058static int __init usb_stor_init(void)
diff --git a/drivers/video/aty/ati_ids.h b/drivers/video/aty/ati_ids.h
index 685a754991c6..dca2eb8f2dde 100644
--- a/drivers/video/aty/ati_ids.h
+++ b/drivers/video/aty/ati_ids.h
@@ -192,6 +192,12 @@
192#define PCI_CHIP_RS300_5835 0x5835 192#define PCI_CHIP_RS300_5835 0x5835
193#define PCI_CHIP_RS300_5836 0x5836 193#define PCI_CHIP_RS300_5836 0x5836
194#define PCI_CHIP_RS300_5837 0x5837 194#define PCI_CHIP_RS300_5837 0x5837
195#define PCI_CHIP_RS480_5955 0x5955
196#define PCI_CHIP_RV280_5960 0x5960
197#define PCI_CHIP_RV280_5961 0x5961
198#define PCI_CHIP_RV280_5962 0x5962
199#define PCI_CHIP_RV280_5964 0x5964
200#define PCI_CHIP_RS482_5975 0x5975
195#define PCI_CHIP_RV370_5B60 0x5B60 201#define PCI_CHIP_RV370_5B60 0x5B60
196#define PCI_CHIP_RV370_5B61 0x5B61 202#define PCI_CHIP_RV370_5B61 0x5B61
197#define PCI_CHIP_RV370_5B62 0x5B62 203#define PCI_CHIP_RV370_5B62 0x5B62
@@ -200,14 +206,8 @@
200#define PCI_CHIP_RV370_5B65 0x5B65 206#define PCI_CHIP_RV370_5B65 0x5B65
201#define PCI_CHIP_RV370_5B66 0x5B66 207#define PCI_CHIP_RV370_5B66 0x5B66
202#define PCI_CHIP_RV370_5B67 0x5B67 208#define PCI_CHIP_RV370_5B67 0x5B67
203#define PCI_CHIP_RV280_5960 0x5960
204#define PCI_CHIP_RV280_5961 0x5961
205#define PCI_CHIP_RV280_5962 0x5962
206#define PCI_CHIP_RV280_5964 0x5964
207#define PCI_CHIP_RS485_5975 0x5975
208#define PCI_CHIP_RV280_5C61 0x5C61 209#define PCI_CHIP_RV280_5C61 0x5C61
209#define PCI_CHIP_RV280_5C63 0x5C63 210#define PCI_CHIP_RV280_5C63 0x5C63
210#define PCI_CHIP_R423_5D57 0x5D57 211#define PCI_CHIP_R423_5D57 0x5D57
211#define PCI_CHIP_RS350_7834 0x7834 212#define PCI_CHIP_RS350_7834 0x7834
212#define PCI_CHIP_RS350_7835 0x7835 213#define PCI_CHIP_RS350_7835 0x7835
213#define PCI_CHIP_RS480_5955 0x5955
diff --git a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c
index 47ca62fe7c3e..4b747bdaeea6 100644
--- a/drivers/video/aty/radeon_base.c
+++ b/drivers/video/aty/radeon_base.c
@@ -102,6 +102,7 @@
102static struct pci_device_id radeonfb_pci_table[] = { 102static struct pci_device_id radeonfb_pci_table[] = {
103 /* Radeon Xpress 200m */ 103 /* Radeon Xpress 200m */
104 CHIP_DEF(PCI_CHIP_RS480_5955, RS480, CHIP_HAS_CRTC2 | CHIP_IS_IGP | CHIP_IS_MOBILITY), 104 CHIP_DEF(PCI_CHIP_RS480_5955, RS480, CHIP_HAS_CRTC2 | CHIP_IS_IGP | CHIP_IS_MOBILITY),
105 CHIP_DEF(PCI_CHIP_RS482_5975, RS480, CHIP_HAS_CRTC2 | CHIP_IS_IGP | CHIP_IS_MOBILITY),
105 /* Mobility M6 */ 106 /* Mobility M6 */
106 CHIP_DEF(PCI_CHIP_RADEON_LY, RV100, CHIP_HAS_CRTC2 | CHIP_IS_MOBILITY), 107 CHIP_DEF(PCI_CHIP_RADEON_LY, RV100, CHIP_HAS_CRTC2 | CHIP_IS_MOBILITY),
107 CHIP_DEF(PCI_CHIP_RADEON_LZ, RV100, CHIP_HAS_CRTC2 | CHIP_IS_MOBILITY), 108 CHIP_DEF(PCI_CHIP_RADEON_LZ, RV100, CHIP_HAS_CRTC2 | CHIP_IS_MOBILITY),
@@ -153,8 +154,6 @@ static struct pci_device_id radeonfb_pci_table[] = {
153 /* Mobility 9200 (M9+) */ 154 /* Mobility 9200 (M9+) */
154 CHIP_DEF(PCI_CHIP_RV280_5C61, RV280, CHIP_HAS_CRTC2 | CHIP_IS_MOBILITY), 155 CHIP_DEF(PCI_CHIP_RV280_5C61, RV280, CHIP_HAS_CRTC2 | CHIP_IS_MOBILITY),
155 CHIP_DEF(PCI_CHIP_RV280_5C63, RV280, CHIP_HAS_CRTC2 | CHIP_IS_MOBILITY), 156 CHIP_DEF(PCI_CHIP_RV280_5C63, RV280, CHIP_HAS_CRTC2 | CHIP_IS_MOBILITY),
156 /*Mobility Xpress 200 */
157 CHIP_DEF(PCI_CHIP_RS485_5975, R300, CHIP_HAS_CRTC2 | CHIP_IS_IGP | CHIP_IS_MOBILITY),
158 /* 9200 */ 157 /* 9200 */
159 CHIP_DEF(PCI_CHIP_RV280_5960, RV280, CHIP_HAS_CRTC2), 158 CHIP_DEF(PCI_CHIP_RV280_5960, RV280, CHIP_HAS_CRTC2),
160 CHIP_DEF(PCI_CHIP_RV280_5961, RV280, CHIP_HAS_CRTC2), 159 CHIP_DEF(PCI_CHIP_RV280_5961, RV280, CHIP_HAS_CRTC2),
@@ -1285,7 +1284,8 @@ static void radeon_write_pll_regs(struct radeonfb_info *rinfo, struct radeon_reg
1285 if (rinfo->family == CHIP_FAMILY_R300 || 1284 if (rinfo->family == CHIP_FAMILY_R300 ||
1286 rinfo->family == CHIP_FAMILY_RS300 || 1285 rinfo->family == CHIP_FAMILY_RS300 ||
1287 rinfo->family == CHIP_FAMILY_R350 || 1286 rinfo->family == CHIP_FAMILY_R350 ||
1288 rinfo->family == CHIP_FAMILY_RV350) { 1287 rinfo->family == CHIP_FAMILY_RV350 ||
1288 rinfo->family == CHIP_FAMILY_RV380 ) {
1289 if (mode->ppll_ref_div & R300_PPLL_REF_DIV_ACC_MASK) { 1289 if (mode->ppll_ref_div & R300_PPLL_REF_DIV_ACC_MASK) {
1290 /* When restoring console mode, use saved PPLL_REF_DIV 1290 /* When restoring console mode, use saved PPLL_REF_DIV
1291 * setting. 1291 * setting.
diff --git a/drivers/video/intelfb/intelfbhw.c b/drivers/video/intelfb/intelfbhw.c
index 16bc8d75e36e..b21d0dec9283 100644
--- a/drivers/video/intelfb/intelfbhw.c
+++ b/drivers/video/intelfb/intelfbhw.c
@@ -924,10 +924,10 @@ calc_pll_params(int index, int clock, u32 *retm1, u32 *retm2, u32 *retn, u32 *re
924 if (m > pll->max_m) 924 if (m > pll->max_m)
925 m = pll->max_m - 1; 925 m = pll->max_m - 1;
926 for (testm = m - 1; testm <= m; testm++) { 926 for (testm = m - 1; testm <= m; testm++) {
927 f_out = calc_vclock3(index, m, n, p); 927 f_out = calc_vclock3(index, testm, n, p);
928 if (splitm(index, testm, &m1, &m2)) { 928 if (splitm(index, testm, &m1, &m2)) {
929 WRN_MSG("cannot split m = %d\n", m); 929 WRN_MSG("cannot split m = %d\n",
930 n++; 930 testm);
931 continue; 931 continue;
932 } 932 }
933 if (clock > f_out) 933 if (clock > f_out)
diff --git a/fs/Kconfig b/fs/Kconfig
index 58a0650293e1..f9eed6d79066 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -441,9 +441,6 @@ config OCFS2_FS
441 441
442 Note: Features which OCFS2 does not support yet: 442 Note: Features which OCFS2 does not support yet:
443 - extended attributes 443 - extended attributes
444 - shared writeable mmap
445 - loopback is supported, but data written will not
446 be cluster coherent.
447 - quotas 444 - quotas
448 - cluster aware flock 445 - cluster aware flock
449 - Directory change notification (F_NOTIFY) 446 - Directory change notification (F_NOTIFY)
diff --git a/fs/afs/mntpt.c b/fs/afs/mntpt.c
index a3684dcc76e7..6f8c96fb29eb 100644
--- a/fs/afs/mntpt.c
+++ b/fs/afs/mntpt.c
@@ -235,8 +235,8 @@ static void *afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd)
235 err = do_add_mount(newmnt, nd, MNT_SHRINKABLE, &afs_vfsmounts); 235 err = do_add_mount(newmnt, nd, MNT_SHRINKABLE, &afs_vfsmounts);
236 switch (err) { 236 switch (err) {
237 case 0: 237 case 0:
238 mntput(nd->mnt);
239 dput(nd->dentry); 238 dput(nd->dentry);
239 mntput(nd->mnt);
240 nd->mnt = newmnt; 240 nd->mnt = newmnt;
241 nd->dentry = dget(newmnt->mnt_root); 241 nd->dentry = dget(newmnt->mnt_root);
242 schedule_delayed_work(&afs_mntpt_expiry_timer, 242 schedule_delayed_work(&afs_mntpt_expiry_timer,
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index 22cfdd61c060..9537316a0714 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -2578,8 +2578,11 @@ static int ext3_release_dquot(struct dquot *dquot)
2578 2578
2579 handle = ext3_journal_start(dquot_to_inode(dquot), 2579 handle = ext3_journal_start(dquot_to_inode(dquot),
2580 EXT3_QUOTA_DEL_BLOCKS(dquot->dq_sb)); 2580 EXT3_QUOTA_DEL_BLOCKS(dquot->dq_sb));
2581 if (IS_ERR(handle)) 2581 if (IS_ERR(handle)) {
2582 /* Release dquot anyway to avoid endless cycle in dqput() */
2583 dquot_release(dquot);
2582 return PTR_ERR(handle); 2584 return PTR_ERR(handle);
2585 }
2583 ret = dquot_release(dquot); 2586 ret = dquot_release(dquot);
2584 err = ext3_journal_stop(handle); 2587 err = ext3_journal_stop(handle);
2585 if (!ret) 2588 if (!ret)
@@ -2712,6 +2715,12 @@ static ssize_t ext3_quota_write(struct super_block *sb, int type,
2712 struct buffer_head *bh; 2715 struct buffer_head *bh;
2713 handle_t *handle = journal_current_handle(); 2716 handle_t *handle = journal_current_handle();
2714 2717
2718 if (!handle) {
2719 printk(KERN_WARNING "EXT3-fs: Quota write (off=%Lu, len=%Lu)"
2720 " cancelled because transaction is not started.\n",
2721 (unsigned long long)off, (unsigned long long)len);
2722 return -EIO;
2723 }
2715 mutex_lock_nested(&inode->i_mutex, I_MUTEX_QUOTA); 2724 mutex_lock_nested(&inode->i_mutex, I_MUTEX_QUOTA);
2716 while (towrite > 0) { 2725 while (towrite > 0) {
2717 tocopy = sb->s_blocksize - offset < towrite ? 2726 tocopy = sb->s_blocksize - offset < towrite ?
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 4550b83ab1c9..3c1397fa83df 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -2698,8 +2698,11 @@ static int ext4_release_dquot(struct dquot *dquot)
2698 2698
2699 handle = ext4_journal_start(dquot_to_inode(dquot), 2699 handle = ext4_journal_start(dquot_to_inode(dquot),
2700 EXT4_QUOTA_DEL_BLOCKS(dquot->dq_sb)); 2700 EXT4_QUOTA_DEL_BLOCKS(dquot->dq_sb));
2701 if (IS_ERR(handle)) 2701 if (IS_ERR(handle)) {
2702 /* Release dquot anyway to avoid endless cycle in dqput() */
2703 dquot_release(dquot);
2702 return PTR_ERR(handle); 2704 return PTR_ERR(handle);
2705 }
2703 ret = dquot_release(dquot); 2706 ret = dquot_release(dquot);
2704 err = ext4_journal_stop(handle); 2707 err = ext4_journal_stop(handle);
2705 if (!ret) 2708 if (!ret)
@@ -2832,6 +2835,12 @@ static ssize_t ext4_quota_write(struct super_block *sb, int type,
2832 struct buffer_head *bh; 2835 struct buffer_head *bh;
2833 handle_t *handle = journal_current_handle(); 2836 handle_t *handle = journal_current_handle();
2834 2837
2838 if (!handle) {
2839 printk(KERN_WARNING "EXT4-fs: Quota write (off=%Lu, len=%Lu)"
2840 " cancelled because transaction is not started.\n",
2841 (unsigned long long)off, (unsigned long long)len);
2842 return -EIO;
2843 }
2835 mutex_lock_nested(&inode->i_mutex, I_MUTEX_QUOTA); 2844 mutex_lock_nested(&inode->i_mutex, I_MUTEX_QUOTA);
2836 while (towrite > 0) { 2845 while (towrite > 0) {
2837 tocopy = sb->s_blocksize - offset < towrite ? 2846 tocopy = sb->s_blocksize - offset < towrite ?
diff --git a/fs/locks.c b/fs/locks.c
index 50857d2d3404..c795eaaf6c4c 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -782,7 +782,7 @@ find_conflict:
782 if (request->fl_flags & FL_ACCESS) 782 if (request->fl_flags & FL_ACCESS)
783 goto out; 783 goto out;
784 locks_copy_lock(new_fl, request); 784 locks_copy_lock(new_fl, request);
785 locks_insert_lock(&inode->i_flock, new_fl); 785 locks_insert_lock(before, new_fl);
786 new_fl = NULL; 786 new_fl = NULL;
787 error = 0; 787 error = 0;
788 788
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
index 4f517665c9a0..778a850b4634 100644
--- a/fs/ocfs2/alloc.c
+++ b/fs/ocfs2/alloc.c
@@ -5602,6 +5602,7 @@ static int ocfs2_do_truncate(struct ocfs2_super *osb,
5602 clusters_to_del; 5602 clusters_to_del;
5603 spin_unlock(&OCFS2_I(inode)->ip_lock); 5603 spin_unlock(&OCFS2_I(inode)->ip_lock);
5604 le32_add_cpu(&fe->i_clusters, -clusters_to_del); 5604 le32_add_cpu(&fe->i_clusters, -clusters_to_del);
5605 inode->i_blocks = ocfs2_inode_sector_count(inode);
5605 5606
5606 status = ocfs2_trim_tree(inode, path, handle, tc, 5607 status = ocfs2_trim_tree(inode, path, handle, tc,
5607 clusters_to_del, &delete_blk); 5608 clusters_to_del, &delete_blk);
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
index 460d440310f2..50cd8a209012 100644
--- a/fs/ocfs2/aops.c
+++ b/fs/ocfs2/aops.c
@@ -855,6 +855,7 @@ static int ocfs2_alloc_write_ctxt(struct ocfs2_write_ctxt **wcp,
855 struct ocfs2_super *osb, loff_t pos, 855 struct ocfs2_super *osb, loff_t pos,
856 unsigned len, struct buffer_head *di_bh) 856 unsigned len, struct buffer_head *di_bh)
857{ 857{
858 u32 cend;
858 struct ocfs2_write_ctxt *wc; 859 struct ocfs2_write_ctxt *wc;
859 860
860 wc = kzalloc(sizeof(struct ocfs2_write_ctxt), GFP_NOFS); 861 wc = kzalloc(sizeof(struct ocfs2_write_ctxt), GFP_NOFS);
@@ -862,7 +863,8 @@ static int ocfs2_alloc_write_ctxt(struct ocfs2_write_ctxt **wcp,
862 return -ENOMEM; 863 return -ENOMEM;
863 864
864 wc->w_cpos = pos >> osb->s_clustersize_bits; 865 wc->w_cpos = pos >> osb->s_clustersize_bits;
865 wc->w_clen = ocfs2_clusters_for_bytes(osb->sb, len); 866 cend = (pos + len - 1) >> osb->s_clustersize_bits;
867 wc->w_clen = cend - wc->w_cpos + 1;
866 get_bh(di_bh); 868 get_bh(di_bh);
867 wc->w_di_bh = di_bh; 869 wc->w_di_bh = di_bh;
868 870
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 4ffa715be09c..7e34e66159c6 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -314,7 +314,6 @@ static int ocfs2_orphan_for_truncate(struct ocfs2_super *osb,
314 } 314 }
315 315
316 i_size_write(inode, new_i_size); 316 i_size_write(inode, new_i_size);
317 inode->i_blocks = ocfs2_align_bytes_to_sectors(new_i_size);
318 inode->i_ctime = inode->i_mtime = CURRENT_TIME; 317 inode->i_ctime = inode->i_mtime = CURRENT_TIME;
319 318
320 di = (struct ocfs2_dinode *) fe_bh->b_data; 319 di = (struct ocfs2_dinode *) fe_bh->b_data;
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index f2fc9a795deb..c034b5129c1e 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -81,8 +81,15 @@ static struct dentry *ocfs2_debugfs_root = NULL;
81MODULE_AUTHOR("Oracle"); 81MODULE_AUTHOR("Oracle");
82MODULE_LICENSE("GPL"); 82MODULE_LICENSE("GPL");
83 83
84struct mount_options
85{
86 unsigned long mount_opt;
87 unsigned int atime_quantum;
88 signed short slot;
89};
90
84static int ocfs2_parse_options(struct super_block *sb, char *options, 91static int ocfs2_parse_options(struct super_block *sb, char *options,
85 unsigned long *mount_opt, s16 *slot, 92 struct mount_options *mopt,
86 int is_remount); 93 int is_remount);
87static void ocfs2_put_super(struct super_block *sb); 94static void ocfs2_put_super(struct super_block *sb);
88static int ocfs2_mount_volume(struct super_block *sb); 95static int ocfs2_mount_volume(struct super_block *sb);
@@ -367,24 +374,23 @@ static int ocfs2_remount(struct super_block *sb, int *flags, char *data)
367{ 374{
368 int incompat_features; 375 int incompat_features;
369 int ret = 0; 376 int ret = 0;
370 unsigned long parsed_options; 377 struct mount_options parsed_options;
371 s16 slot;
372 struct ocfs2_super *osb = OCFS2_SB(sb); 378 struct ocfs2_super *osb = OCFS2_SB(sb);
373 379
374 if (!ocfs2_parse_options(sb, data, &parsed_options, &slot, 1)) { 380 if (!ocfs2_parse_options(sb, data, &parsed_options, 1)) {
375 ret = -EINVAL; 381 ret = -EINVAL;
376 goto out; 382 goto out;
377 } 383 }
378 384
379 if ((osb->s_mount_opt & OCFS2_MOUNT_HB_LOCAL) != 385 if ((osb->s_mount_opt & OCFS2_MOUNT_HB_LOCAL) !=
380 (parsed_options & OCFS2_MOUNT_HB_LOCAL)) { 386 (parsed_options.mount_opt & OCFS2_MOUNT_HB_LOCAL)) {
381 ret = -EINVAL; 387 ret = -EINVAL;
382 mlog(ML_ERROR, "Cannot change heartbeat mode on remount\n"); 388 mlog(ML_ERROR, "Cannot change heartbeat mode on remount\n");
383 goto out; 389 goto out;
384 } 390 }
385 391
386 if ((osb->s_mount_opt & OCFS2_MOUNT_DATA_WRITEBACK) != 392 if ((osb->s_mount_opt & OCFS2_MOUNT_DATA_WRITEBACK) !=
387 (parsed_options & OCFS2_MOUNT_DATA_WRITEBACK)) { 393 (parsed_options.mount_opt & OCFS2_MOUNT_DATA_WRITEBACK)) {
388 ret = -EINVAL; 394 ret = -EINVAL;
389 mlog(ML_ERROR, "Cannot change data mode on remount\n"); 395 mlog(ML_ERROR, "Cannot change data mode on remount\n");
390 goto out; 396 goto out;
@@ -435,7 +441,9 @@ unlock_osb:
435 441
436 /* Only save off the new mount options in case of a successful 442 /* Only save off the new mount options in case of a successful
437 * remount. */ 443 * remount. */
438 osb->s_mount_opt = parsed_options; 444 osb->s_mount_opt = parsed_options.mount_opt;
445 osb->s_atime_quantum = parsed_options.atime_quantum;
446 osb->preferred_slot = parsed_options.slot;
439 } 447 }
440out: 448out:
441 return ret; 449 return ret;
@@ -547,8 +555,7 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
547{ 555{
548 struct dentry *root; 556 struct dentry *root;
549 int status, sector_size; 557 int status, sector_size;
550 unsigned long parsed_opt; 558 struct mount_options parsed_options;
551 s16 slot;
552 struct inode *inode = NULL; 559 struct inode *inode = NULL;
553 struct ocfs2_super *osb = NULL; 560 struct ocfs2_super *osb = NULL;
554 struct buffer_head *bh = NULL; 561 struct buffer_head *bh = NULL;
@@ -556,14 +563,14 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
556 563
557 mlog_entry("%p, %p, %i", sb, data, silent); 564 mlog_entry("%p, %p, %i", sb, data, silent);
558 565
559 if (!ocfs2_parse_options(sb, data, &parsed_opt, &slot, 0)) { 566 if (!ocfs2_parse_options(sb, data, &parsed_options, 0)) {
560 status = -EINVAL; 567 status = -EINVAL;
561 goto read_super_error; 568 goto read_super_error;
562 } 569 }
563 570
564 /* for now we only have one cluster/node, make sure we see it 571 /* for now we only have one cluster/node, make sure we see it
565 * in the heartbeat universe */ 572 * in the heartbeat universe */
566 if (parsed_opt & OCFS2_MOUNT_HB_LOCAL) { 573 if (parsed_options.mount_opt & OCFS2_MOUNT_HB_LOCAL) {
567 if (!o2hb_check_local_node_heartbeating()) { 574 if (!o2hb_check_local_node_heartbeating()) {
568 status = -EINVAL; 575 status = -EINVAL;
569 goto read_super_error; 576 goto read_super_error;
@@ -585,8 +592,9 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
585 } 592 }
586 brelse(bh); 593 brelse(bh);
587 bh = NULL; 594 bh = NULL;
588 osb->s_mount_opt = parsed_opt; 595 osb->s_mount_opt = parsed_options.mount_opt;
589 osb->preferred_slot = slot; 596 osb->s_atime_quantum = parsed_options.atime_quantum;
597 osb->preferred_slot = parsed_options.slot;
590 598
591 sb->s_magic = OCFS2_SUPER_MAGIC; 599 sb->s_magic = OCFS2_SUPER_MAGIC;
592 600
@@ -728,8 +736,7 @@ static struct file_system_type ocfs2_fs_type = {
728 736
729static int ocfs2_parse_options(struct super_block *sb, 737static int ocfs2_parse_options(struct super_block *sb,
730 char *options, 738 char *options,
731 unsigned long *mount_opt, 739 struct mount_options *mopt,
732 s16 *slot,
733 int is_remount) 740 int is_remount)
734{ 741{
735 int status; 742 int status;
@@ -738,8 +745,9 @@ static int ocfs2_parse_options(struct super_block *sb,
738 mlog_entry("remount: %d, options: \"%s\"\n", is_remount, 745 mlog_entry("remount: %d, options: \"%s\"\n", is_remount,
739 options ? options : "(none)"); 746 options ? options : "(none)");
740 747
741 *mount_opt = 0; 748 mopt->mount_opt = 0;
742 *slot = OCFS2_INVALID_SLOT; 749 mopt->atime_quantum = OCFS2_DEFAULT_ATIME_QUANTUM;
750 mopt->slot = OCFS2_INVALID_SLOT;
743 751
744 if (!options) { 752 if (!options) {
745 status = 1; 753 status = 1;
@@ -749,7 +757,6 @@ static int ocfs2_parse_options(struct super_block *sb,
749 while ((p = strsep(&options, ",")) != NULL) { 757 while ((p = strsep(&options, ",")) != NULL) {
750 int token, option; 758 int token, option;
751 substring_t args[MAX_OPT_ARGS]; 759 substring_t args[MAX_OPT_ARGS];
752 struct ocfs2_super * osb = OCFS2_SB(sb);
753 760
754 if (!*p) 761 if (!*p)
755 continue; 762 continue;
@@ -757,10 +764,10 @@ static int ocfs2_parse_options(struct super_block *sb,
757 token = match_token(p, tokens, args); 764 token = match_token(p, tokens, args);
758 switch (token) { 765 switch (token) {
759 case Opt_hb_local: 766 case Opt_hb_local:
760 *mount_opt |= OCFS2_MOUNT_HB_LOCAL; 767 mopt->mount_opt |= OCFS2_MOUNT_HB_LOCAL;
761 break; 768 break;
762 case Opt_hb_none: 769 case Opt_hb_none:
763 *mount_opt &= ~OCFS2_MOUNT_HB_LOCAL; 770 mopt->mount_opt &= ~OCFS2_MOUNT_HB_LOCAL;
764 break; 771 break;
765 case Opt_barrier: 772 case Opt_barrier:
766 if (match_int(&args[0], &option)) { 773 if (match_int(&args[0], &option)) {
@@ -768,27 +775,27 @@ static int ocfs2_parse_options(struct super_block *sb,
768 goto bail; 775 goto bail;
769 } 776 }
770 if (option) 777 if (option)
771 *mount_opt |= OCFS2_MOUNT_BARRIER; 778 mopt->mount_opt |= OCFS2_MOUNT_BARRIER;
772 else 779 else
773 *mount_opt &= ~OCFS2_MOUNT_BARRIER; 780 mopt->mount_opt &= ~OCFS2_MOUNT_BARRIER;
774 break; 781 break;
775 case Opt_intr: 782 case Opt_intr:
776 *mount_opt &= ~OCFS2_MOUNT_NOINTR; 783 mopt->mount_opt &= ~OCFS2_MOUNT_NOINTR;
777 break; 784 break;
778 case Opt_nointr: 785 case Opt_nointr:
779 *mount_opt |= OCFS2_MOUNT_NOINTR; 786 mopt->mount_opt |= OCFS2_MOUNT_NOINTR;
780 break; 787 break;
781 case Opt_err_panic: 788 case Opt_err_panic:
782 *mount_opt |= OCFS2_MOUNT_ERRORS_PANIC; 789 mopt->mount_opt |= OCFS2_MOUNT_ERRORS_PANIC;
783 break; 790 break;
784 case Opt_err_ro: 791 case Opt_err_ro:
785 *mount_opt &= ~OCFS2_MOUNT_ERRORS_PANIC; 792 mopt->mount_opt &= ~OCFS2_MOUNT_ERRORS_PANIC;
786 break; 793 break;
787 case Opt_data_ordered: 794 case Opt_data_ordered:
788 *mount_opt &= ~OCFS2_MOUNT_DATA_WRITEBACK; 795 mopt->mount_opt &= ~OCFS2_MOUNT_DATA_WRITEBACK;
789 break; 796 break;
790 case Opt_data_writeback: 797 case Opt_data_writeback:
791 *mount_opt |= OCFS2_MOUNT_DATA_WRITEBACK; 798 mopt->mount_opt |= OCFS2_MOUNT_DATA_WRITEBACK;
792 break; 799 break;
793 case Opt_atime_quantum: 800 case Opt_atime_quantum:
794 if (match_int(&args[0], &option)) { 801 if (match_int(&args[0], &option)) {
@@ -796,9 +803,7 @@ static int ocfs2_parse_options(struct super_block *sb,
796 goto bail; 803 goto bail;
797 } 804 }
798 if (option >= 0) 805 if (option >= 0)
799 osb->s_atime_quantum = option; 806 mopt->atime_quantum = option;
800 else
801 osb->s_atime_quantum = OCFS2_DEFAULT_ATIME_QUANTUM;
802 break; 807 break;
803 case Opt_slot: 808 case Opt_slot:
804 option = 0; 809 option = 0;
@@ -807,7 +812,7 @@ static int ocfs2_parse_options(struct super_block *sb,
807 goto bail; 812 goto bail;
808 } 813 }
809 if (option) 814 if (option)
810 *slot = (s16)option; 815 mopt->slot = (s16)option;
811 break; 816 break;
812 default: 817 default:
813 mlog(ML_ERROR, 818 mlog(ML_ERROR,
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index a5b0dfd89a17..0e4d37c93eea 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -11,6 +11,7 @@
11#include <linux/string.h> 11#include <linux/string.h>
12#include <linux/stat.h> 12#include <linux/stat.h>
13#include <linux/completion.h> 13#include <linux/completion.h>
14#include <linux/poll.h>
14#include <linux/file.h> 15#include <linux/file.h>
15#include <linux/limits.h> 16#include <linux/limits.h>
16#include <linux/init.h> 17#include <linux/init.h>
@@ -232,7 +233,7 @@ static ssize_t proc_reg_write(struct file *file, const char __user *buf, size_t
232static unsigned int proc_reg_poll(struct file *file, struct poll_table_struct *pts) 233static unsigned int proc_reg_poll(struct file *file, struct poll_table_struct *pts)
233{ 234{
234 struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode); 235 struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode);
235 unsigned int rv = 0; 236 unsigned int rv = DEFAULT_POLLMASK;
236 unsigned int (*poll)(struct file *, struct poll_table_struct *); 237 unsigned int (*poll)(struct file *, struct poll_table_struct *);
237 238
238 spin_lock(&pde->pde_unload_lock); 239 spin_lock(&pde->pde_unload_lock);
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 5b68dd3f191a..a005451930b7 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -1915,8 +1915,11 @@ static int reiserfs_release_dquot(struct dquot *dquot)
1915 ret = 1915 ret =
1916 journal_begin(&th, dquot->dq_sb, 1916 journal_begin(&th, dquot->dq_sb,
1917 REISERFS_QUOTA_DEL_BLOCKS(dquot->dq_sb)); 1917 REISERFS_QUOTA_DEL_BLOCKS(dquot->dq_sb));
1918 if (ret) 1918 if (ret) {
1919 /* Release dquot anyway to avoid endless cycle in dqput() */
1920 dquot_release(dquot);
1919 goto out; 1921 goto out;
1922 }
1920 ret = dquot_release(dquot); 1923 ret = dquot_release(dquot);
1921 err = 1924 err =
1922 journal_end(&th, dquot->dq_sb, 1925 journal_end(&th, dquot->dq_sb,
@@ -2067,6 +2070,12 @@ static ssize_t reiserfs_quota_write(struct super_block *sb, int type,
2067 size_t towrite = len; 2070 size_t towrite = len;
2068 struct buffer_head tmp_bh, *bh; 2071 struct buffer_head tmp_bh, *bh;
2069 2072
2073 if (!current->journal_info) {
2074 printk(KERN_WARNING "reiserfs: Quota write (off=%Lu, len=%Lu)"
2075 " cancelled because transaction is not started.\n",
2076 (unsigned long long)off, (unsigned long long)len);
2077 return -EIO;
2078 }
2070 mutex_lock_nested(&inode->i_mutex, I_MUTEX_QUOTA); 2079 mutex_lock_nested(&inode->i_mutex, I_MUTEX_QUOTA);
2071 while (towrite > 0) { 2080 while (towrite > 0) {
2072 tocopy = sb->s_blocksize - offset < towrite ? 2081 tocopy = sb->s_blocksize - offset < towrite ?
@@ -2098,7 +2107,7 @@ static ssize_t reiserfs_quota_write(struct super_block *sb, int type,
2098 data += tocopy; 2107 data += tocopy;
2099 blk++; 2108 blk++;
2100 } 2109 }
2101 out: 2110out:
2102 if (len == towrite) 2111 if (len == towrite)
2103 return err; 2112 return err;
2104 if (inode->i_size < off + len - towrite) 2113 if (inode->i_size < off + len - towrite)
diff --git a/fs/select.c b/fs/select.c
index a974082b0824..46dca31c607a 100644
--- a/fs/select.c
+++ b/fs/select.c
@@ -26,8 +26,6 @@
26 26
27#include <asm/uaccess.h> 27#include <asm/uaccess.h>
28 28
29#define DEFAULT_POLLMASK (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM)
30
31struct poll_table_page { 29struct poll_table_page {
32 struct poll_table_page * next; 30 struct poll_table_page * next;
33 struct poll_table_entry * entry; 31 struct poll_table_entry * entry;
diff --git a/include/asm-generic/termios.h b/include/asm-generic/termios.h
index 3769e6bd63b1..33dca30a3c45 100644
--- a/include/asm-generic/termios.h
+++ b/include/asm-generic/termios.h
@@ -63,6 +63,8 @@ static inline int kernel_termios_to_user_termio(struct termio __user *termio,
63 63
64#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios)) 64#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios))
65#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios)) 65#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios))
66#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios))
67#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios))
66 68
67#endif /* __ARCH_TERMIO_GETPUT */ 69#endif /* __ARCH_TERMIO_GETPUT */
68 70
diff --git a/include/asm-m68k/unistd.h b/include/asm-m68k/unistd.h
index fdbb60e6a0d4..a30fe9c64143 100644
--- a/include/asm-m68k/unistd.h
+++ b/include/asm-m68k/unistd.h
@@ -313,10 +313,20 @@
313#define __NR_tee 308 313#define __NR_tee 308
314#define __NR_vmsplice 309 314#define __NR_vmsplice 309
315#define __NR_move_pages 310 315#define __NR_move_pages 310
316#define __NR_sched_setaffinity 311
317#define __NR_sched_getaffinity 312
318#define __NR_kexec_load 313
319#define __NR_getcpu 314
320#define __NR_epoll_pwait 315
321#define __NR_utimensat 316
322#define __NR_signalfd 317
323#define __NR_timerfd 318
324#define __NR_eventfd 319
325#define __NR_fallocate 320
316 326
317#ifdef __KERNEL__ 327#ifdef __KERNEL__
318 328
319#define NR_syscalls 311 329#define NR_syscalls 321
320 330
321#define __ARCH_WANT_IPC_PARSE_VERSION 331#define __ARCH_WANT_IPC_PARSE_VERSION
322#define __ARCH_WANT_OLD_READDIR 332#define __ARCH_WANT_OLD_READDIR
diff --git a/include/asm-m68knommu/unistd.h b/include/asm-m68knommu/unistd.h
index 82e03195f325..eb1b566793fe 100644
--- a/include/asm-m68knommu/unistd.h
+++ b/include/asm-m68knommu/unistd.h
@@ -314,10 +314,20 @@
314#define __NR_tee 308 314#define __NR_tee 308
315#define __NR_vmsplice 309 315#define __NR_vmsplice 309
316#define __NR_move_pages 310 316#define __NR_move_pages 310
317#define __NR_sched_setaffinity 311
318#define __NR_sched_getaffinity 312
319#define __NR_kexec_load 313
320#define __NR_getcpu 314
321#define __NR_epoll_pwait 315
322#define __NR_utimensat 316
323#define __NR_signalfd 317
324#define __NR_timerfd 318
325#define __NR_eventfd 319
326#define __NR_fallocate 320
317 327
318#ifdef __KERNEL__ 328#ifdef __KERNEL__
319 329
320#define NR_syscalls 311 330#define NR_syscalls 321
321 331
322#define __ARCH_WANT_IPC_PARSE_VERSION 332#define __ARCH_WANT_IPC_PARSE_VERSION
323#define __ARCH_WANT_OLD_READDIR 333#define __ARCH_WANT_OLD_READDIR
diff --git a/include/asm-mips/mach-generic/ide.h b/include/asm-mips/mach-generic/ide.h
index 2b928577be5d..a77128362a7d 100644
--- a/include/asm-mips/mach-generic/ide.h
+++ b/include/asm-mips/mach-generic/ide.h
@@ -29,6 +29,35 @@
29 29
30#define IDE_ARCH_OBSOLETE_DEFAULTS 30#define IDE_ARCH_OBSOLETE_DEFAULTS
31 31
32static __inline__ int ide_probe_legacy(void)
33{
34#ifdef CONFIG_PCI
35 struct pci_dev *dev;
36 /*
37 * This can be called on the ide_setup() path, super-early in
38 * boot. But the down_read() will enable local interrupts,
39 * which can cause some machines to crash. So here we detect
40 * and flag that situation and bail out early.
41 */
42 if (no_pci_devices())
43 return 0;
44 dev = pci_get_class(PCI_CLASS_BRIDGE_EISA << 8, NULL);
45 if (dev)
46 goto found;
47 dev = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, NULL);
48 if (dev)
49 goto found;
50 return 0;
51found:
52 pci_dev_put(dev);
53 return 1;
54#elif defined(CONFIG_EISA) || defined(CONFIG_ISA)
55 return 1;
56#else
57 return 0;
58#endif
59}
60
32static __inline__ int ide_default_irq(unsigned long base) 61static __inline__ int ide_default_irq(unsigned long base)
33{ 62{
34 switch (base) { 63 switch (base) {
@@ -45,6 +74,8 @@ static __inline__ int ide_default_irq(unsigned long base)
45 74
46static __inline__ unsigned long ide_default_io_base(int index) 75static __inline__ unsigned long ide_default_io_base(int index)
47{ 76{
77 if (!ide_probe_legacy())
78 return 0;
48 /* 79 /*
49 * If PCI is present then it is not safe to poke around 80 * If PCI is present then it is not safe to poke around
50 * the other legacy IDE ports. Only 0x1f0 and 0x170 are 81 * the other legacy IDE ports. Only 0x1f0 and 0x170 are
diff --git a/include/asm-mips/sibyte/bcm1480_regs.h b/include/asm-mips/sibyte/bcm1480_regs.h
index 2738c1366f66..c34d36b6b8c2 100644
--- a/include/asm-mips/sibyte/bcm1480_regs.h
+++ b/include/asm-mips/sibyte/bcm1480_regs.h
@@ -227,10 +227,15 @@
227 (A_BCM1480_DUART(chan) + \ 227 (A_BCM1480_DUART(chan) + \
228 BCM1480_DUART_CHANREG_SPACING * 3 + (reg)) 228 BCM1480_DUART_CHANREG_SPACING * 3 + (reg))
229 229
230#define DUART_IMRISR_SPACING 0x20
231#define DUART_INCHNG_SPACING 0x10
232
230#define R_BCM1480_DUART_IMRREG(chan) \ 233#define R_BCM1480_DUART_IMRREG(chan) \
231 (R_DUART_IMR_A + ((chan) & 1) * DUART_IMRISR_SPACING) 234 (R_DUART_IMR_A + ((chan) & 1) * DUART_IMRISR_SPACING)
232#define R_BCM1480_DUART_ISRREG(chan) \ 235#define R_BCM1480_DUART_ISRREG(chan) \
233 (R_DUART_ISR_A + ((chan) & 1) * DUART_IMRISR_SPACING) 236 (R_DUART_ISR_A + ((chan) & 1) * DUART_IMRISR_SPACING)
237#define R_BCM1480_DUART_INCHREG(chan) \
238 (R_DUART_IN_CHNG_A + ((chan) & 1) * DUART_INCHNG_SPACING)
234 239
235#define A_BCM1480_DUART_IMRREG(chan) \ 240#define A_BCM1480_DUART_IMRREG(chan) \
236 (A_BCM1480_DUART_CTRLREG((chan), R_BCM1480_DUART_IMRREG(chan))) 241 (A_BCM1480_DUART_CTRLREG((chan), R_BCM1480_DUART_IMRREG(chan)))
diff --git a/include/linux/aer.h b/include/linux/aer.h
index 509656286e53..bcf236d825e8 100644
--- a/include/linux/aer.h
+++ b/include/linux/aer.h
@@ -15,11 +15,26 @@ extern int pci_disable_pcie_error_reporting(struct pci_dev *dev);
15extern int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev); 15extern int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev);
16extern int pci_cleanup_aer_correct_error_status(struct pci_dev *dev); 16extern int pci_cleanup_aer_correct_error_status(struct pci_dev *dev);
17#else 17#else
18#define pci_enable_pcie_error_reporting(dev) (-EINVAL) 18static inline int pci_enable_pcie_error_reporting(struct pci_dev *dev)
19#define pci_find_aer_capability(dev) (0) 19{
20#define pci_disable_pcie_error_reporting(dev) (-EINVAL) 20 return -EINVAL;
21#define pci_cleanup_aer_uncorrect_error_status(dev) (-EINVAL) 21}
22#define pci_cleanup_aer_correct_error_status(dev) (-EINVAL) 22static inline int pci_find_aer_capability(struct pci_dev *dev)
23{
24 return 0;
25}
26static inline int pci_disable_pcie_error_reporting(struct pci_dev *dev)
27{
28 return -EINVAL;
29}
30static inline int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev)
31{
32 return -EINVAL;
33}
34static inline int pci_cleanup_aer_correct_error_status(struct pci_dev *dev)
35{
36 return -EINVAL;
37}
23#endif 38#endif
24 39
25#endif //_AER_H_ 40#endif //_AER_H_
diff --git a/include/linux/ide.h b/include/linux/ide.h
index c792b4fd1588..b9f66c10caa0 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1378,6 +1378,19 @@ static inline int ide_dev_has_iordy(struct hd_driveid *id)
1378 return ((id->field_valid & 2) && (id->capability & 8)) ? 1 : 0; 1378 return ((id->field_valid & 2) && (id->capability & 8)) ? 1 : 0;
1379} 1379}
1380 1380
1381static inline int ide_dev_is_sata(struct hd_driveid *id)
1382{
1383 /*
1384 * See if word 93 is 0 AND drive is at least ATA-5 compatible
1385 * verifying that word 80 by casting it to a signed type --
1386 * this trick allows us to filter out the reserved values of
1387 * 0x0000 and 0xffff along with the earlier ATA revisions...
1388 */
1389 if (id->hw_config == 0 && (short)id->major_rev_num >= 0x0020)
1390 return 1;
1391 return 0;
1392}
1393
1381u8 ide_dump_status(ide_drive_t *, const char *, u8); 1394u8 ide_dump_status(ide_drive_t *, const char *, u8);
1382 1395
1383typedef struct ide_pio_timings_s { 1396typedef struct ide_pio_timings_s {
diff --git a/include/linux/input.h b/include/linux/input.h
index cf2b5619aa13..36e00aa6f03b 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -558,6 +558,8 @@ struct input_absinfo {
558#define KEY_BRL_DOT6 0x1f6 558#define KEY_BRL_DOT6 0x1f6
559#define KEY_BRL_DOT7 0x1f7 559#define KEY_BRL_DOT7 0x1f7
560#define KEY_BRL_DOT8 0x1f8 560#define KEY_BRL_DOT8 0x1f8
561#define KEY_BRL_DOT9 0x1f9
562#define KEY_BRL_DOT10 0x1fa
561 563
562/* We avoid low common keys in module aliases so they don't get huge. */ 564/* We avoid low common keys in module aliases so they don't get huge. */
563#define KEY_MIN_INTERESTING KEY_MUTE 565#define KEY_MIN_INTERESTING KEY_MUTE
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index f592df74b3cf..47160fe378c9 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -34,6 +34,7 @@ extern const char linux_proc_banner[];
34 34
35#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1) 35#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1)
36#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask)) 36#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
37#define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a)))
37 38
38#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) 39#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
39 40
diff --git a/include/linux/keyboard.h b/include/linux/keyboard.h
index de76843bbe8a..7ddbc30aa8e7 100644
--- a/include/linux/keyboard.h
+++ b/include/linux/keyboard.h
@@ -437,8 +437,10 @@ extern unsigned short plain_map[NR_KEYS];
437#define K_BRL_DOT6 K(KT_BRL, 6) 437#define K_BRL_DOT6 K(KT_BRL, 6)
438#define K_BRL_DOT7 K(KT_BRL, 7) 438#define K_BRL_DOT7 K(KT_BRL, 7)
439#define K_BRL_DOT8 K(KT_BRL, 8) 439#define K_BRL_DOT8 K(KT_BRL, 8)
440#define K_BRL_DOT9 K(KT_BRL, 9)
441#define K_BRL_DOT10 K(KT_BRL, 10)
440 442
441#define NR_BRL 9 443#define NR_BRL 11
442 444
443#define MAX_DIACR 256 445#define MAX_DIACR 256
444#endif 446#endif
diff --git a/include/linux/leds.h b/include/linux/leds.h
index 421175092ee2..dc1178f6184b 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -13,6 +13,7 @@
13#define __LINUX_LEDS_H_INCLUDED 13#define __LINUX_LEDS_H_INCLUDED
14 14
15#include <linux/list.h> 15#include <linux/list.h>
16#include <linux/spinlock.h>
16 17
17struct device; 18struct device;
18/* 19/*
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index 0eed0b7ab2df..1dd075eda595 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -88,9 +88,8 @@ struct nf_sockopt_ops
88 int (*compat_get)(struct sock *sk, int optval, 88 int (*compat_get)(struct sock *sk, int optval,
89 void __user *user, int *len); 89 void __user *user, int *len);
90 90
91 /* Number of users inside set() or get(). */ 91 /* Use the module struct to lock set/get code in place */
92 unsigned int use; 92 struct module *owner;
93 struct task_struct *cleanup_task;
94}; 93};
95 94
96/* Each queued (to userspace) skbuff has one of these. */ 95/* Each queued (to userspace) skbuff has one of these. */
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index d41747b9fd15..55f307ffbf96 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2293,6 +2293,8 @@
2293#define PCI_DEVICE_ID_INTEL_MCH_PC 0x3599 2293#define PCI_DEVICE_ID_INTEL_MCH_PC 0x3599
2294#define PCI_DEVICE_ID_INTEL_MCH_PC1 0x359a 2294#define PCI_DEVICE_ID_INTEL_MCH_PC1 0x359a
2295#define PCI_DEVICE_ID_INTEL_E7525_MCH 0x359e 2295#define PCI_DEVICE_ID_INTEL_E7525_MCH 0x359e
2296#define PCI_DEVICE_ID_INTEL_TOLAPAI_0 0x5031
2297#define PCI_DEVICE_ID_INTEL_TOLAPAI_1 0x5032
2296#define PCI_DEVICE_ID_INTEL_82371SB_0 0x7000 2298#define PCI_DEVICE_ID_INTEL_82371SB_0 0x7000
2297#define PCI_DEVICE_ID_INTEL_82371SB_1 0x7010 2299#define PCI_DEVICE_ID_INTEL_82371SB_1 0x7010
2298#define PCI_DEVICE_ID_INTEL_82371SB_2 0x7020 2300#define PCI_DEVICE_ID_INTEL_82371SB_2 0x7020
diff --git a/include/linux/poll.h b/include/linux/poll.h
index 27690798623f..16d813b364ef 100644
--- a/include/linux/poll.h
+++ b/include/linux/poll.h
@@ -21,6 +21,8 @@
21#define WQUEUES_STACK_ALLOC (MAX_STACK_ALLOC - FRONTEND_STACK_ALLOC) 21#define WQUEUES_STACK_ALLOC (MAX_STACK_ALLOC - FRONTEND_STACK_ALLOC)
22#define N_INLINE_POLL_ENTRIES (WQUEUES_STACK_ALLOC / sizeof(struct poll_table_entry)) 22#define N_INLINE_POLL_ENTRIES (WQUEUES_STACK_ALLOC / sizeof(struct poll_table_entry))
23 23
24#define DEFAULT_POLLMASK (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM)
25
24struct poll_table_struct; 26struct poll_table_struct;
25 27
26/* 28/*
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h
index d62847f846c2..17f8f3a2f0a3 100644
--- a/include/media/v4l2-dev.h
+++ b/include/media/v4l2-dev.h
@@ -337,6 +337,9 @@ void *priv;
337 struct class_device class_dev; /* sysfs */ 337 struct class_device class_dev; /* sysfs */
338}; 338};
339 339
340/* Class-dev to video-device */
341#define to_video_device(cd) container_of(cd, struct video_device, class_dev)
342
340/* Version 2 functions */ 343/* Version 2 functions */
341extern int video_register_device(struct video_device *vfd, int type, int nr); 344extern int video_register_device(struct video_device *vfd, int type, int nr);
342void video_unregister_device(struct video_device *); 345void video_unregister_device(struct video_device *);
@@ -354,11 +357,9 @@ extern int video_usercopy(struct inode *inode, struct file *file,
354 int (*func)(struct inode *inode, struct file *file, 357 int (*func)(struct inode *inode, struct file *file,
355 unsigned int cmd, void *arg)); 358 unsigned int cmd, void *arg));
356 359
357
358#ifdef CONFIG_VIDEO_V4L1_COMPAT 360#ifdef CONFIG_VIDEO_V4L1_COMPAT
359#include <linux/mm.h> 361#include <linux/mm.h>
360 362
361#define to_video_device(cd) container_of(cd, struct video_device, class_dev)
362static inline int __must_check 363static inline int __must_check
363video_device_create_file(struct video_device *vfd, 364video_device_create_file(struct video_device *vfd,
364 struct class_device_attribute *attr) 365 struct class_device_attribute *attr)
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h
index 007d442412e2..b4b31132618b 100644
--- a/include/scsi/libiscsi.h
+++ b/include/scsi/libiscsi.h
@@ -205,6 +205,13 @@ struct iscsi_queue {
205}; 205};
206 206
207struct iscsi_session { 207struct iscsi_session {
208 /*
209 * Syncs up the scsi eh thread with the iscsi eh thread when sending
210 * task management functions. This must be taken before the session
211 * and recv lock.
212 */
213 struct mutex eh_mutex;
214
208 /* iSCSI session-wide sequencing */ 215 /* iSCSI session-wide sequencing */
209 uint32_t cmdsn; 216 uint32_t cmdsn;
210 uint32_t exp_cmdsn; 217 uint32_t exp_cmdsn;
diff --git a/kernel/futex_compat.c b/kernel/futex_compat.c
index f7921360efad..7e52eb051f22 100644
--- a/kernel/futex_compat.c
+++ b/kernel/futex_compat.c
@@ -61,10 +61,10 @@ void compat_exit_robust_list(struct task_struct *curr)
61 if (fetch_robust_entry(&upending, &pending, 61 if (fetch_robust_entry(&upending, &pending,
62 &head->list_op_pending, &pip)) 62 &head->list_op_pending, &pip))
63 return; 63 return;
64 if (upending) 64 if (pending)
65 handle_futex_death((void __user *)pending + futex_offset, curr, pip); 65 handle_futex_death((void __user *)pending + futex_offset, curr, pip);
66 66
67 while (compat_ptr(uentry) != &head->list) { 67 while (entry != (struct robust_list __user *) &head->list) {
68 /* 68 /*
69 * A pending lock might already be on the list, so 69 * A pending lock might already be on the list, so
70 * dont process it twice: 70 * dont process it twice:
diff --git a/kernel/kmod.c b/kernel/kmod.c
index 9809cc1f33d6..c6a4f8aebeba 100644
--- a/kernel/kmod.c
+++ b/kernel/kmod.c
@@ -505,7 +505,7 @@ int call_usermodehelper_pipe(char *path, char **argv, char **envp,
505 if (ret < 0) 505 if (ret < 0)
506 goto out; 506 goto out;
507 507
508 return call_usermodehelper_exec(sub_info, 1); 508 return call_usermodehelper_exec(sub_info, UMH_WAIT_EXEC);
509 509
510 out: 510 out:
511 call_usermodehelper_freeinfo(sub_info); 511 call_usermodehelper_freeinfo(sub_info);
diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c
index cd91237dbfe3..de6a2d6b3ebb 100644
--- a/kernel/time/ntp.c
+++ b/kernel/time/ntp.c
@@ -226,7 +226,7 @@ static void sync_cmos_clock(unsigned long dummy)
226 226
227static void notify_cmos_timer(void) 227static void notify_cmos_timer(void)
228{ 228{
229 if (no_sync_cmos_clock) 229 if (!no_sync_cmos_clock)
230 mod_timer(&sync_cmos_timer, jiffies + 1); 230 mod_timer(&sync_cmos_timer, jiffies + 1);
231} 231}
232 232
diff --git a/mm/slub.c b/mm/slub.c
index 7defe84e6bd0..addb20a6d67d 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -986,7 +986,9 @@ out:
986 986
987__setup("slub_debug", setup_slub_debug); 987__setup("slub_debug", setup_slub_debug);
988 988
989static void kmem_cache_open_debug_check(struct kmem_cache *s) 989static unsigned long kmem_cache_flags(unsigned long objsize,
990 unsigned long flags, const char *name,
991 void (*ctor)(void *, struct kmem_cache *, unsigned long))
990{ 992{
991 /* 993 /*
992 * The page->offset field is only 16 bit wide. This is an offset 994 * The page->offset field is only 16 bit wide. This is an offset
@@ -1000,19 +1002,21 @@ static void kmem_cache_open_debug_check(struct kmem_cache *s)
1000 * Debugging or ctor may create a need to move the free 1002 * Debugging or ctor may create a need to move the free
1001 * pointer. Fail if this happens. 1003 * pointer. Fail if this happens.
1002 */ 1004 */
1003 if (s->objsize >= 65535 * sizeof(void *)) { 1005 if (objsize >= 65535 * sizeof(void *)) {
1004 BUG_ON(s->flags & (SLAB_RED_ZONE | SLAB_POISON | 1006 BUG_ON(flags & (SLAB_RED_ZONE | SLAB_POISON |
1005 SLAB_STORE_USER | SLAB_DESTROY_BY_RCU)); 1007 SLAB_STORE_USER | SLAB_DESTROY_BY_RCU));
1006 BUG_ON(s->ctor); 1008 BUG_ON(ctor);
1007 } 1009 } else {
1008 else
1009 /* 1010 /*
1010 * Enable debugging if selected on the kernel commandline. 1011 * Enable debugging if selected on the kernel commandline.
1011 */ 1012 */
1012 if (slub_debug && (!slub_debug_slabs || 1013 if (slub_debug && (!slub_debug_slabs ||
1013 strncmp(slub_debug_slabs, s->name, 1014 strncmp(slub_debug_slabs, name,
1014 strlen(slub_debug_slabs)) == 0)) 1015 strlen(slub_debug_slabs)) == 0))
1015 s->flags |= slub_debug; 1016 flags |= slub_debug;
1017 }
1018
1019 return flags;
1016} 1020}
1017#else 1021#else
1018static inline void setup_object_debug(struct kmem_cache *s, 1022static inline void setup_object_debug(struct kmem_cache *s,
@@ -1029,7 +1033,12 @@ static inline int slab_pad_check(struct kmem_cache *s, struct page *page)
1029static inline int check_object(struct kmem_cache *s, struct page *page, 1033static inline int check_object(struct kmem_cache *s, struct page *page,
1030 void *object, int active) { return 1; } 1034 void *object, int active) { return 1; }
1031static inline void add_full(struct kmem_cache_node *n, struct page *page) {} 1035static inline void add_full(struct kmem_cache_node *n, struct page *page) {}
1032static inline void kmem_cache_open_debug_check(struct kmem_cache *s) {} 1036static inline unsigned long kmem_cache_flags(unsigned long objsize,
1037 unsigned long flags, const char *name,
1038 void (*ctor)(void *, struct kmem_cache *, unsigned long))
1039{
1040 return flags;
1041}
1033#define slub_debug 0 1042#define slub_debug 0
1034#endif 1043#endif
1035/* 1044/*
@@ -2088,9 +2097,8 @@ static int kmem_cache_open(struct kmem_cache *s, gfp_t gfpflags,
2088 s->name = name; 2097 s->name = name;
2089 s->ctor = ctor; 2098 s->ctor = ctor;
2090 s->objsize = size; 2099 s->objsize = size;
2091 s->flags = flags;
2092 s->align = align; 2100 s->align = align;
2093 kmem_cache_open_debug_check(s); 2101 s->flags = kmem_cache_flags(size, flags, name, ctor);
2094 2102
2095 if (!calculate_sizes(s)) 2103 if (!calculate_sizes(s))
2096 goto error; 2104 goto error;
@@ -2660,7 +2668,7 @@ static int slab_unmergeable(struct kmem_cache *s)
2660} 2668}
2661 2669
2662static struct kmem_cache *find_mergeable(size_t size, 2670static struct kmem_cache *find_mergeable(size_t size,
2663 size_t align, unsigned long flags, 2671 size_t align, unsigned long flags, const char *name,
2664 void (*ctor)(void *, struct kmem_cache *, unsigned long)) 2672 void (*ctor)(void *, struct kmem_cache *, unsigned long))
2665{ 2673{
2666 struct kmem_cache *s; 2674 struct kmem_cache *s;
@@ -2674,6 +2682,7 @@ static struct kmem_cache *find_mergeable(size_t size,
2674 size = ALIGN(size, sizeof(void *)); 2682 size = ALIGN(size, sizeof(void *));
2675 align = calculate_alignment(flags, align, size); 2683 align = calculate_alignment(flags, align, size);
2676 size = ALIGN(size, align); 2684 size = ALIGN(size, align);
2685 flags = kmem_cache_flags(size, flags, name, NULL);
2677 2686
2678 list_for_each_entry(s, &slab_caches, list) { 2687 list_for_each_entry(s, &slab_caches, list) {
2679 if (slab_unmergeable(s)) 2688 if (slab_unmergeable(s))
@@ -2682,8 +2691,7 @@ static struct kmem_cache *find_mergeable(size_t size,
2682 if (size > s->size) 2691 if (size > s->size)
2683 continue; 2692 continue;
2684 2693
2685 if (((flags | slub_debug) & SLUB_MERGE_SAME) != 2694 if ((flags & SLUB_MERGE_SAME) != (s->flags & SLUB_MERGE_SAME))
2686 (s->flags & SLUB_MERGE_SAME))
2687 continue; 2695 continue;
2688 /* 2696 /*
2689 * Check if alignment is compatible. 2697 * Check if alignment is compatible.
@@ -2707,7 +2715,7 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size,
2707 struct kmem_cache *s; 2715 struct kmem_cache *s;
2708 2716
2709 down_write(&slub_lock); 2717 down_write(&slub_lock);
2710 s = find_mergeable(size, align, flags, ctor); 2718 s = find_mergeable(size, align, flags, name, ctor);
2711 if (s) { 2719 if (s) {
2712 s->refcount++; 2720 s->refcount++;
2713 /* 2721 /*
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 63caa414945d..18e3afc964df 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -183,6 +183,7 @@ static void hci_init_req(struct hci_dev *hdev, unsigned long opt)
183{ 183{
184 struct sk_buff *skb; 184 struct sk_buff *skb;
185 __le16 param; 185 __le16 param;
186 __u8 flt_type;
186 187
187 BT_DBG("%s %ld", hdev->name, opt); 188 BT_DBG("%s %ld", hdev->name, opt);
188 189
@@ -233,11 +234,8 @@ static void hci_init_req(struct hci_dev *hdev, unsigned long opt)
233 /* Optional initialization */ 234 /* Optional initialization */
234 235
235 /* Clear Event Filters */ 236 /* Clear Event Filters */
236 { 237 flt_type = HCI_FLT_CLEAR_ALL;
237 struct hci_cp_set_event_flt cp; 238 hci_send_cmd(hdev, OGF_HOST_CTL, OCF_SET_EVENT_FLT, 1, &flt_type);
238 cp.flt_type = HCI_FLT_CLEAR_ALL;
239 hci_send_cmd(hdev, OGF_HOST_CTL, OCF_SET_EVENT_FLT, sizeof(cp), &cp);
240 }
241 239
242 /* Page timeout ~20 secs */ 240 /* Page timeout ~20 secs */
243 param = cpu_to_le16(0x8000); 241 param = cpu_to_le16(0x8000);
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index 1dae3dfc66a9..5ccea5fbd236 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -37,6 +37,7 @@
37#include <linux/skbuff.h> 37#include <linux/skbuff.h>
38#include <linux/workqueue.h> 38#include <linux/workqueue.h>
39#include <linux/interrupt.h> 39#include <linux/interrupt.h>
40#include <linux/compat.h>
40#include <linux/socket.h> 41#include <linux/socket.h>
41#include <linux/ioctl.h> 42#include <linux/ioctl.h>
42#include <net/sock.h> 43#include <net/sock.h>
@@ -70,15 +71,15 @@ static struct hci_sec_filter hci_sec_filter = {
70 { 71 {
71 { 0x0 }, 72 { 0x0 },
72 /* OGF_LINK_CTL */ 73 /* OGF_LINK_CTL */
73 { 0xbe000006, 0x00000001, 0x000000, 0x00 }, 74 { 0xbe000006, 0x00000001, 0x00000000, 0x00 },
74 /* OGF_LINK_POLICY */ 75 /* OGF_LINK_POLICY */
75 { 0x00005200, 0x00000000, 0x000000, 0x00 }, 76 { 0x00005200, 0x00000000, 0x00000000, 0x00 },
76 /* OGF_HOST_CTL */ 77 /* OGF_HOST_CTL */
77 { 0xaab00200, 0x2b402aaa, 0x020154, 0x00 }, 78 { 0xaab00200, 0x2b402aaa, 0x05220154, 0x00 },
78 /* OGF_INFO_PARAM */ 79 /* OGF_INFO_PARAM */
79 { 0x000002be, 0x00000000, 0x000000, 0x00 }, 80 { 0x000002be, 0x00000000, 0x00000000, 0x00 },
80 /* OGF_STATUS_PARAM */ 81 /* OGF_STATUS_PARAM */
81 { 0x000000ea, 0x00000000, 0x000000, 0x00 } 82 { 0x000000ea, 0x00000000, 0x00000000, 0x00 }
82 } 83 }
83}; 84};
84 85
@@ -342,9 +343,24 @@ static inline void hci_sock_cmsg(struct sock *sk, struct msghdr *msg, struct sk_
342 343
343 if (mask & HCI_CMSG_TSTAMP) { 344 if (mask & HCI_CMSG_TSTAMP) {
344 struct timeval tv; 345 struct timeval tv;
346 void *data;
347 int len;
345 348
346 skb_get_timestamp(skb, &tv); 349 skb_get_timestamp(skb, &tv);
347 put_cmsg(msg, SOL_HCI, HCI_CMSG_TSTAMP, sizeof(tv), &tv); 350
351 data = &tv;
352 len = sizeof(tv);
353#ifdef CONFIG_COMPAT
354 if (msg->msg_flags & MSG_CMSG_COMPAT) {
355 struct compat_timeval ctv;
356 ctv.tv_sec = tv.tv_sec;
357 ctv.tv_usec = tv.tv_usec;
358 data = &ctv;
359 len = sizeof(ctv);
360 }
361#endif
362
363 put_cmsg(msg, SOL_HCI, HCI_CMSG_TSTAMP, len, data);
348 } 364 }
349} 365}
350 366
diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
index 4169a2a89a39..6018d0e51938 100644
--- a/net/bridge/netfilter/ebtables.c
+++ b/net/bridge/netfilter/ebtables.c
@@ -1513,6 +1513,7 @@ static struct nf_sockopt_ops ebt_sockopts =
1513 .get_optmin = EBT_BASE_CTL, 1513 .get_optmin = EBT_BASE_CTL,
1514 .get_optmax = EBT_SO_GET_MAX + 1, 1514 .get_optmax = EBT_SO_GET_MAX + 1,
1515 .get = do_ebt_get_ctl, 1515 .get = do_ebt_get_ctl,
1516 .owner = THIS_MODULE,
1516}; 1517};
1517 1518
1518static int __init ebtables_init(void) 1519static int __init ebtables_init(void)
diff --git a/net/core/datagram.c b/net/core/datagram.c
index cb056f476126..029b93e246b4 100644
--- a/net/core/datagram.c
+++ b/net/core/datagram.c
@@ -450,6 +450,9 @@ int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb,
450 __wsum csum; 450 __wsum csum;
451 int chunk = skb->len - hlen; 451 int chunk = skb->len - hlen;
452 452
453 if (!chunk)
454 return 0;
455
453 /* Skip filled elements. 456 /* Skip filled elements.
454 * Pretty silly, look at memcpy_toiovec, though 8) 457 * Pretty silly, look at memcpy_toiovec, though 8)
455 */ 458 */
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c
index fa6604fcf0e7..8def68209edd 100644
--- a/net/decnet/dn_dev.c
+++ b/net/decnet/dn_dev.c
@@ -814,7 +814,7 @@ static int dn_nl_dump_ifaddr(struct sk_buff *skb, struct netlink_callback *cb)
814 for (ifa = dn_db->ifa_list, dn_idx = 0; ifa; 814 for (ifa = dn_db->ifa_list, dn_idx = 0; ifa;
815 ifa = ifa->ifa_next, dn_idx++) { 815 ifa = ifa->ifa_next, dn_idx++) {
816 if (dn_idx < skip_naddr) 816 if (dn_idx < skip_naddr)
817 goto cont; 817 continue;
818 818
819 if (dn_nl_fill_ifaddr(skb, ifa, NETLINK_CB(cb->skb).pid, 819 if (dn_nl_fill_ifaddr(skb, ifa, NETLINK_CB(cb->skb).pid,
820 cb->nlh->nlmsg_seq, RTM_NEWADDR, 820 cb->nlh->nlmsg_seq, RTM_NEWADDR,
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 5b77bdaa57dd..5dbe5803b7d5 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -1193,7 +1193,7 @@ static int inet_dump_ifaddr(struct sk_buff *skb, struct netlink_callback *cb)
1193 for (ifa = in_dev->ifa_list, ip_idx = 0; ifa; 1193 for (ifa = in_dev->ifa_list, ip_idx = 0; ifa;
1194 ifa = ifa->ifa_next, ip_idx++) { 1194 ifa = ifa->ifa_next, ip_idx++) {
1195 if (ip_idx < s_ip_idx) 1195 if (ip_idx < s_ip_idx)
1196 goto cont; 1196 continue;
1197 if (inet_fill_ifaddr(skb, ifa, NETLINK_CB(cb->skb).pid, 1197 if (inet_fill_ifaddr(skb, ifa, NETLINK_CB(cb->skb).pid,
1198 cb->nlh->nlmsg_seq, 1198 cb->nlh->nlmsg_seq,
1199 RTM_NEWADDR, NLM_F_MULTI) <= 0) 1199 RTM_NEWADDR, NLM_F_MULTI) <= 0)
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
index dbeacd8b0f90..def007ec1d6f 100644
--- a/net/ipv4/inet_diag.c
+++ b/net/ipv4/inet_diag.c
@@ -836,12 +836,16 @@ static int inet_diag_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
836 return inet_diag_get_exact(skb, nlh); 836 return inet_diag_get_exact(skb, nlh);
837} 837}
838 838
839static DEFINE_MUTEX(inet_diag_mutex);
840
839static void inet_diag_rcv(struct sock *sk, int len) 841static void inet_diag_rcv(struct sock *sk, int len)
840{ 842{
841 unsigned int qlen = 0; 843 unsigned int qlen = 0;
842 844
843 do { 845 do {
846 mutex_lock(&inet_diag_mutex);
844 netlink_run_queue(sk, &qlen, &inet_diag_rcv_msg); 847 netlink_run_queue(sk, &qlen, &inet_diag_rcv_msg);
848 mutex_unlock(&inet_diag_mutex);
845 } while (qlen); 849 } while (qlen);
846} 850}
847 851
diff --git a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c
index 902fd578aa3c..f656d41d8d41 100644
--- a/net/ipv4/ipvs/ip_vs_ctl.c
+++ b/net/ipv4/ipvs/ip_vs_ctl.c
@@ -2339,6 +2339,7 @@ static struct nf_sockopt_ops ip_vs_sockopts = {
2339 .get_optmin = IP_VS_BASE_CTL, 2339 .get_optmin = IP_VS_BASE_CTL,
2340 .get_optmax = IP_VS_SO_GET_MAX+1, 2340 .get_optmax = IP_VS_SO_GET_MAX+1,
2341 .get = do_ip_vs_get_ctl, 2341 .get = do_ip_vs_get_ctl,
2342 .owner = THIS_MODULE,
2342}; 2343};
2343 2344
2344 2345
diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c
index d1149aba9351..29114a9ccd1d 100644
--- a/net/ipv4/netfilter/arp_tables.c
+++ b/net/ipv4/netfilter/arp_tables.c
@@ -1161,6 +1161,7 @@ static struct nf_sockopt_ops arpt_sockopts = {
1161 .get_optmin = ARPT_BASE_CTL, 1161 .get_optmin = ARPT_BASE_CTL,
1162 .get_optmax = ARPT_SO_GET_MAX+1, 1162 .get_optmax = ARPT_SO_GET_MAX+1,
1163 .get = do_arpt_get_ctl, 1163 .get = do_arpt_get_ctl,
1164 .owner = THIS_MODULE,
1164}; 1165};
1165 1166
1166static int __init arp_tables_init(void) 1167static int __init arp_tables_init(void)
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c
index e1b402c6b855..6486894f450c 100644
--- a/net/ipv4/netfilter/ip_tables.c
+++ b/net/ipv4/netfilter/ip_tables.c
@@ -2296,6 +2296,7 @@ static struct nf_sockopt_ops ipt_sockopts = {
2296#ifdef CONFIG_COMPAT 2296#ifdef CONFIG_COMPAT
2297 .compat_get = compat_do_ipt_get_ctl, 2297 .compat_get = compat_do_ipt_get_ctl,
2298#endif 2298#endif
2299 .owner = THIS_MODULE,
2299}; 2300};
2300 2301
2301static struct xt_match icmp_matchstruct __read_mostly = { 2302static struct xt_match icmp_matchstruct __read_mostly = {
diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
index d9b5177989c6..f813e02aab30 100644
--- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
+++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
@@ -87,14 +87,10 @@ static int ipv4_get_l4proto(const struct sk_buff *skb, unsigned int nhoff,
87 if (iph == NULL) 87 if (iph == NULL)
88 return -NF_DROP; 88 return -NF_DROP;
89 89
90 /* Never happen */ 90 /* Conntrack defragments packets, we might still see fragments
91 if (iph->frag_off & htons(IP_OFFSET)) { 91 * inside ICMP packets though. */
92 if (net_ratelimit()) { 92 if (iph->frag_off & htons(IP_OFFSET))
93 printk(KERN_ERR "ipv4_get_l4proto: Frag of proto %u\n",
94 iph->protocol);
95 }
96 return -NF_DROP; 93 return -NF_DROP;
97 }
98 94
99 *dataoff = nhoff + (iph->ihl << 2); 95 *dataoff = nhoff + (iph->ihl << 2);
100 *protonum = iph->protocol; 96 *protonum = iph->protocol;
@@ -403,6 +399,7 @@ static struct nf_sockopt_ops so_getorigdst = {
403 .get_optmin = SO_ORIGINAL_DST, 399 .get_optmin = SO_ORIGINAL_DST,
404 .get_optmax = SO_ORIGINAL_DST+1, 400 .get_optmax = SO_ORIGINAL_DST+1,
405 .get = &getorigdst, 401 .get = &getorigdst,
402 .owner = THIS_MODULE,
406}; 403};
407 404
408struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv4 __read_mostly = { 405struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv4 __read_mostly = {
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 5dead399fe64..26de3c0ea31e 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -1427,8 +1427,9 @@ void ip6_flush_pending_frames(struct sock *sk)
1427 struct sk_buff *skb; 1427 struct sk_buff *skb;
1428 1428
1429 while ((skb = __skb_dequeue_tail(&sk->sk_write_queue)) != NULL) { 1429 while ((skb = __skb_dequeue_tail(&sk->sk_write_queue)) != NULL) {
1430 IP6_INC_STATS(ip6_dst_idev(skb->dst), 1430 if (skb->dst)
1431 IPSTATS_MIB_OUTDISCARDS); 1431 IP6_INC_STATS(ip6_dst_idev(skb->dst),
1432 IPSTATS_MIB_OUTDISCARDS);
1432 kfree_skb(skb); 1433 kfree_skb(skb);
1433 } 1434 }
1434 1435
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 0358e6066a4e..73a894a2152c 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -736,7 +736,7 @@ static void ndisc_recv_ns(struct sk_buff *skb)
736 * so fail our DAD process 736 * so fail our DAD process
737 */ 737 */
738 addrconf_dad_failure(ifp); 738 addrconf_dad_failure(ifp);
739 goto out; 739 return;
740 } else { 740 } else {
741 /* 741 /*
742 * This is not a dad solicitation. 742 * This is not a dad solicitation.
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
index aeda617246b7..cd9df02bb85c 100644
--- a/net/ipv6/netfilter/ip6_tables.c
+++ b/net/ipv6/netfilter/ip6_tables.c
@@ -1462,6 +1462,7 @@ static struct nf_sockopt_ops ip6t_sockopts = {
1462 .get_optmin = IP6T_BASE_CTL, 1462 .get_optmin = IP6T_BASE_CTL,
1463 .get_optmax = IP6T_SO_GET_MAX+1, 1463 .get_optmax = IP6T_SO_GET_MAX+1,
1464 .get = do_ip6t_get_ctl, 1464 .get = do_ip6t_get_ctl,
1465 .owner = THIS_MODULE,
1465}; 1466};
1466 1467
1467static struct xt_match icmp6_matchstruct __read_mostly = { 1468static struct xt_match icmp6_matchstruct __read_mostly = {
diff --git a/net/netfilter/nf_sockopt.c b/net/netfilter/nf_sockopt.c
index 8b8ece750313..e32761ce260c 100644
--- a/net/netfilter/nf_sockopt.c
+++ b/net/netfilter/nf_sockopt.c
@@ -55,18 +55,7 @@ EXPORT_SYMBOL(nf_register_sockopt);
55 55
56void nf_unregister_sockopt(struct nf_sockopt_ops *reg) 56void nf_unregister_sockopt(struct nf_sockopt_ops *reg)
57{ 57{
58 /* No point being interruptible: we're probably in cleanup_module() */
59 restart:
60 mutex_lock(&nf_sockopt_mutex); 58 mutex_lock(&nf_sockopt_mutex);
61 if (reg->use != 0) {
62 /* To be woken by nf_sockopt call... */
63 /* FIXME: Stuart Young's name appears gratuitously. */
64 set_current_state(TASK_UNINTERRUPTIBLE);
65 reg->cleanup_task = current;
66 mutex_unlock(&nf_sockopt_mutex);
67 schedule();
68 goto restart;
69 }
70 list_del(&reg->list); 59 list_del(&reg->list);
71 mutex_unlock(&nf_sockopt_mutex); 60 mutex_unlock(&nf_sockopt_mutex);
72} 61}
@@ -86,10 +75,11 @@ static int nf_sockopt(struct sock *sk, int pf, int val,
86 list_for_each(i, &nf_sockopts) { 75 list_for_each(i, &nf_sockopts) {
87 ops = (struct nf_sockopt_ops *)i; 76 ops = (struct nf_sockopt_ops *)i;
88 if (ops->pf == pf) { 77 if (ops->pf == pf) {
78 if (!try_module_get(ops->owner))
79 goto out_nosup;
89 if (get) { 80 if (get) {
90 if (val >= ops->get_optmin 81 if (val >= ops->get_optmin
91 && val < ops->get_optmax) { 82 && val < ops->get_optmax) {
92 ops->use++;
93 mutex_unlock(&nf_sockopt_mutex); 83 mutex_unlock(&nf_sockopt_mutex);
94 ret = ops->get(sk, val, opt, len); 84 ret = ops->get(sk, val, opt, len);
95 goto out; 85 goto out;
@@ -97,23 +87,20 @@ static int nf_sockopt(struct sock *sk, int pf, int val,
97 } else { 87 } else {
98 if (val >= ops->set_optmin 88 if (val >= ops->set_optmin
99 && val < ops->set_optmax) { 89 && val < ops->set_optmax) {
100 ops->use++;
101 mutex_unlock(&nf_sockopt_mutex); 90 mutex_unlock(&nf_sockopt_mutex);
102 ret = ops->set(sk, val, opt, *len); 91 ret = ops->set(sk, val, opt, *len);
103 goto out; 92 goto out;
104 } 93 }
105 } 94 }
95 module_put(ops->owner);
106 } 96 }
107 } 97 }
98 out_nosup:
108 mutex_unlock(&nf_sockopt_mutex); 99 mutex_unlock(&nf_sockopt_mutex);
109 return -ENOPROTOOPT; 100 return -ENOPROTOOPT;
110 101
111 out: 102 out:
112 mutex_lock(&nf_sockopt_mutex); 103 module_put(ops->owner);
113 ops->use--;
114 if (ops->cleanup_task)
115 wake_up_process(ops->cleanup_task);
116 mutex_unlock(&nf_sockopt_mutex);
117 return ret; 104 return ret;
118} 105}
119 106
@@ -144,10 +131,12 @@ static int compat_nf_sockopt(struct sock *sk, int pf, int val,
144 list_for_each(i, &nf_sockopts) { 131 list_for_each(i, &nf_sockopts) {
145 ops = (struct nf_sockopt_ops *)i; 132 ops = (struct nf_sockopt_ops *)i;
146 if (ops->pf == pf) { 133 if (ops->pf == pf) {
134 if (!try_module_get(ops->owner))
135 goto out_nosup;
136
147 if (get) { 137 if (get) {
148 if (val >= ops->get_optmin 138 if (val >= ops->get_optmin
149 && val < ops->get_optmax) { 139 && val < ops->get_optmax) {
150 ops->use++;
151 mutex_unlock(&nf_sockopt_mutex); 140 mutex_unlock(&nf_sockopt_mutex);
152 if (ops->compat_get) 141 if (ops->compat_get)
153 ret = ops->compat_get(sk, 142 ret = ops->compat_get(sk,
@@ -160,7 +149,6 @@ static int compat_nf_sockopt(struct sock *sk, int pf, int val,
160 } else { 149 } else {
161 if (val >= ops->set_optmin 150 if (val >= ops->set_optmin
162 && val < ops->set_optmax) { 151 && val < ops->set_optmax) {
163 ops->use++;
164 mutex_unlock(&nf_sockopt_mutex); 152 mutex_unlock(&nf_sockopt_mutex);
165 if (ops->compat_set) 153 if (ops->compat_set)
166 ret = ops->compat_set(sk, 154 ret = ops->compat_set(sk,
@@ -171,17 +159,15 @@ static int compat_nf_sockopt(struct sock *sk, int pf, int val,
171 goto out; 159 goto out;
172 } 160 }
173 } 161 }
162 module_put(ops->owner);
174 } 163 }
175 } 164 }
165 out_nosup:
176 mutex_unlock(&nf_sockopt_mutex); 166 mutex_unlock(&nf_sockopt_mutex);
177 return -ENOPROTOOPT; 167 return -ENOPROTOOPT;
178 168
179 out: 169 out:
180 mutex_lock(&nf_sockopt_mutex); 170 module_put(ops->owner);
181 ops->use--;
182 if (ops->cleanup_task)
183 wake_up_process(ops->cleanup_task);
184 mutex_unlock(&nf_sockopt_mutex);
185 return ret; 171 return ret;
186} 172}
187 173
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index 12ff5da8160e..1a899924023f 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -1592,7 +1592,7 @@ svc_age_temp_sockets(unsigned long closure)
1592 1592
1593 if (!test_and_set_bit(SK_OLD, &svsk->sk_flags)) 1593 if (!test_and_set_bit(SK_OLD, &svsk->sk_flags))
1594 continue; 1594 continue;
1595 if (atomic_read(&svsk->sk_inuse) || test_bit(SK_BUSY, &svsk->sk_flags)) 1595 if (atomic_read(&svsk->sk_inuse) > 1 || test_bit(SK_BUSY, &svsk->sk_flags))
1596 continue; 1596 continue;
1597 atomic_inc(&svsk->sk_inuse); 1597 atomic_inc(&svsk->sk_inuse);
1598 list_move(le, &to_be_aged); 1598 list_move(le, &to_be_aged);