aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/local_ops.txt23
-rw-r--r--Documentation/video4linux/CARDLIST.em28xx3
-rw-r--r--MAINTAINERS6
-rw-r--r--Makefile19
-rw-r--r--arch/s390/kernel/early.c4
-rw-r--r--arch/s390/kernel/process.c8
-rw-r--r--arch/s390/kernel/smp.c6
-rw-r--r--arch/s390/kernel/time.c2
-rw-r--r--arch/um/Makefile7
-rw-r--r--arch/um/drivers/ubd_kern.c2
-rw-r--r--arch/x86/boot/pmjump.S8
-rw-r--r--arch/x86/lguest/boot.c69
-rw-r--r--drivers/block/paride/pt.c2
-rw-r--r--drivers/char/virtio_console.c2
-rw-r--r--drivers/ide/Kconfig22
-rw-r--r--drivers/ide/ide-dma.c5
-rw-r--r--drivers/ide/ide-io.c5
-rw-r--r--drivers/ide/ide-iops.c8
-rw-r--r--drivers/ide/ide-probe.c5
-rw-r--r--drivers/ide/ide-taskfile.c3
-rw-r--r--drivers/ide/pci/piix.c1
-rw-r--r--drivers/isdn/hisax/Kconfig18
-rw-r--r--drivers/isdn/hisax/avm_pci.c4
-rw-r--r--drivers/isdn/hisax/diva.c6
-rw-r--r--drivers/isdn/hisax/elsa.c6
-rw-r--r--drivers/isdn/hisax/gazel.c4
-rw-r--r--drivers/isdn/hisax/niccy.c7
-rw-r--r--drivers/isdn/hisax/sedlbauer.c4
-rw-r--r--drivers/leds/leds-gpio.c20
-rw-r--r--drivers/md/raid5.c14
-rw-r--r--drivers/media/Kconfig1
-rw-r--r--drivers/media/common/saa7146_core.c70
-rw-r--r--drivers/media/dvb/frontends/mt2131.c2
-rw-r--r--drivers/media/dvb/frontends/s5h1409.c96
-rw-r--r--drivers/media/dvb/frontends/stv0297.c22
-rw-r--r--drivers/media/dvb/frontends/tda10021.c6
-rw-r--r--drivers/media/dvb/frontends/ves1820.c2
-rw-r--r--drivers/media/dvb/ttpci/Kconfig2
-rw-r--r--drivers/media/video/Kconfig2
-rw-r--r--drivers/media/video/bt8xx/bttv-driver.c6
-rw-r--r--drivers/media/video/cafe_ccic.c6
-rw-r--r--drivers/media/video/cx23885/Kconfig2
-rw-r--r--drivers/media/video/cx88/Kconfig2
-rw-r--r--drivers/media/video/em28xx/Kconfig2
-rw-r--r--drivers/media/video/em28xx/em28xx-i2c.c6
-rw-r--r--drivers/media/video/em28xx/em28xx-video.c1
-rw-r--r--drivers/media/video/planb.c8
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-ctrl.c2
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-main.c5
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-sysfs.c8
-rw-r--r--drivers/media/video/saa7134/Kconfig2
-rw-r--r--drivers/media/video/saa7134/saa7134-alsa.c16
-rw-r--r--drivers/media/video/saa7134/saa7134-cards.c4
-rw-r--r--drivers/media/video/tuner-core.c6
-rw-r--r--drivers/media/video/tvp5150.c16
-rw-r--r--drivers/message/i2o/i2o_block.c4
-rw-r--r--drivers/net/82596.c3
-rw-r--r--drivers/net/phy/marvell.c23
-rw-r--r--drivers/net/phy/phy_device.c2
-rw-r--r--drivers/net/sunhme.c4
-rw-r--r--drivers/net/tg3.c9
-rw-r--r--drivers/pci/Kconfig11
-rw-r--r--drivers/pci/hotplug/Kconfig6
-rw-r--r--drivers/pci/hotplug/cpqphp_ctrl.c16
-rw-r--r--drivers/pci/msi.c18
-rw-r--r--drivers/pci/pci-driver.c5
-rw-r--r--drivers/pci/quirks.c51
-rw-r--r--drivers/pci/search.c9
-rw-r--r--drivers/rtc/rtc-m48t59.c6
-rw-r--r--drivers/s390/block/dcssblk.c9
-rw-r--r--drivers/s390/cio/cmf.c4
-rw-r--r--drivers/s390/cio/device.c2
-rw-r--r--drivers/s390/net/smsgiucv.c4
-rw-r--r--drivers/scsi/Kconfig2
-rw-r--r--drivers/scsi/ibmvscsi/ibmvscsi.c19
-rw-r--r--drivers/scsi/lpfc/lpfc_scsi.c5
-rw-r--r--drivers/scsi/osst.c6
-rw-r--r--drivers/serial/8250_early.c4
-rw-r--r--drivers/serial/8250_pci.c5
-rw-r--r--drivers/telephony/phonedev.c5
-rw-r--r--fs/afs/vlocation.c2
-rw-r--r--fs/ecryptfs/crypto.c28
-rw-r--r--include/asm-arm26/irq_regs.h1
-rw-r--r--include/asm-m68knommu/unistd.h4
-rw-r--r--include/asm-powerpc/commproc.h2
-rw-r--r--include/asm-x86/lguest_hcall.h3
-rw-r--r--include/linux/futex.h4
-rw-r--r--include/linux/ide.h9
-rw-r--r--include/linux/kallsyms.h1
-rw-r--r--include/linux/pci.h14
-rw-r--r--include/linux/pci_ids.h5
-rw-r--r--kernel/futex.c11
-rw-r--r--kernel/sysctl_check.c1
-rw-r--r--kernel/time/tick-broadcast.c2
-rw-r--r--kernel/time/tick-sched.c2
-rw-r--r--kernel/timer.c2
-rw-r--r--lib/bitmap.c4
-rw-r--r--mm/memory.c1
-rw-r--r--mm/slub.c20
99 files changed, 627 insertions, 309 deletions
diff --git a/Documentation/local_ops.txt b/Documentation/local_ops.txt
index 4269a1105b37..1a45f11e645e 100644
--- a/Documentation/local_ops.txt
+++ b/Documentation/local_ops.txt
@@ -68,6 +68,29 @@ typedef struct { atomic_long_t a; } local_t;
68 variable can be read when reading some _other_ cpu's variables. 68 variable can be read when reading some _other_ cpu's variables.
69 69
70 70
71* Rules to follow when using local atomic operations
72
73- Variables touched by local ops must be per cpu variables.
74- _Only_ the CPU owner of these variables must write to them.
75- This CPU can use local ops from any context (process, irq, softirq, nmi, ...)
76 to update its local_t variables.
77- Preemption (or interrupts) must be disabled when using local ops in
78 process context to make sure the process won't be migrated to a
79 different CPU between getting the per-cpu variable and doing the
80 actual local op.
81- When using local ops in interrupt context, no special care must be
82 taken on a mainline kernel, since they will run on the local CPU with
83 preemption already disabled. I suggest, however, to explicitly
84 disable preemption anyway to make sure it will still work correctly on
85 -rt kernels.
86- Reading the local cpu variable will provide the current copy of the
87 variable.
88- Reads of these variables can be done from any CPU, because updates to
89 "long", aligned, variables are always atomic. Since no memory
90 synchronization is done by the writer CPU, an outdated copy of the
91 variable can be read when reading some _other_ cpu's variables.
92
93
71* How to use local atomic operations 94* How to use local atomic operations
72 95
73#include <linux/percpu.h> 96#include <linux/percpu.h>
diff --git a/Documentation/video4linux/CARDLIST.em28xx b/Documentation/video4linux/CARDLIST.em28xx
index a3026689bbe6..37f0e3cedf43 100644
--- a/Documentation/video4linux/CARDLIST.em28xx
+++ b/Documentation/video4linux/CARDLIST.em28xx
@@ -8,4 +8,7 @@
8 7 -> Leadtek Winfast USB II (em2800) 8 7 -> Leadtek Winfast USB II (em2800)
9 8 -> Kworld USB2800 (em2800) 9 8 -> Kworld USB2800 (em2800)
10 9 -> Pinnacle Dazzle DVC 90 (em2820/em2840) [2304:0207] 10 9 -> Pinnacle Dazzle DVC 90 (em2820/em2840) [2304:0207]
11 10 -> Hauppauge WinTV HVR 900 (em2880)
12 11 -> Terratec Hybrid XS (em2880)
11 12 -> Kworld PVR TV 2800 RF (em2820/em2840) 13 12 -> Kworld PVR TV 2800 RF (em2820/em2840)
14 13 -> Terratec Prodigy XS (em2880)
diff --git a/MAINTAINERS b/MAINTAINERS
index 6c0e44bbf601..1c7c229a0926 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2549,7 +2549,7 @@ S: Supported
2549 2549
2550MISCELLANEOUS MCA-SUPPORT 2550MISCELLANEOUS MCA-SUPPORT
2551P: James Bottomley 2551P: James Bottomley
2552M: jejb@steeleye.com 2552M: James.Bottomley@HansenPartnership.com
2553L: linux-kernel@vger.kernel.org 2553L: linux-kernel@vger.kernel.org
2554S: Maintained 2554S: Maintained
2555 2555
@@ -3301,9 +3301,11 @@ S: Maintained
3301 3301
3302SCSI SUBSYSTEM 3302SCSI SUBSYSTEM
3303P: James E.J. Bottomley 3303P: James E.J. Bottomley
3304M: James.Bottomley@SteelEye.com 3304M: James.Bottomley@HansenPartnership.com
3305L: linux-scsi@vger.kernel.org 3305L: linux-scsi@vger.kernel.org
3306T: git kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git 3306T: git kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git
3307T: git kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6.git
3308T: git kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-pending-2.6.git
3307S: Maintained 3309S: Maintained
3308 3310
3309SCSI TAPE DRIVER 3311SCSI TAPE DRIVER
diff --git a/Makefile b/Makefile
index 188c3b6b3fa9..cb740d4d4e8c 100644
--- a/Makefile
+++ b/Makefile
@@ -528,9 +528,22 @@ KBUILD_CFLAGS += $(call cc-option,-Wdeclaration-after-statement,)
528KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,) 528KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,)
529 529
530# Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments 530# Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments
531KBUILD_CPPFLAGS += $(CPPFLAGS) 531# But warn user when we do so
532KBUILD_AFLAGS += $(AFLAGS) 532warn-assign = \
533KBUILD_CFLAGS += $(CFLAGS) 533$(warning "WARNING: Appending $$K$(1) ($(K$(1))) from $(origin K$(1)) to kernel $$$(1)")
534
535ifneq ($(KCPPFLAGS),)
536 $(call warn-assign,CPPFLAGS)
537 KBUILD_CPPFLAGS += $(KCPPFLAGS)
538endif
539ifneq ($(KAFLAGS),)
540 $(call warn-assign,AFLAGS)
541 KBUILD_AFLAGS += $(KAFLAGS)
542endif
543ifneq ($(KCFLAGS),)
544 $(call warn-assign,CFLAGS)
545 KBUILD_CFLAGS += $(KCFLAGS)
546endif
534 547
535# Use --build-id when available. 548# Use --build-id when available.
536LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\ 549LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c
index e6289ee74ecd..8bf4ae1150be 100644
--- a/arch/s390/kernel/early.c
+++ b/arch/s390/kernel/early.c
@@ -200,11 +200,13 @@ static noinline __init void find_memory_chunks(unsigned long memsize)
200 cc = __tprot(addr); 200 cc = __tprot(addr);
201 while (cc == old_cc) { 201 while (cc == old_cc) {
202 addr += CHUNK_INCR; 202 addr += CHUNK_INCR;
203 cc = __tprot(addr); 203 if (addr >= memsize)
204 break;
204#ifndef CONFIG_64BIT 205#ifndef CONFIG_64BIT
205 if (addr == ADDR2G) 206 if (addr == ADDR2G)
206 break; 207 break;
207#endif 208#endif
209 cc = __tprot(addr);
208 } 210 }
209 211
210 if (old_addr != addr && 212 if (old_addr != addr &&
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c
index 96492cf2d491..29f7884b4ffa 100644
--- a/arch/s390/kernel/process.c
+++ b/arch/s390/kernel/process.c
@@ -92,6 +92,7 @@ EXPORT_SYMBOL(unregister_idle_notifier);
92 92
93void do_monitor_call(struct pt_regs *regs, long interruption_code) 93void do_monitor_call(struct pt_regs *regs, long interruption_code)
94{ 94{
95#ifdef CONFIG_SMP
95 struct s390_idle_data *idle; 96 struct s390_idle_data *idle;
96 97
97 idle = &__get_cpu_var(s390_idle); 98 idle = &__get_cpu_var(s390_idle);
@@ -99,7 +100,7 @@ void do_monitor_call(struct pt_regs *regs, long interruption_code)
99 idle->idle_time += get_clock() - idle->idle_enter; 100 idle->idle_time += get_clock() - idle->idle_enter;
100 idle->in_idle = 0; 101 idle->in_idle = 0;
101 spin_unlock(&idle->lock); 102 spin_unlock(&idle->lock);
102 103#endif
103 /* disable monitor call class 0 */ 104 /* disable monitor call class 0 */
104 __ctl_clear_bit(8, 15); 105 __ctl_clear_bit(8, 15);
105 106
@@ -114,7 +115,9 @@ extern void s390_handle_mcck(void);
114static void default_idle(void) 115static void default_idle(void)
115{ 116{
116 int cpu, rc; 117 int cpu, rc;
118#ifdef CONFIG_SMP
117 struct s390_idle_data *idle; 119 struct s390_idle_data *idle;
120#endif
118 121
119 /* CPU is going idle. */ 122 /* CPU is going idle. */
120 cpu = smp_processor_id(); 123 cpu = smp_processor_id();
@@ -151,13 +154,14 @@ static void default_idle(void)
151 s390_handle_mcck(); 154 s390_handle_mcck();
152 return; 155 return;
153 } 156 }
154 157#ifdef CONFIG_SMP
155 idle = &__get_cpu_var(s390_idle); 158 idle = &__get_cpu_var(s390_idle);
156 spin_lock(&idle->lock); 159 spin_lock(&idle->lock);
157 idle->idle_count++; 160 idle->idle_count++;
158 idle->in_idle = 1; 161 idle->in_idle = 1;
159 idle->idle_enter = get_clock(); 162 idle->idle_enter = get_clock();
160 spin_unlock(&idle->lock); 163 spin_unlock(&idle->lock);
164#endif
161 trace_hardirqs_on(); 165 trace_hardirqs_on();
162 /* Wait for external, I/O or machine check interrupt. */ 166 /* Wait for external, I/O or machine check interrupt. */
163 __load_psw_mask(psw_kernel_bits | PSW_MASK_WAIT | 167 __load_psw_mask(psw_kernel_bits | PSW_MASK_WAIT |
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 1d97fe1c0e53..b05ae8584258 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -788,14 +788,14 @@ static ssize_t show_idle_time(struct sys_device *dev, char *buf)
788 } 788 }
789 new_time = idle->idle_time; 789 new_time = idle->idle_time;
790 spin_unlock_irq(&idle->lock); 790 spin_unlock_irq(&idle->lock);
791 return sprintf(buf, "%llu us\n", new_time >> 12); 791 return sprintf(buf, "%llu\n", new_time >> 12);
792} 792}
793static SYSDEV_ATTR(idle_time, 0444, show_idle_time, NULL); 793static SYSDEV_ATTR(idle_time_us, 0444, show_idle_time, NULL);
794 794
795static struct attribute *cpu_attrs[] = { 795static struct attribute *cpu_attrs[] = {
796 &attr_capability.attr, 796 &attr_capability.attr,
797 &attr_idle_count.attr, 797 &attr_idle_count.attr,
798 &attr_idle_time.attr, 798 &attr_idle_time_us.attr,
799 NULL, 799 NULL,
800}; 800};
801 801
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index 48dae49bc1ec..a963fe81359e 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -307,7 +307,7 @@ static cycle_t read_tod_clock(void)
307 307
308static struct clocksource clocksource_tod = { 308static struct clocksource clocksource_tod = {
309 .name = "tod", 309 .name = "tod",
310 .rating = 100, 310 .rating = 400,
311 .read = read_tod_clock, 311 .read = read_tod_clock,
312 .mask = -1ULL, 312 .mask = -1ULL,
313 .mult = 1000, 313 .mult = 1000,
diff --git a/arch/um/Makefile b/arch/um/Makefile
index 82c2ac48040d..768a5d14b755 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -70,9 +70,12 @@ include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS)
70# in KBUILD_CFLAGS. Otherwise, it would cause ld to complain about the two different 70# in KBUILD_CFLAGS. Otherwise, it would cause ld to complain about the two different
71# errnos. 71# errnos.
72# These apply to kernelspace only. 72# These apply to kernelspace only.
73#
74# strip leading and trailing whitespace to make the USER_CFLAGS removal of these
75# defines more robust
73 76
74KERNEL_DEFINES = -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask \ 77KERNEL_DEFINES = $(strip -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask \
75 -Dmktime=kernel_mktime $(ARCH_KERNEL_DEFINES) 78 -Dmktime=kernel_mktime $(ARCH_KERNEL_DEFINES))
76KBUILD_CFLAGS += $(KERNEL_DEFINES) 79KBUILD_CFLAGS += $(KERNEL_DEFINES)
77KBUILD_CFLAGS += $(call cc-option,-fno-unit-at-a-time,) 80KBUILD_CFLAGS += $(call cc-option,-fno-unit-at-a-time,)
78 81
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index e184b44b1011..7e6cdde62ead 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -705,7 +705,7 @@ static int ubd_add(int n, char **error_out)
705 ubd_dev->size = ROUND_BLOCK(ubd_dev->size); 705 ubd_dev->size = ROUND_BLOCK(ubd_dev->size);
706 706
707 INIT_LIST_HEAD(&ubd_dev->restart); 707 INIT_LIST_HEAD(&ubd_dev->restart);
708 sg_init_table(&ubd_dev->sg, MAX_SG); 708 sg_init_table(ubd_dev->sg, MAX_SG);
709 709
710 err = -ENOMEM; 710 err = -ENOMEM;
711 ubd_dev->queue = blk_init_queue(do_ubd_request, &ubd_dev->lock); 711 ubd_dev->queue = blk_init_queue(do_ubd_request, &ubd_dev->lock);
diff --git a/arch/x86/boot/pmjump.S b/arch/x86/boot/pmjump.S
index 2e559233725a..fa6bed1fac14 100644
--- a/arch/x86/boot/pmjump.S
+++ b/arch/x86/boot/pmjump.S
@@ -28,17 +28,19 @@
28 * void protected_mode_jump(u32 entrypoint, u32 bootparams); 28 * void protected_mode_jump(u32 entrypoint, u32 bootparams);
29 */ 29 */
30protected_mode_jump: 30protected_mode_jump:
31 xorl %ebx, %ebx # Flag to indicate this is a boot
32 movl %edx, %esi # Pointer to boot_params table 31 movl %edx, %esi # Pointer to boot_params table
33 movl %eax, 2f # Patch ljmpl instruction 32 movl %eax, 2f # Patch ljmpl instruction
34 jmp 1f # Short jump to flush instruction q.
35 33
361:
37 movw $__BOOT_DS, %cx 34 movw $__BOOT_DS, %cx
35 xorl %ebx, %ebx # Per the 32-bit boot protocol
36 xorl %ebp, %ebp # Per the 32-bit boot protocol
37 xorl %edi, %edi # Per the 32-bit boot protocol
38 38
39 movl %cr0, %edx 39 movl %cr0, %edx
40 orb $1, %dl # Protected mode (PE) bit 40 orb $1, %dl # Protected mode (PE) bit
41 movl %edx, %cr0 41 movl %edx, %cr0
42 jmp 1f # Short jump to serialize on 386/486
431:
42 44
43 movw %cx, %ds 45 movw %cx, %ds
44 movw %cx, %es 46 movw %cx, %es
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c
index a55b0902f9d3..92c56117eae5 100644
--- a/arch/x86/lguest/boot.c
+++ b/arch/x86/lguest/boot.c
@@ -93,38 +93,7 @@ struct lguest_data lguest_data = {
93}; 93};
94static cycle_t clock_base; 94static cycle_t clock_base;
95 95
96/*G:035 Notice the lazy_hcall() above, rather than hcall(). This is our first 96/*G:037 async_hcall() is pretty simple: I'm quite proud of it really. We have a
97 * real optimization trick!
98 *
99 * When lazy_mode is set, it means we're allowed to defer all hypercalls and do
100 * them as a batch when lazy_mode is eventually turned off. Because hypercalls
101 * are reasonably expensive, batching them up makes sense. For example, a
102 * large munmap might update dozens of page table entries: that code calls
103 * paravirt_enter_lazy_mmu(), does the dozen updates, then calls
104 * lguest_leave_lazy_mode().
105 *
106 * So, when we're in lazy mode, we call async_hypercall() to store the call for
107 * future processing. When lazy mode is turned off we issue a hypercall to
108 * flush the stored calls.
109 */
110static void lguest_leave_lazy_mode(void)
111{
112 paravirt_leave_lazy(paravirt_get_lazy_mode());
113 hcall(LHCALL_FLUSH_ASYNC, 0, 0, 0);
114}
115
116static void lazy_hcall(unsigned long call,
117 unsigned long arg1,
118 unsigned long arg2,
119 unsigned long arg3)
120{
121 if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_NONE)
122 hcall(call, arg1, arg2, arg3);
123 else
124 async_hcall(call, arg1, arg2, arg3);
125}
126
127/* async_hcall() is pretty simple: I'm quite proud of it really. We have a
128 * ring buffer of stored hypercalls which the Host will run though next time we 97 * ring buffer of stored hypercalls which the Host will run though next time we
129 * do a normal hypercall. Each entry in the ring has 4 slots for the hypercall 98 * do a normal hypercall. Each entry in the ring has 4 slots for the hypercall
130 * arguments, and a "hcall_status" word which is 0 if the call is ready to go, 99 * arguments, and a "hcall_status" word which is 0 if the call is ready to go,
@@ -134,8 +103,8 @@ static void lazy_hcall(unsigned long call,
134 * full and we just make the hypercall directly. This has the nice side 103 * full and we just make the hypercall directly. This has the nice side
135 * effect of causing the Host to run all the stored calls in the ring buffer 104 * effect of causing the Host to run all the stored calls in the ring buffer
136 * which empties it for next time! */ 105 * which empties it for next time! */
137void async_hcall(unsigned long call, 106static void async_hcall(unsigned long call, unsigned long arg1,
138 unsigned long arg1, unsigned long arg2, unsigned long arg3) 107 unsigned long arg2, unsigned long arg3)
139{ 108{
140 /* Note: This code assumes we're uniprocessor. */ 109 /* Note: This code assumes we're uniprocessor. */
141 static unsigned int next_call; 110 static unsigned int next_call;
@@ -161,7 +130,37 @@ void async_hcall(unsigned long call,
161 } 130 }
162 local_irq_restore(flags); 131 local_irq_restore(flags);
163} 132}
164/*:*/ 133
134/*G:035 Notice the lazy_hcall() above, rather than hcall(). This is our first
135 * real optimization trick!
136 *
137 * When lazy_mode is set, it means we're allowed to defer all hypercalls and do
138 * them as a batch when lazy_mode is eventually turned off. Because hypercalls
139 * are reasonably expensive, batching them up makes sense. For example, a
140 * large munmap might update dozens of page table entries: that code calls
141 * paravirt_enter_lazy_mmu(), does the dozen updates, then calls
142 * lguest_leave_lazy_mode().
143 *
144 * So, when we're in lazy mode, we call async_hcall() to store the call for
145 * future processing. */
146static void lazy_hcall(unsigned long call,
147 unsigned long arg1,
148 unsigned long arg2,
149 unsigned long arg3)
150{
151 if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_NONE)
152 hcall(call, arg1, arg2, arg3);
153 else
154 async_hcall(call, arg1, arg2, arg3);
155}
156
157/* When lazy mode is turned off reset the per-cpu lazy mode variable and then
158 * issue a hypercall to flush any stored calls. */
159static void lguest_leave_lazy_mode(void)
160{
161 paravirt_leave_lazy(paravirt_get_lazy_mode());
162 hcall(LHCALL_FLUSH_ASYNC, 0, 0, 0);
163}
165 164
166/*G:033 165/*G:033
167 * After that diversion we return to our first native-instruction 166 * After that diversion we return to our first native-instruction
diff --git a/drivers/block/paride/pt.c b/drivers/block/paride/pt.c
index 9f4e67ee1eb0..b91accf12656 100644
--- a/drivers/block/paride/pt.c
+++ b/drivers/block/paride/pt.c
@@ -664,7 +664,7 @@ static int pt_open(struct inode *inode, struct file *file)
664 goto out; 664 goto out;
665 665
666 err = -EROFS; 666 err = -EROFS;
667 if ((!tape->flags & PT_WRITE_OK) && (file->f_mode & 2)) 667 if ((!(tape->flags & PT_WRITE_OK)) && (file->f_mode & 2))
668 goto out; 668 goto out;
669 669
670 if (!(iminor(inode) & 128)) 670 if (!(iminor(inode) & 128))
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index 100e8a201e3a..e34da5c97196 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -141,7 +141,7 @@ int __init virtio_cons_early_init(int (*put_chars)(u32, const char *, int))
141 * never remove the console device we never need this pointer again. 141 * never remove the console device we never need this pointer again.
142 * 142 *
143 * Finally we put our input buffer in the input queue, ready to receive. */ 143 * Finally we put our input buffer in the input queue, ready to receive. */
144static int virtcons_probe(struct virtio_device *dev) 144static int __devinit virtcons_probe(struct virtio_device *dev)
145{ 145{
146 int err; 146 int err;
147 struct hvc_struct *hvc; 147 struct hvc_struct *hvc;
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index 6eaece96524e..d1e8df187222 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -152,9 +152,22 @@ config BLK_DEV_IDEDISK
152 If unsure, say Y. 152 If unsure, say Y.
153 153
154config IDEDISK_MULTI_MODE 154config IDEDISK_MULTI_MODE
155 bool "Use multi-mode by default" 155 bool "Use multiple sector mode for Programmed Input/Output by default"
156 help 156 help
157 If you get this error, try to say Y here: 157 This setting is irrelevant for most IDE disks, with direct memory
158 access, to which multiple sector mode does not apply. Multiple sector
159 mode is a feature of most modern IDE hard drives, permitting the
160 transfer of multiple sectors per Programmed Input/Output interrupt,
161 rather than the usual one sector per interrupt. When this feature is
162 enabled, it can reduce operating system overhead for disk Programmed
163 Input/Output. On some systems, it also can increase the data
164 throughput of Programmed Input/Output. Some drives, however, seemed
165 to run slower with multiple sector mode enabled. Some drives claimed
166 to support multiple sector mode, but lost data at some settings.
167 Under rare circumstances, such failures could result in massive
168 filesystem corruption.
169
170 If you get the following error, try to say Y here:
158 171
159 hda: set_multmode: status=0x51 { DriveReady SeekComplete Error } 172 hda: set_multmode: status=0x51 { DriveReady SeekComplete Error }
160 hda: set_multmode: error=0x04 { DriveStatusError } 173 hda: set_multmode: error=0x04 { DriveStatusError }
@@ -380,9 +393,10 @@ config IDEPCI_SHARE_IRQ
380config IDEPCI_PCIBUS_ORDER 393config IDEPCI_PCIBUS_ORDER
381 def_bool BLK_DEV_IDE=y && BLK_DEV_IDEPCI 394 def_bool BLK_DEV_IDE=y && BLK_DEV_IDEPCI
382 395
396# TODO: split it on per host driver config options (or module parameters)
383config BLK_DEV_OFFBOARD 397config BLK_DEV_OFFBOARD
384 bool "Boot off-board chipsets first support" 398 bool "Boot off-board chipsets first support"
385 depends on BLK_DEV_IDEPCI 399 depends on BLK_DEV_IDEPCI && (BLK_DEV_AEC62XX || BLK_DEV_GENERIC || BLK_DEV_HPT34X || BLK_DEV_HPT366 || BLK_DEV_PDC202XX_NEW || BLK_DEV_PDC202XX_OLD || BLK_DEV_TC86C001)
386 help 400 help
387 Normally, IDE controllers built into the motherboard (on-board 401 Normally, IDE controllers built into the motherboard (on-board
388 controllers) are assigned to ide0 and ide1 while those on add-in PCI 402 controllers) are assigned to ide0 and ide1 while those on add-in PCI
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index 428f7a8a00b6..e3add70b9cd8 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -340,7 +340,7 @@ static int config_drive_for_dma (ide_drive_t *drive)
340 340
341 if (drive->media != ide_disk) { 341 if (drive->media != ide_disk) {
342 if (hwif->host_flags & IDE_HFLAG_NO_ATAPI_DMA) 342 if (hwif->host_flags & IDE_HFLAG_NO_ATAPI_DMA)
343 return -1; 343 return 0;
344 } 344 }
345 345
346 /* 346 /*
@@ -752,7 +752,8 @@ u8 ide_find_dma_mode(ide_drive_t *drive, u8 req_mode)
752 mode = XFER_MW_DMA_1; 752 mode = XFER_MW_DMA_1;
753 } 753 }
754 754
755 printk(KERN_DEBUG "%s: selected mode 0x%x\n", drive->name, mode); 755 printk(KERN_DEBUG "%s: %s mode selected\n", drive->name,
756 mode ? ide_xfer_verbose(mode) : "no DMA");
756 757
757 return min(mode, req_mode); 758 return min(mode, req_mode);
758} 759}
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index c89f0d3058e9..755011827afa 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -340,6 +340,8 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err)
340 if (args) { 340 if (args) {
341 args[0] = stat; 341 args[0] = stat;
342 args[1] = err; 342 args[1] = err;
343 /* be sure we're looking at the low order bits */
344 hwif->OUTB(drive->ctl & ~0x80, IDE_CONTROL_REG);
343 args[2] = hwif->INB(IDE_NSECTOR_REG); 345 args[2] = hwif->INB(IDE_NSECTOR_REG);
344 args[3] = hwif->INB(IDE_SECTOR_REG); 346 args[3] = hwif->INB(IDE_SECTOR_REG);
345 args[4] = hwif->INB(IDE_LCYL_REG); 347 args[4] = hwif->INB(IDE_LCYL_REG);
@@ -654,7 +656,8 @@ static ide_startstop_t drive_cmd_intr (ide_drive_t *drive)
654 int retries = 10; 656 int retries = 10;
655 657
656 local_irq_enable_in_hardirq(); 658 local_irq_enable_in_hardirq();
657 if ((stat & DRQ_STAT) && args && args[3]) { 659 if (rq->cmd_type == REQ_TYPE_ATA_CMD &&
660 (stat & DRQ_STAT) && args && args[3]) {
658 u8 io_32bit = drive->io_32bit; 661 u8 io_32bit = drive->io_32bit;
659 drive->io_32bit = 0; 662 drive->io_32bit = 0;
660 hwif->ata_input_data(drive, &args[4], args[3] * SECTOR_WORDS); 663 hwif->ata_input_data(drive, &args[4], args[3] * SECTOR_WORDS);
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index dcda0f109df5..e17a9ee120ea 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -403,8 +403,12 @@ void ide_fix_driveid (struct hd_driveid *id)
403#endif 403#endif
404} 404}
405 405
406/* FIXME: exported for use by the USB storage (isd200.c) code only */ 406/*
407EXPORT_SYMBOL(ide_fix_driveid); 407 * ide_fixstring() cleans up and (optionally) byte-swaps a text string,
408 * removing leading/trailing blanks and compressing internal blanks.
409 * It is primarily used to tidy up the model name/number fields as
410 * returned by the WIN_[P]IDENTIFY commands.
411 */
408 412
409void ide_fixstring (u8 *s, const int bytecount, const int byteswap) 413void ide_fixstring (u8 *s, const int bytecount, const int byteswap)
410{ 414{
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 6a6f2e066b46..56fb0b843429 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -172,11 +172,12 @@ static inline void do_identify (ide_drive_t *drive, u8 cmd)
172 ide_fixstring(id->fw_rev, sizeof(id->fw_rev), bswap); 172 ide_fixstring(id->fw_rev, sizeof(id->fw_rev), bswap);
173 ide_fixstring(id->serial_no, sizeof(id->serial_no), bswap); 173 ide_fixstring(id->serial_no, sizeof(id->serial_no), bswap);
174 174
175 /* we depend on this a lot! */
176 id->model[sizeof(id->model)-1] = '\0';
177
175 if (strstr(id->model, "E X A B Y T E N E S T")) 178 if (strstr(id->model, "E X A B Y T E N E S T"))
176 goto err_misc; 179 goto err_misc;
177 180
178 /* we depend on this a lot! */
179 id->model[sizeof(id->model)-1] = '\0';
180 printk("%s: %s, ", drive->name, id->model); 181 printk("%s: %s, ", drive->name, id->model);
181 drive->present = 1; 182 drive->present = 1;
182 drive->dead = 0; 183 drive->dead = 0;
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index d066546f2831..2b60f1b0437e 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -471,6 +471,7 @@ static int ide_diag_taskfile(ide_drive_t *drive, ide_task_t *args, unsigned long
471 struct request rq; 471 struct request rq;
472 472
473 memset(&rq, 0, sizeof(rq)); 473 memset(&rq, 0, sizeof(rq));
474 rq.ref_count = 1;
474 rq.cmd_type = REQ_TYPE_ATA_TASKFILE; 475 rq.cmd_type = REQ_TYPE_ATA_TASKFILE;
475 rq.buffer = buf; 476 rq.buffer = buf;
476 477
@@ -511,6 +512,7 @@ int ide_raw_taskfile (ide_drive_t *drive, ide_task_t *args, u8 *buf)
511 512
512EXPORT_SYMBOL(ide_raw_taskfile); 513EXPORT_SYMBOL(ide_raw_taskfile);
513 514
515#ifdef CONFIG_IDE_TASK_IOCTL
514int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg) 516int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
515{ 517{
516 ide_task_request_t *req_task; 518 ide_task_request_t *req_task;
@@ -660,6 +662,7 @@ abort:
660 662
661 return err; 663 return err;
662} 664}
665#endif
663 666
664int ide_wait_cmd (ide_drive_t *drive, u8 cmd, u8 nsect, u8 feature, u8 sectors, u8 *buf) 667int ide_wait_cmd (ide_drive_t *drive, u8 cmd, u8 nsect, u8 feature, u8 sectors, u8 *buf)
665{ 668{
diff --git a/drivers/ide/pci/piix.c b/drivers/ide/pci/piix.c
index 9329d4a810e5..63625a0be712 100644
--- a/drivers/ide/pci/piix.c
+++ b/drivers/ide/pci/piix.c
@@ -302,6 +302,7 @@ struct ich_laptop {
302 302
303static const struct ich_laptop ich_laptop[] = { 303static const struct ich_laptop ich_laptop[] = {
304 /* devid, subvendor, subdev */ 304 /* devid, subvendor, subdev */
305 { 0x27DF, 0x1025, 0x0102 }, /* ICH7 on Acer 5602aWLMi */
305 { 0x27DF, 0x0005, 0x0280 }, /* ICH7 on Acer 5602WLMi */ 306 { 0x27DF, 0x0005, 0x0280 }, /* ICH7 on Acer 5602WLMi */
306 { 0x27DF, 0x1025, 0x0110 }, /* ICH7 on Acer 3682WLMi */ 307 { 0x27DF, 0x1025, 0x0110 }, /* ICH7 on Acer 3682WLMi */
307 { 0x27DF, 0x1043, 0x1267 }, /* ICH7 on Asus W5F */ 308 { 0x27DF, 0x1043, 0x1267 }, /* ICH7 on Asus W5F */
diff --git a/drivers/isdn/hisax/Kconfig b/drivers/isdn/hisax/Kconfig
index a3b945ac3256..7832d8ba8e44 100644
--- a/drivers/isdn/hisax/Kconfig
+++ b/drivers/isdn/hisax/Kconfig
@@ -109,7 +109,7 @@ config HISAX_16_3
109 109
110config HISAX_TELESPCI 110config HISAX_TELESPCI
111 bool "Teles PCI" 111 bool "Teles PCI"
112 depends on PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || FRV)) 112 depends on PCI && PCI_LEGACY && (BROKEN || !(SPARC || PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || FRV))
113 help 113 help
114 This enables HiSax support for the Teles PCI. 114 This enables HiSax support for the Teles PCI.
115 See <file:Documentation/isdn/README.HiSax> on how to configure it. 115 See <file:Documentation/isdn/README.HiSax> on how to configure it.
@@ -237,7 +237,7 @@ config HISAX_MIC
237 237
238config HISAX_NETJET 238config HISAX_NETJET
239 bool "NETjet card" 239 bool "NETjet card"
240 depends on PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || FRV)) 240 depends on PCI && PCI_LEGACY && (BROKEN || !(SPARC || PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || FRV))
241 help 241 help
242 This enables HiSax support for the NetJet from Traverse 242 This enables HiSax support for the NetJet from Traverse
243 Technologies. 243 Technologies.
@@ -248,7 +248,7 @@ config HISAX_NETJET
248 248
249config HISAX_NETJET_U 249config HISAX_NETJET_U
250 bool "NETspider U card" 250 bool "NETspider U card"
251 depends on PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || FRV)) 251 depends on PCI && PCI_LEGACY && (BROKEN || !(SPARC || PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || FRV))
252 help 252 help
253 This enables HiSax support for the Netspider U interface ISDN card 253 This enables HiSax support for the Netspider U interface ISDN card
254 from Traverse Technologies. 254 from Traverse Technologies.
@@ -287,7 +287,7 @@ config HISAX_HSTSAPHIR
287 287
288config HISAX_BKM_A4T 288config HISAX_BKM_A4T
289 bool "Telekom A4T card" 289 bool "Telekom A4T card"
290 depends on PCI 290 depends on PCI && PCI_LEGACY
291 help 291 help
292 This enables HiSax support for the Telekom A4T card. 292 This enables HiSax support for the Telekom A4T card.
293 293
@@ -297,7 +297,7 @@ config HISAX_BKM_A4T
297 297
298config HISAX_SCT_QUADRO 298config HISAX_SCT_QUADRO
299 bool "Scitel Quadro card" 299 bool "Scitel Quadro card"
300 depends on PCI 300 depends on PCI && PCI_LEGACY
301 help 301 help
302 This enables HiSax support for the Scitel Quadro card. 302 This enables HiSax support for the Scitel Quadro card.
303 303
@@ -316,7 +316,7 @@ config HISAX_GAZEL
316 316
317config HISAX_HFC_PCI 317config HISAX_HFC_PCI
318 bool "HFC PCI-Bus cards" 318 bool "HFC PCI-Bus cards"
319 depends on PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || FRV)) 319 depends on PCI && PCI_LEGACY && (BROKEN || !(SPARC || PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || FRV))
320 help 320 help
321 This enables HiSax support for the HFC-S PCI 2BDS0 based cards. 321 This enables HiSax support for the HFC-S PCI 2BDS0 based cards.
322 322
@@ -325,7 +325,7 @@ config HISAX_HFC_PCI
325 325
326config HISAX_W6692 326config HISAX_W6692
327 bool "Winbond W6692 based cards" 327 bool "Winbond W6692 based cards"
328 depends on PCI 328 depends on PCI && PCI_LEGACY
329 help 329 help
330 This enables HiSax support for Winbond W6692 based PCI ISDN cards. 330 This enables HiSax support for Winbond W6692 based PCI ISDN cards.
331 331
@@ -341,7 +341,7 @@ config HISAX_HFC_SX
341 341
342config HISAX_ENTERNOW_PCI 342config HISAX_ENTERNOW_PCI
343 bool "Formula-n enter:now PCI card" 343 bool "Formula-n enter:now PCI card"
344 depends on HISAX_NETJET && PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || FRV)) 344 depends on HISAX_NETJET && PCI && PCI_LEGACY && (BROKEN || !(SPARC || PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || FRV))
345 help 345 help
346 This enables HiSax support for the Formula-n enter:now PCI 346 This enables HiSax support for the Formula-n enter:now PCI
347 ISDN card. 347 ISDN card.
@@ -411,7 +411,7 @@ config HISAX_HFC4S8S
411 411
412config HISAX_FRITZ_PCIPNP 412config HISAX_FRITZ_PCIPNP
413 tristate "AVM Fritz!Card PCI/PCIv2/PnP support (EXPERIMENTAL)" 413 tristate "AVM Fritz!Card PCI/PCIv2/PnP support (EXPERIMENTAL)"
414 depends on PCI && EXPERIMENTAL 414 depends on PCI && PCI_LEGACY && EXPERIMENTAL
415 help 415 help
416 This enables the driver for the AVM Fritz!Card PCI, 416 This enables the driver for the AVM Fritz!Card PCI,
417 Fritz!Card PCI v2 and Fritz!Card PnP. 417 Fritz!Card PCI v2 and Fritz!Card PnP.
diff --git a/drivers/isdn/hisax/avm_pci.c b/drivers/isdn/hisax/avm_pci.c
index f8b79783c8b3..035d158779df 100644
--- a/drivers/isdn/hisax/avm_pci.c
+++ b/drivers/isdn/hisax/avm_pci.c
@@ -830,7 +830,7 @@ static int __devinit avm_pnp_setup(struct IsdnCardState *cs)
830 830
831#endif /* __ISAPNP__ */ 831#endif /* __ISAPNP__ */
832 832
833#ifndef CONFIG_PCI 833#ifndef CONFIG_PCI_LEGACY
834 834
835static int __devinit avm_pci_setup(struct IsdnCardState *cs) 835static int __devinit avm_pci_setup(struct IsdnCardState *cs)
836{ 836{
@@ -872,7 +872,7 @@ static int __devinit avm_pci_setup(struct IsdnCardState *cs)
872 return (1); 872 return (1);
873} 873}
874 874
875#endif /* CONFIG_PCI */ 875#endif /* CONFIG_PCI_LEGACY */
876 876
877int __devinit 877int __devinit
878setup_avm_pcipnp(struct IsdnCard *card) 878setup_avm_pcipnp(struct IsdnCard *card)
diff --git a/drivers/isdn/hisax/diva.c b/drivers/isdn/hisax/diva.c
index 826745078746..2d670856d141 100644
--- a/drivers/isdn/hisax/diva.c
+++ b/drivers/isdn/hisax/diva.c
@@ -1148,7 +1148,7 @@ static int __devinit setup_diva_isapnp(struct IsdnCard *card)
1148 1148
1149#endif /* ISAPNP */ 1149#endif /* ISAPNP */
1150 1150
1151#ifdef CONFIG_PCI 1151#ifdef CONFIG_PCI_LEGACY
1152static struct pci_dev *dev_diva __devinitdata = NULL; 1152static struct pci_dev *dev_diva __devinitdata = NULL;
1153static struct pci_dev *dev_diva_u __devinitdata = NULL; 1153static struct pci_dev *dev_diva_u __devinitdata = NULL;
1154static struct pci_dev *dev_diva201 __devinitdata = NULL; 1154static struct pci_dev *dev_diva201 __devinitdata = NULL;
@@ -1229,14 +1229,14 @@ static int __devinit setup_diva_pci(struct IsdnCard *card)
1229 return (1); /* card found */ 1229 return (1); /* card found */
1230} 1230}
1231 1231
1232#else /* if !CONFIG_PCI */ 1232#else /* if !CONFIG_PCI_LEGACY */
1233 1233
1234static int __devinit setup_diva_pci(struct IsdnCard *card) 1234static int __devinit setup_diva_pci(struct IsdnCard *card)
1235{ 1235{
1236 return (-1); /* card not found; continue search */ 1236 return (-1); /* card not found; continue search */
1237} 1237}
1238 1238
1239#endif /* CONFIG_PCI */ 1239#endif /* CONFIG_PCI_LEGACY */
1240 1240
1241int __devinit 1241int __devinit
1242setup_diva(struct IsdnCard *card) 1242setup_diva(struct IsdnCard *card)
diff --git a/drivers/isdn/hisax/elsa.c b/drivers/isdn/hisax/elsa.c
index 948a9b290fd1..d272d8ce6537 100644
--- a/drivers/isdn/hisax/elsa.c
+++ b/drivers/isdn/hisax/elsa.c
@@ -883,7 +883,7 @@ setup_elsa_isa(struct IsdnCard *card)
883 val += 'A' - 3; 883 val += 'A' - 3;
884 if (val == 'B' || val == 'C') 884 if (val == 'B' || val == 'C')
885 val ^= 1; 885 val ^= 1;
886 if ((cs->subtyp == ELSA_PCFPRO) && (val = 'G')) 886 if ((cs->subtyp == ELSA_PCFPRO) && (val == 'G'))
887 val = 'C'; 887 val = 'C';
888 printk(KERN_INFO 888 printk(KERN_INFO
889 "Elsa: %s found at %#lx Rev.:%c IRQ %d\n", 889 "Elsa: %s found at %#lx Rev.:%c IRQ %d\n",
@@ -1025,7 +1025,7 @@ setup_elsa_pcmcia(struct IsdnCard *card)
1025 cs->irq); 1025 cs->irq);
1026} 1026}
1027 1027
1028#ifdef CONFIG_PCI 1028#ifdef CONFIG_PCI_LEGACY
1029static struct pci_dev *dev_qs1000 __devinitdata = NULL; 1029static struct pci_dev *dev_qs1000 __devinitdata = NULL;
1030static struct pci_dev *dev_qs3000 __devinitdata = NULL; 1030static struct pci_dev *dev_qs3000 __devinitdata = NULL;
1031 1031
@@ -1093,7 +1093,7 @@ setup_elsa_pci(struct IsdnCard *card)
1093{ 1093{
1094 return (1); 1094 return (1);
1095} 1095}
1096#endif /* CONFIG_PCI */ 1096#endif /* CONFIG_PCI_LEGACY */
1097 1097
1098static int __devinit 1098static int __devinit
1099setup_elsa_common(struct IsdnCard *card) 1099setup_elsa_common(struct IsdnCard *card)
diff --git a/drivers/isdn/hisax/gazel.c b/drivers/isdn/hisax/gazel.c
index 3efa719b6d29..f66620ad8e7c 100644
--- a/drivers/isdn/hisax/gazel.c
+++ b/drivers/isdn/hisax/gazel.c
@@ -532,6 +532,7 @@ setup_gazelisa(struct IsdnCard *card, struct IsdnCardState *cs)
532 return (0); 532 return (0);
533} 533}
534 534
535#ifdef CONFIG_PCI_LEGACY
535static struct pci_dev *dev_tel __devinitdata = NULL; 536static struct pci_dev *dev_tel __devinitdata = NULL;
536 537
537static int __devinit 538static int __devinit
@@ -620,6 +621,7 @@ setup_gazelpci(struct IsdnCardState *cs)
620 621
621 return (0); 622 return (0);
622} 623}
624#endif /* CONFIG_PCI_LEGACY */
623 625
624int __devinit 626int __devinit
625setup_gazel(struct IsdnCard *card) 627setup_gazel(struct IsdnCard *card)
@@ -639,7 +641,7 @@ setup_gazel(struct IsdnCard *card)
639 return (0); 641 return (0);
640 } else { 642 } else {
641 643
642#ifdef CONFIG_PCI 644#ifdef CONFIG_PCI_LEGACY
643 if (setup_gazelpci(cs)) 645 if (setup_gazelpci(cs))
644 return (0); 646 return (0);
645#else 647#else
diff --git a/drivers/isdn/hisax/niccy.c b/drivers/isdn/hisax/niccy.c
index e5918c6fe73d..bd9921128aa8 100644
--- a/drivers/isdn/hisax/niccy.c
+++ b/drivers/isdn/hisax/niccy.c
@@ -223,7 +223,6 @@ static int niccy_card_msg(struct IsdnCardState *cs, int mt, void *arg)
223 return 0; 223 return 0;
224} 224}
225 225
226static struct pci_dev *niccy_dev __devinitdata = NULL;
227#ifdef __ISAPNP__ 226#ifdef __ISAPNP__
228static struct pnp_card *pnp_c __devinitdata = NULL; 227static struct pnp_card *pnp_c __devinitdata = NULL;
229#endif 228#endif
@@ -299,7 +298,9 @@ int __devinit setup_niccy(struct IsdnCard *card)
299 return 0; 298 return 0;
300 } 299 }
301 } else { 300 } else {
302#ifdef CONFIG_PCI 301#ifdef CONFIG_PCI_LEGACY
302 static struct pci_dev *niccy_dev __devinitdata;
303
303 u_int pci_ioaddr; 304 u_int pci_ioaddr;
304 cs->subtyp = 0; 305 cs->subtyp = 0;
305 if ((niccy_dev = pci_find_device(PCI_VENDOR_ID_SATSAGEM, 306 if ((niccy_dev = pci_find_device(PCI_VENDOR_ID_SATSAGEM,
@@ -356,7 +357,7 @@ int __devinit setup_niccy(struct IsdnCard *card)
356 printk(KERN_WARNING "Niccy: io0 0 and NO_PCI_BIOS\n"); 357 printk(KERN_WARNING "Niccy: io0 0 and NO_PCI_BIOS\n");
357 printk(KERN_WARNING "Niccy: unable to config NICCY PCI\n"); 358 printk(KERN_WARNING "Niccy: unable to config NICCY PCI\n");
358 return 0; 359 return 0;
359#endif /* CONFIG_PCI */ 360#endif /* CONFIG_PCI_LEGACY */
360 } 361 }
361 printk(KERN_INFO "HiSax: %s %s config irq:%d data:0x%X ale:0x%X\n", 362 printk(KERN_INFO "HiSax: %s %s config irq:%d data:0x%X ale:0x%X\n",
362 CardType[cs->typ], (cs->subtyp == 1) ? "PnP" : "PCI", 363 CardType[cs->typ], (cs->subtyp == 1) ? "PnP" : "PCI",
diff --git a/drivers/isdn/hisax/sedlbauer.c b/drivers/isdn/hisax/sedlbauer.c
index 03dfc32166a0..95425f3d2220 100644
--- a/drivers/isdn/hisax/sedlbauer.c
+++ b/drivers/isdn/hisax/sedlbauer.c
@@ -600,7 +600,7 @@ setup_sedlbauer_isapnp(struct IsdnCard *card, int *bytecnt)
600} 600}
601#endif /* __ISAPNP__ */ 601#endif /* __ISAPNP__ */
602 602
603#ifdef CONFIG_PCI 603#ifdef CONFIG_PCI_LEGACY
604static struct pci_dev *dev_sedl __devinitdata = NULL; 604static struct pci_dev *dev_sedl __devinitdata = NULL;
605 605
606static int __devinit 606static int __devinit
@@ -675,7 +675,7 @@ setup_sedlbauer_pci(struct IsdnCard *card)
675 return (1); 675 return (1);
676} 676}
677 677
678#endif /* CONFIG_PCI */ 678#endif /* CONFIG_PCI_LEGACY */
679 679
680int __devinit 680int __devinit
681setup_sedlbauer(struct IsdnCard *card) 681setup_sedlbauer(struct IsdnCard *card)
diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
index 47d90db280ce..99bc50059d35 100644
--- a/drivers/leds/leds-gpio.c
+++ b/drivers/leds/leds-gpio.c
@@ -60,7 +60,7 @@ static void gpio_led_set(struct led_classdev *led_cdev,
60 gpio_set_value(led_dat->gpio, level); 60 gpio_set_value(led_dat->gpio, level);
61} 61}
62 62
63static int __init gpio_led_probe(struct platform_device *pdev) 63static int gpio_led_probe(struct platform_device *pdev)
64{ 64{
65 struct gpio_led_platform_data *pdata = pdev->dev.platform_data; 65 struct gpio_led_platform_data *pdata = pdev->dev.platform_data;
66 struct gpio_led *cur_led; 66 struct gpio_led *cur_led;
@@ -93,13 +93,13 @@ static int __init gpio_led_probe(struct platform_device *pdev)
93 93
94 gpio_direction_output(led_dat->gpio, led_dat->active_low); 94 gpio_direction_output(led_dat->gpio, led_dat->active_low);
95 95
96 INIT_WORK(&led_dat->work, gpio_led_work);
97
96 ret = led_classdev_register(&pdev->dev, &led_dat->cdev); 98 ret = led_classdev_register(&pdev->dev, &led_dat->cdev);
97 if (ret < 0) { 99 if (ret < 0) {
98 gpio_free(led_dat->gpio); 100 gpio_free(led_dat->gpio);
99 goto err; 101 goto err;
100 } 102 }
101
102 INIT_WORK(&led_dat->work, gpio_led_work);
103 } 103 }
104 104
105 platform_set_drvdata(pdev, leds_data); 105 platform_set_drvdata(pdev, leds_data);
@@ -110,17 +110,17 @@ err:
110 if (i > 0) { 110 if (i > 0) {
111 for (i = i - 1; i >= 0; i--) { 111 for (i = i - 1; i >= 0; i--) {
112 led_classdev_unregister(&leds_data[i].cdev); 112 led_classdev_unregister(&leds_data[i].cdev);
113 cancel_work_sync(&leds_data[i].work);
113 gpio_free(leds_data[i].gpio); 114 gpio_free(leds_data[i].gpio);
114 } 115 }
115 } 116 }
116 117
117 flush_scheduled_work();
118 kfree(leds_data); 118 kfree(leds_data);
119 119
120 return ret; 120 return ret;
121} 121}
122 122
123static int __exit gpio_led_remove(struct platform_device *pdev) 123static int __devexit gpio_led_remove(struct platform_device *pdev)
124{ 124{
125 int i; 125 int i;
126 struct gpio_led_platform_data *pdata = pdev->dev.platform_data; 126 struct gpio_led_platform_data *pdata = pdev->dev.platform_data;
@@ -130,9 +130,10 @@ static int __exit gpio_led_remove(struct platform_device *pdev)
130 130
131 for (i = 0; i < pdata->num_leds; i++) { 131 for (i = 0; i < pdata->num_leds; i++) {
132 led_classdev_unregister(&leds_data[i].cdev); 132 led_classdev_unregister(&leds_data[i].cdev);
133 cancel_work_sync(&leds_data[i].work);
133 gpio_free(leds_data[i].gpio); 134 gpio_free(leds_data[i].gpio);
134 } 135 }
135 136
136 kfree(leds_data); 137 kfree(leds_data);
137 138
138 return 0; 139 return 0;
@@ -144,7 +145,7 @@ static int gpio_led_suspend(struct platform_device *pdev, pm_message_t state)
144 struct gpio_led_platform_data *pdata = pdev->dev.platform_data; 145 struct gpio_led_platform_data *pdata = pdev->dev.platform_data;
145 struct gpio_led_data *leds_data; 146 struct gpio_led_data *leds_data;
146 int i; 147 int i;
147 148
148 leds_data = platform_get_drvdata(pdev); 149 leds_data = platform_get_drvdata(pdev);
149 150
150 for (i = 0; i < pdata->num_leds; i++) 151 for (i = 0; i < pdata->num_leds; i++)
@@ -172,7 +173,8 @@ static int gpio_led_resume(struct platform_device *pdev)
172#endif 173#endif
173 174
174static struct platform_driver gpio_led_driver = { 175static struct platform_driver gpio_led_driver = {
175 .remove = __exit_p(gpio_led_remove), 176 .probe = gpio_led_probe,
177 .remove = __devexit_p(gpio_led_remove),
176 .suspend = gpio_led_suspend, 178 .suspend = gpio_led_suspend,
177 .resume = gpio_led_resume, 179 .resume = gpio_led_resume,
178 .driver = { 180 .driver = {
@@ -183,7 +185,7 @@ static struct platform_driver gpio_led_driver = {
183 185
184static int __init gpio_led_init(void) 186static int __init gpio_led_init(void)
185{ 187{
186 return platform_driver_probe(&gpio_led_driver, gpio_led_probe); 188 return platform_driver_register(&gpio_led_driver);
187} 189}
188 190
189static void __exit gpio_led_exit(void) 191static void __exit gpio_led_exit(void)
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 80a67d789b72..82af3465a900 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -2624,6 +2624,13 @@ static void handle_stripe5(struct stripe_head *sh)
2624 s.expanded = test_bit(STRIPE_EXPAND_READY, &sh->state); 2624 s.expanded = test_bit(STRIPE_EXPAND_READY, &sh->state);
2625 /* Now to look around and see what can be done */ 2625 /* Now to look around and see what can be done */
2626 2626
2627 /* clean-up completed biofill operations */
2628 if (test_bit(STRIPE_OP_BIOFILL, &sh->ops.complete)) {
2629 clear_bit(STRIPE_OP_BIOFILL, &sh->ops.pending);
2630 clear_bit(STRIPE_OP_BIOFILL, &sh->ops.ack);
2631 clear_bit(STRIPE_OP_BIOFILL, &sh->ops.complete);
2632 }
2633
2627 rcu_read_lock(); 2634 rcu_read_lock();
2628 for (i=disks; i--; ) { 2635 for (i=disks; i--; ) {
2629 mdk_rdev_t *rdev; 2636 mdk_rdev_t *rdev;
@@ -2897,13 +2904,6 @@ static void handle_stripe6(struct stripe_head *sh, struct page *tmp_page)
2897 s.expanded = test_bit(STRIPE_EXPAND_READY, &sh->state); 2904 s.expanded = test_bit(STRIPE_EXPAND_READY, &sh->state);
2898 /* Now to look around and see what can be done */ 2905 /* Now to look around and see what can be done */
2899 2906
2900 /* clean-up completed biofill operations */
2901 if (test_bit(STRIPE_OP_BIOFILL, &sh->ops.complete)) {
2902 clear_bit(STRIPE_OP_BIOFILL, &sh->ops.pending);
2903 clear_bit(STRIPE_OP_BIOFILL, &sh->ops.ack);
2904 clear_bit(STRIPE_OP_BIOFILL, &sh->ops.complete);
2905 }
2906
2907 rcu_read_lock(); 2907 rcu_read_lock();
2908 for (i=disks; i--; ) { 2908 for (i=disks; i--; ) {
2909 mdk_rdev_t *rdev; 2909 mdk_rdev_t *rdev;
diff --git a/drivers/media/Kconfig b/drivers/media/Kconfig
index dd9bd4310c84..1604f0490404 100644
--- a/drivers/media/Kconfig
+++ b/drivers/media/Kconfig
@@ -151,6 +151,7 @@ config VIDEO_IR_I2C
151 151
152config VIDEO_IR 152config VIDEO_IR
153 tristate 153 tristate
154 depends on INPUT
154 select VIDEO_IR_I2C if I2C 155 select VIDEO_IR_I2C if I2C
155 156
156config VIDEO_TVEEPROM 157config VIDEO_TVEEPROM
diff --git a/drivers/media/common/saa7146_core.c b/drivers/media/common/saa7146_core.c
index cb034ead95ab..7d04a6fd1acb 100644
--- a/drivers/media/common/saa7146_core.c
+++ b/drivers/media/common/saa7146_core.c
@@ -59,43 +59,89 @@ void saa7146_setgpio(struct saa7146_dev *dev, int port, u32 data)
59} 59}
60 60
61/* This DEBI code is based on the saa7146 Stradis driver by Nathan Laredo */ 61/* This DEBI code is based on the saa7146 Stradis driver by Nathan Laredo */
62int saa7146_wait_for_debi_done(struct saa7146_dev *dev, int nobusyloop) 62static inline int saa7146_wait_for_debi_done_sleep(struct saa7146_dev *dev,
63 unsigned long us1, unsigned long us2)
63{ 64{
64 unsigned long start; 65 unsigned long timeout;
65 int err; 66 int err;
66 67
67 /* wait for registers to be programmed */ 68 /* wait for registers to be programmed */
68 start = jiffies; 69 timeout = jiffies + usecs_to_jiffies(us1);
69 while (1) { 70 while (1) {
70 err = time_after(jiffies, start + HZ/20); 71 err = time_after(jiffies, timeout);
71 if (saa7146_read(dev, MC2) & 2) 72 if (saa7146_read(dev, MC2) & 2)
72 break; 73 break;
73 if (err) { 74 if (err) {
74 DEB_S(("timed out while waiting for registers getting programmed\n")); 75 printk(KERN_ERR "%s: %s timed out while waiting for "
76 "registers getting programmed\n",
77 dev->name, __FUNCTION__);
75 return -ETIMEDOUT; 78 return -ETIMEDOUT;
76 } 79 }
77 if (nobusyloop) 80 msleep(1);
78 msleep(1);
79 } 81 }
80 82
81 /* wait for transfer to complete */ 83 /* wait for transfer to complete */
82 start = jiffies; 84 timeout = jiffies + usecs_to_jiffies(us2);
83 while (1) { 85 while (1) {
84 err = time_after(jiffies, start + HZ/4); 86 err = time_after(jiffies, timeout);
85 if (!(saa7146_read(dev, PSR) & SPCI_DEBI_S)) 87 if (!(saa7146_read(dev, PSR) & SPCI_DEBI_S))
86 break; 88 break;
87 saa7146_read(dev, MC2); 89 saa7146_read(dev, MC2);
88 if (err) { 90 if (err) {
89 DEB_S(("timed out while waiting for transfer completion\n")); 91 DEB_S(("%s: %s timed out while waiting for transfer "
92 "completion\n", dev->name, __FUNCTION__));
90 return -ETIMEDOUT; 93 return -ETIMEDOUT;
91 } 94 }
92 if (nobusyloop) 95 msleep(1);
93 msleep(1);
94 } 96 }
95 97
96 return 0; 98 return 0;
97} 99}
98 100
101static inline int saa7146_wait_for_debi_done_busyloop(struct saa7146_dev *dev,
102 unsigned long us1, unsigned long us2)
103{
104 unsigned long loops;
105
106 /* wait for registers to be programmed */
107 loops = us1;
108 while (1) {
109 if (saa7146_read(dev, MC2) & 2)
110 break;
111 if (!loops--) {
112 printk(KERN_ERR "%s: %s timed out while waiting for "
113 "registers getting programmed\n",
114 dev->name, __FUNCTION__);
115 return -ETIMEDOUT;
116 }
117 udelay(1);
118 }
119
120 /* wait for transfer to complete */
121 loops = us2 / 5;
122 while (1) {
123 if (!(saa7146_read(dev, PSR) & SPCI_DEBI_S))
124 break;
125 saa7146_read(dev, MC2);
126 if (!loops--) {
127 DEB_S(("%s: %s timed out while waiting for transfer "
128 "completion\n", dev->name, __FUNCTION__));
129 return -ETIMEDOUT;
130 }
131 udelay(5);
132 }
133
134 return 0;
135}
136
137int saa7146_wait_for_debi_done(struct saa7146_dev *dev, int nobusyloop)
138{
139 if (nobusyloop)
140 return saa7146_wait_for_debi_done_sleep(dev, 50000, 250000);
141 else
142 return saa7146_wait_for_debi_done_busyloop(dev, 50000, 250000);
143}
144
99/**************************************************************************** 145/****************************************************************************
100 * general helper functions 146 * general helper functions
101 ****************************************************************************/ 147 ****************************************************************************/
diff --git a/drivers/media/dvb/frontends/mt2131.c b/drivers/media/dvb/frontends/mt2131.c
index 4b93931de4e1..13cf16668171 100644
--- a/drivers/media/dvb/frontends/mt2131.c
+++ b/drivers/media/dvb/frontends/mt2131.c
@@ -116,7 +116,7 @@ static int mt2131_set_params(struct dvb_frontend *fe,
116 f_lo1 = (f_lo1 / 250) * 250; 116 f_lo1 = (f_lo1 / 250) * 250;
117 f_lo2 = f_lo1 - freq - MT2131_IF2; 117 f_lo2 = f_lo1 - freq - MT2131_IF2;
118 118
119 priv->frequency = (f_lo1 - f_lo2 - MT2131_IF2) * 1000, 119 priv->frequency = (f_lo1 - f_lo2 - MT2131_IF2) * 1000;
120 120
121 /* Frequency LO1 = 16MHz * (DIV1 + NUM1/8192 ) */ 121 /* Frequency LO1 = 16MHz * (DIV1 + NUM1/8192 ) */
122 num1 = f_lo1 * 64 / (MT2131_FREF / 128); 122 num1 = f_lo1 * 64 / (MT2131_FREF / 128);
diff --git a/drivers/media/dvb/frontends/s5h1409.c b/drivers/media/dvb/frontends/s5h1409.c
index 30e8a705fad4..8dee7ec9456a 100644
--- a/drivers/media/dvb/frontends/s5h1409.c
+++ b/drivers/media/dvb/frontends/s5h1409.c
@@ -42,6 +42,9 @@ struct s5h1409_state {
42 fe_modulation_t current_modulation; 42 fe_modulation_t current_modulation;
43 43
44 u32 current_frequency; 44 u32 current_frequency;
45
46 u32 is_qam_locked;
47 u32 qam_state;
45}; 48};
46 49
47static int debug = 0; 50static int debug = 0;
@@ -94,6 +97,7 @@ static struct init_tab {
94 { 0xac, 0x1003, }, 97 { 0xac, 0x1003, },
95 { 0xad, 0x103f, }, 98 { 0xad, 0x103f, },
96 { 0xe2, 0x0100, }, 99 { 0xe2, 0x0100, },
100 { 0xe3, 0x0000, },
97 { 0x28, 0x1010, }, 101 { 0x28, 0x1010, },
98 { 0xb1, 0x000e, }, 102 { 0xb1, 0x000e, },
99}; 103};
@@ -335,6 +339,8 @@ static int s5h1409_softreset(struct dvb_frontend* fe)
335 339
336 s5h1409_writereg(state, 0xf5, 0); 340 s5h1409_writereg(state, 0xf5, 0);
337 s5h1409_writereg(state, 0xf5, 1); 341 s5h1409_writereg(state, 0xf5, 1);
342 state->is_qam_locked = 0;
343 state->qam_state = 0;
338 return 0; 344 return 0;
339} 345}
340 346
@@ -349,6 +355,11 @@ static int s5h1409_set_if_freq(struct dvb_frontend* fe, int KHz)
349 s5h1409_writereg(state, 0x87, 0x01be); 355 s5h1409_writereg(state, 0x87, 0x01be);
350 s5h1409_writereg(state, 0x88, 0x0436); 356 s5h1409_writereg(state, 0x88, 0x0436);
351 s5h1409_writereg(state, 0x89, 0x054d); 357 s5h1409_writereg(state, 0x89, 0x054d);
358 } else
359 if (KHz == 4000) {
360 s5h1409_writereg(state, 0x87, 0x014b);
361 s5h1409_writereg(state, 0x88, 0x0cb5);
362 s5h1409_writereg(state, 0x89, 0x03e2);
352 } else { 363 } else {
353 printk("%s() Invalid arg = %d KHz\n", __FUNCTION__, KHz); 364 printk("%s() Invalid arg = %d KHz\n", __FUNCTION__, KHz);
354 ret = -1; 365 ret = -1;
@@ -361,7 +372,7 @@ static int s5h1409_set_spectralinversion(struct dvb_frontend* fe, int inverted)
361{ 372{
362 struct s5h1409_state* state = fe->demodulator_priv; 373 struct s5h1409_state* state = fe->demodulator_priv;
363 374
364 dprintk("%s()\n", __FUNCTION__); 375 dprintk("%s(%d)\n", __FUNCTION__, inverted);
365 376
366 if(inverted == 1) 377 if(inverted == 1)
367 return s5h1409_writereg(state, 0x1b, 0x1101); /* Inverted */ 378 return s5h1409_writereg(state, 0x1b, 0x1101); /* Inverted */
@@ -382,14 +393,10 @@ static int s5h1409_enable_modulation(struct dvb_frontend* fe,
382 s5h1409_writereg(state, 0xf4, 0); 393 s5h1409_writereg(state, 0xf4, 0);
383 break; 394 break;
384 case QAM_64: 395 case QAM_64:
385 dprintk("%s() QAM_64\n", __FUNCTION__);
386 s5h1409_writereg(state, 0xf4, 1);
387 s5h1409_writereg(state, 0x85, 0x100);
388 break;
389 case QAM_256: 396 case QAM_256:
390 dprintk("%s() QAM_256\n", __FUNCTION__); 397 dprintk("%s() QAM_AUTO (64/256)\n", __FUNCTION__);
391 s5h1409_writereg(state, 0xf4, 1); 398 s5h1409_writereg(state, 0xf4, 1);
392 s5h1409_writereg(state, 0x85, 0x101); 399 s5h1409_writereg(state, 0x85, 0x110);
393 break; 400 break;
394 default: 401 default:
395 dprintk("%s() Invalid modulation\n", __FUNCTION__); 402 dprintk("%s() Invalid modulation\n", __FUNCTION__);
@@ -423,7 +430,7 @@ static int s5h1409_set_gpio(struct dvb_frontend* fe, int enable)
423 if (enable) 430 if (enable)
424 return s5h1409_writereg(state, 0xe3, 0x1100); 431 return s5h1409_writereg(state, 0xe3, 0x1100);
425 else 432 else
426 return s5h1409_writereg(state, 0xe3, 0); 433 return s5h1409_writereg(state, 0xe3, 0x1000);
427} 434}
428 435
429static int s5h1409_sleep(struct dvb_frontend* fe, int enable) 436static int s5h1409_sleep(struct dvb_frontend* fe, int enable)
@@ -444,6 +451,66 @@ static int s5h1409_register_reset(struct dvb_frontend* fe)
444 return s5h1409_writereg(state, 0xfa, 0); 451 return s5h1409_writereg(state, 0xfa, 0);
445} 452}
446 453
454static void s5h1409_set_qam_amhum_mode(struct dvb_frontend *fe)
455{
456 struct s5h1409_state *state = fe->demodulator_priv;
457 u16 reg;
458
459 if (state->is_qam_locked)
460 return;
461
462 /* QAM EQ lock check */
463 reg = s5h1409_readreg(state, 0xf0);
464
465 if ((reg >> 13) & 0x1) {
466
467 state->is_qam_locked = 1;
468 reg &= 0xff;
469
470 s5h1409_writereg(state, 0x96, 0x00c);
471 if ((reg < 0x38) || (reg > 0x68) ) {
472 s5h1409_writereg(state, 0x93, 0x3332);
473 s5h1409_writereg(state, 0x9e, 0x2c37);
474 } else {
475 s5h1409_writereg(state, 0x93, 0x3130);
476 s5h1409_writereg(state, 0x9e, 0x2836);
477 }
478
479 } else {
480 s5h1409_writereg(state, 0x96, 0x0008);
481 s5h1409_writereg(state, 0x93, 0x3332);
482 s5h1409_writereg(state, 0x9e, 0x2c37);
483 }
484}
485
486static void s5h1409_set_qam_interleave_mode(struct dvb_frontend *fe)
487{
488 struct s5h1409_state *state = fe->demodulator_priv;
489 u16 reg, reg1, reg2;
490
491 reg = s5h1409_readreg(state, 0xf1);
492
493 /* Master lock */
494 if ((reg >> 15) & 0x1) {
495 if (state->qam_state != 2) {
496 state->qam_state = 2;
497 reg1 = s5h1409_readreg(state, 0xb2);
498 reg2 = s5h1409_readreg(state, 0xad);
499
500 s5h1409_writereg(state, 0x96, 0x20);
501 s5h1409_writereg(state, 0xad,
502 ( ((reg1 & 0xf000) >> 4) | (reg2 & 0xf0ff)) );
503 s5h1409_writereg(state, 0xab, 0x1100);
504 }
505 } else {
506 if (state->qam_state != 1) {
507 state->qam_state = 1;
508 s5h1409_writereg(state, 0x96, 0x08);
509 s5h1409_writereg(state, 0xab, 0x1101);
510 }
511 }
512}
513
447/* Talk to the demod, set the FEC, GUARD, QAM settings etc */ 514/* Talk to the demod, set the FEC, GUARD, QAM settings etc */
448static int s5h1409_set_frontend (struct dvb_frontend* fe, 515static int s5h1409_set_frontend (struct dvb_frontend* fe,
449 struct dvb_frontend_parameters *p) 516 struct dvb_frontend_parameters *p)
@@ -458,12 +525,21 @@ static int s5h1409_set_frontend (struct dvb_frontend* fe,
458 525
459 s5h1409_enable_modulation(fe, p->u.vsb.modulation); 526 s5h1409_enable_modulation(fe, p->u.vsb.modulation);
460 527
528 /* Allow the demod to settle */
529 msleep(100);
530
461 if (fe->ops.tuner_ops.set_params) { 531 if (fe->ops.tuner_ops.set_params) {
462 if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 1); 532 if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 1);
463 fe->ops.tuner_ops.set_params(fe, p); 533 fe->ops.tuner_ops.set_params(fe, p);
464 if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0); 534 if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
465 } 535 }
466 536
537 /* Optimize the demod for QAM */
538 if (p->u.vsb.modulation != VSB_8) {
539 s5h1409_set_qam_amhum_mode(fe);
540 s5h1409_set_qam_interleave_mode(fe);
541 }
542
467 return 0; 543 return 0;
468} 544}
469 545
@@ -495,8 +571,8 @@ static int s5h1409_init (struct dvb_frontend* fe)
495 s5h1409_set_gpio(fe, state->config->gpio); 571 s5h1409_set_gpio(fe, state->config->gpio);
496 s5h1409_softreset(fe); 572 s5h1409_softreset(fe);
497 573
498 /* Note: Leaving the I2C gate open here. */ 574 /* Note: Leaving the I2C gate closed. */
499 s5h1409_i2c_gate_ctrl(fe, 1); 575 s5h1409_i2c_gate_ctrl(fe, 0);
500 576
501 return 0; 577 return 0;
502} 578}
diff --git a/drivers/media/dvb/frontends/stv0297.c b/drivers/media/dvb/frontends/stv0297.c
index 17e5cb561cd8..7c23775f77db 100644
--- a/drivers/media/dvb/frontends/stv0297.c
+++ b/drivers/media/dvb/frontends/stv0297.c
@@ -358,11 +358,23 @@ static int stv0297_read_ber(struct dvb_frontend *fe, u32 * ber)
358static int stv0297_read_signal_strength(struct dvb_frontend *fe, u16 * strength) 358static int stv0297_read_signal_strength(struct dvb_frontend *fe, u16 * strength)
359{ 359{
360 struct stv0297_state *state = fe->demodulator_priv; 360 struct stv0297_state *state = fe->demodulator_priv;
361 u8 STRENGTH[2]; 361 u8 STRENGTH[3];
362 362 u16 tmp;
363 stv0297_readregs(state, 0x41, STRENGTH, 2); 363
364 *strength = (STRENGTH[1] & 0x03) << 8 | STRENGTH[0]; 364 stv0297_readregs(state, 0x41, STRENGTH, 3);
365 365 tmp = (STRENGTH[1] & 0x03) << 8 | STRENGTH[0];
366 if (STRENGTH[2] & 0x20) {
367 if (tmp < 0x200)
368 tmp = 0;
369 else
370 tmp = tmp - 0x200;
371 } else {
372 if (tmp > 0x1ff)
373 tmp = 0;
374 else
375 tmp = 0x1ff - tmp;
376 }
377 *strength = (tmp << 7) | (tmp >> 2);
366 return 0; 378 return 0;
367} 379}
368 380
diff --git a/drivers/media/dvb/frontends/tda10021.c b/drivers/media/dvb/frontends/tda10021.c
index 4cd9e82c4669..45137d2ebfb9 100644
--- a/drivers/media/dvb/frontends/tda10021.c
+++ b/drivers/media/dvb/frontends/tda10021.c
@@ -301,6 +301,8 @@ static int tda10021_read_ber(struct dvb_frontend* fe, u32* ber)
301 u32 _ber = tda10021_readreg(state, 0x14) | 301 u32 _ber = tda10021_readreg(state, 0x14) |
302 (tda10021_readreg(state, 0x15) << 8) | 302 (tda10021_readreg(state, 0x15) << 8) |
303 ((tda10021_readreg(state, 0x16) & 0x0f) << 16); 303 ((tda10021_readreg(state, 0x16) & 0x0f) << 16);
304 _tda10021_writereg(state, 0x10, (tda10021_readreg(state, 0x10) & ~0xc0)
305 | (tda10021_inittab[0x10] & 0xc0));
304 *ber = 10 * _ber; 306 *ber = 10 * _ber;
305 307
306 return 0; 308 return 0;
@@ -310,7 +312,11 @@ static int tda10021_read_signal_strength(struct dvb_frontend* fe, u16* strength)
310{ 312{
311 struct tda10021_state* state = fe->demodulator_priv; 313 struct tda10021_state* state = fe->demodulator_priv;
312 314
315 u8 config = tda10021_readreg(state, 0x02);
313 u8 gain = tda10021_readreg(state, 0x17); 316 u8 gain = tda10021_readreg(state, 0x17);
317 if (config & 0x02)
318 /* the agc value is inverted */
319 gain = ~gain;
314 *strength = (gain << 8) | gain; 320 *strength = (gain << 8) | gain;
315 321
316 return 0; 322 return 0;
diff --git a/drivers/media/dvb/frontends/ves1820.c b/drivers/media/dvb/frontends/ves1820.c
index 066b73b75698..60433b5011fd 100644
--- a/drivers/media/dvb/frontends/ves1820.c
+++ b/drivers/media/dvb/frontends/ves1820.c
@@ -47,7 +47,7 @@ struct ves1820_state {
47static int verbose; 47static int verbose;
48 48
49static u8 ves1820_inittab[] = { 49static u8 ves1820_inittab[] = {
50 0x69, 0x6A, 0x93, 0x12, 0x12, 0x46, 0x26, 0x1A, 50 0x69, 0x6A, 0x93, 0x1A, 0x12, 0x46, 0x26, 0x1A,
51 0x43, 0x6A, 0xAA, 0xAA, 0x1E, 0x85, 0x43, 0x20, 51 0x43, 0x6A, 0xAA, 0xAA, 0x1E, 0x85, 0x43, 0x20,
52 0xE0, 0x00, 0xA1, 0x00, 0x00, 0x00, 0x00, 0x00, 52 0xE0, 0x00, 0xA1, 0x00, 0x00, 0x00, 0x00, 0x00,
53 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 53 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
diff --git a/drivers/media/dvb/ttpci/Kconfig b/drivers/media/dvb/ttpci/Kconfig
index 6d53289b3276..54b91f26ca63 100644
--- a/drivers/media/dvb/ttpci/Kconfig
+++ b/drivers/media/dvb/ttpci/Kconfig
@@ -84,7 +84,7 @@ config DVB_BUDGET
84 84
85config DVB_BUDGET_CI 85config DVB_BUDGET_CI
86 tristate "Budget cards with onboard CI connector" 86 tristate "Budget cards with onboard CI connector"
87 depends on DVB_CORE && PCI && I2C && VIDEO_V4L1 87 depends on DVB_CORE && PCI && I2C && VIDEO_V4L1 && INPUT
88 select VIDEO_SAA7146 88 select VIDEO_SAA7146
89 select DVB_STV0297 if !DVB_FE_CUSTOMISE 89 select DVB_STV0297 if !DVB_FE_CUSTOMISE
90 select DVB_STV0299 if !DVB_FE_CUSTOMISE 90 select DVB_STV0299 if !DVB_FE_CUSTOMISE
diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
index 2e571eb9313a..c9f14bfc8544 100644
--- a/drivers/media/video/Kconfig
+++ b/drivers/media/video/Kconfig
@@ -363,7 +363,7 @@ endmenu # encoder / decoder chips
363 363
364config VIDEO_VIVI 364config VIDEO_VIVI
365 tristate "Virtual Video Driver" 365 tristate "Virtual Video Driver"
366 depends on VIDEO_V4L2 && !SPARC32 && !SPARC64 && PCI 366 depends on VIDEO_V4L2 && !SPARC32 && !SPARC64
367 select VIDEOBUF_VMALLOC 367 select VIDEOBUF_VMALLOC
368 default n 368 default n
369 ---help--- 369 ---help---
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
index 9feeb636ff9b..a88b56e6ca05 100644
--- a/drivers/media/video/bt8xx/bttv-driver.c
+++ b/drivers/media/video/bt8xx/bttv-driver.c
@@ -2881,10 +2881,6 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
2881 if (NULL == fmt) 2881 if (NULL == fmt)
2882 return -EINVAL; 2882 return -EINVAL;
2883 mutex_lock(&fh->cap.lock); 2883 mutex_lock(&fh->cap.lock);
2884 if (fmt->depth != pic->depth) {
2885 retval = -EINVAL;
2886 goto fh_unlock_and_return;
2887 }
2888 if (fmt->flags & FORMAT_FLAGS_RAW) { 2884 if (fmt->flags & FORMAT_FLAGS_RAW) {
2889 /* VIDIOCMCAPTURE uses gbufsize, not RAW_BPL * 2885 /* VIDIOCMCAPTURE uses gbufsize, not RAW_BPL *
2890 RAW_LINES * 2. F1 is stored at offset 0, F2 2886 RAW_LINES * 2. F1 is stored at offset 0, F2
@@ -3117,6 +3113,8 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
3117 vm->width,vm->height,field); 3113 vm->width,vm->height,field);
3118 if (0 != retval) 3114 if (0 != retval)
3119 goto fh_unlock_and_return; 3115 goto fh_unlock_and_return;
3116 btv->init.width = vm->width;
3117 btv->init.height = vm->height;
3120 spin_lock_irqsave(&btv->s_lock,flags); 3118 spin_lock_irqsave(&btv->s_lock,flags);
3121 buffer_queue(&fh->cap,&buf->vb); 3119 buffer_queue(&fh->cap,&buf->vb);
3122 spin_unlock_irqrestore(&btv->s_lock,flags); 3120 spin_unlock_irqrestore(&btv->s_lock,flags);
diff --git a/drivers/media/video/cafe_ccic.c b/drivers/media/video/cafe_ccic.c
index b63cab336920..7ae499c9c54c 100644
--- a/drivers/media/video/cafe_ccic.c
+++ b/drivers/media/video/cafe_ccic.c
@@ -3,6 +3,9 @@
3 * multifunction chip. Currently works with the Omnivision OV7670 3 * multifunction chip. Currently works with the Omnivision OV7670
4 * sensor. 4 * sensor.
5 * 5 *
6 * The data sheet for this device can be found at:
7 * http://www.marvell.com/products/pcconn/88ALP01.jsp
8 *
6 * Copyright 2006 One Laptop Per Child Association, Inc. 9 * Copyright 2006 One Laptop Per Child Association, Inc.
7 * Copyright 2006-7 Jonathan Corbet <corbet@lwn.net> 10 * Copyright 2006-7 Jonathan Corbet <corbet@lwn.net>
8 * 11 *
@@ -2232,13 +2235,16 @@ static int cafe_pci_suspend(struct pci_dev *pdev, pm_message_t state)
2232{ 2235{
2233 struct cafe_camera *cam = cafe_find_by_pdev(pdev); 2236 struct cafe_camera *cam = cafe_find_by_pdev(pdev);
2234 int ret; 2237 int ret;
2238 enum cafe_state cstate;
2235 2239
2236 ret = pci_save_state(pdev); 2240 ret = pci_save_state(pdev);
2237 if (ret) 2241 if (ret)
2238 return ret; 2242 return ret;
2243 cstate = cam->state; /* HACK - stop_dma sets to idle */
2239 cafe_ctlr_stop_dma(cam); 2244 cafe_ctlr_stop_dma(cam);
2240 cafe_ctlr_power_down(cam); 2245 cafe_ctlr_power_down(cam);
2241 pci_disable_device(pdev); 2246 pci_disable_device(pdev);
2247 cam->state = cstate;
2242 return 0; 2248 return 0;
2243} 2249}
2244 2250
diff --git a/drivers/media/video/cx23885/Kconfig b/drivers/media/video/cx23885/Kconfig
index 72004a07b2d5..d8b1ccb44913 100644
--- a/drivers/media/video/cx23885/Kconfig
+++ b/drivers/media/video/cx23885/Kconfig
@@ -1,6 +1,6 @@
1config VIDEO_CX23885 1config VIDEO_CX23885
2 tristate "Conexant cx23885 (2388x successor) support" 2 tristate "Conexant cx23885 (2388x successor) support"
3 depends on DVB_CORE && VIDEO_DEV && PCI && I2C 3 depends on DVB_CORE && VIDEO_DEV && PCI && I2C && INPUT
4 select I2C_ALGOBIT 4 select I2C_ALGOBIT
5 select FW_LOADER 5 select FW_LOADER
6 select VIDEO_BTCX 6 select VIDEO_BTCX
diff --git a/drivers/media/video/cx88/Kconfig b/drivers/media/video/cx88/Kconfig
index eeb5224ca101..ceb31d4a2512 100644
--- a/drivers/media/video/cx88/Kconfig
+++ b/drivers/media/video/cx88/Kconfig
@@ -1,6 +1,6 @@
1config VIDEO_CX88 1config VIDEO_CX88
2 tristate "Conexant 2388x (bt878 successor) support" 2 tristate "Conexant 2388x (bt878 successor) support"
3 depends on VIDEO_DEV && PCI && I2C 3 depends on VIDEO_DEV && PCI && I2C && INPUT
4 select I2C_ALGOBIT 4 select I2C_ALGOBIT
5 select FW_LOADER 5 select FW_LOADER
6 select VIDEO_BTCX 6 select VIDEO_BTCX
diff --git a/drivers/media/video/em28xx/Kconfig b/drivers/media/video/em28xx/Kconfig
index 5b6a40371602..c1127802ad9c 100644
--- a/drivers/media/video/em28xx/Kconfig
+++ b/drivers/media/video/em28xx/Kconfig
@@ -1,6 +1,6 @@
1config VIDEO_EM28XX 1config VIDEO_EM28XX
2 tristate "Empia EM2800/2820/2840 USB video capture support" 2 tristate "Empia EM2800/2820/2840 USB video capture support"
3 depends on VIDEO_V4L1 && I2C 3 depends on VIDEO_V4L1 && I2C && INPUT
4 select VIDEO_TUNER 4 select VIDEO_TUNER
5 select VIDEO_TVEEPROM 5 select VIDEO_TVEEPROM
6 select VIDEO_IR 6 select VIDEO_IR
diff --git a/drivers/media/video/em28xx/em28xx-i2c.c b/drivers/media/video/em28xx/em28xx-i2c.c
index 997d067e32e0..e3a4aa7a9df4 100644
--- a/drivers/media/video/em28xx/em28xx-i2c.c
+++ b/drivers/media/video/em28xx/em28xx-i2c.c
@@ -416,8 +416,10 @@ static int attach_inform(struct i2c_client *client)
416 struct em28xx *dev = client->adapter->algo_data; 416 struct em28xx *dev = client->adapter->algo_data;
417 417
418 switch (client->addr << 1) { 418 switch (client->addr << 1) {
419 case 0x43: 419 case 0x86:
420 case 0x4b: 420 case 0x84:
421 case 0x96:
422 case 0x94:
421 { 423 {
422 struct tuner_setup tun_setup; 424 struct tuner_setup tun_setup;
423 425
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index a4c2a907124a..2529c298b862 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -32,6 +32,7 @@
32#include <linux/usb.h> 32#include <linux/usb.h>
33#include <linux/i2c.h> 33#include <linux/i2c.h>
34#include <linux/version.h> 34#include <linux/version.h>
35#include <linux/mm.h>
35#include <linux/video_decoder.h> 36#include <linux/video_decoder.h>
36#include <linux/mutex.h> 37#include <linux/mutex.h>
37 38
diff --git a/drivers/media/video/planb.c b/drivers/media/video/planb.c
index ce4b2f9791ee..36047d4e70f6 100644
--- a/drivers/media/video/planb.c
+++ b/drivers/media/video/planb.c
@@ -91,7 +91,6 @@ static void planb_close(struct video_device *);
91static int planb_ioctl(struct video_device *, unsigned int, void *); 91static int planb_ioctl(struct video_device *, unsigned int, void *);
92static int planb_init_done(struct video_device *); 92static int planb_init_done(struct video_device *);
93static int planb_mmap(struct video_device *, const char *, unsigned long); 93static int planb_mmap(struct video_device *, const char *, unsigned long);
94static void planb_irq(int, void *);
95static void release_planb(void); 94static void release_planb(void);
96int init_planbs(struct video_init *); 95int init_planbs(struct video_init *);
97 96
@@ -1315,7 +1314,7 @@ cmd_tab_data_end:
1315 return c1; 1314 return c1;
1316} 1315}
1317 1316
1318static void planb_irq(int irq, void *dev_id) 1317static irqreturn_t planb_irq(int irq, void *dev_id)
1319{ 1318{
1320 unsigned int stat, astat; 1319 unsigned int stat, astat;
1321 struct planb *pb = (struct planb *)dev_id; 1320 struct planb *pb = (struct planb *)dev_id;
@@ -1358,13 +1357,14 @@ static void planb_irq(int irq, void *dev_id)
1358 pb->frame_stat[fr] = GBUFFER_DONE; 1357 pb->frame_stat[fr] = GBUFFER_DONE;
1359 pb->grabbing--; 1358 pb->grabbing--;
1360 wake_up_interruptible(&pb->capq); 1359 wake_up_interruptible(&pb->capq);
1361 return; 1360 return IRQ_HANDLED;
1362 } 1361 }
1363 /* incorrect interrupts? */ 1362 /* incorrect interrupts? */
1364 pb->intr_mask = PLANB_CLR_IRQ; 1363 pb->intr_mask = PLANB_CLR_IRQ;
1365 out_le32(&pb->planb_base->intr_stat, PLANB_CLR_IRQ); 1364 out_le32(&pb->planb_base->intr_stat, PLANB_CLR_IRQ);
1366 printk(KERN_ERR "PlanB: IRQ lockup, cleared intrrupts" 1365 printk(KERN_ERR "PlanB: IRQ lockup, cleared intrrupts"
1367 " unconditionally\n"); 1366 " unconditionally\n");
1367 return IRQ_HANDLED;
1368} 1368}
1369 1369
1370/******************************* 1370/*******************************
@@ -2090,7 +2090,7 @@ static int init_planb(struct planb *pb)
2090 /* clear interrupt mask */ 2090 /* clear interrupt mask */
2091 pb->intr_mask = PLANB_CLR_IRQ; 2091 pb->intr_mask = PLANB_CLR_IRQ;
2092 2092
2093 result = request_irq(pb->irq, planb_irq, 0, "PlanB", (void *)pb); 2093 result = request_irq(pb->irq, planb_irq, 0, "PlanB", pb);
2094 if (result < 0) { 2094 if (result < 0) {
2095 if (result==-EINVAL) 2095 if (result==-EINVAL)
2096 printk(KERN_ERR "PlanB: Bad irq number (%d) " 2096 printk(KERN_ERR "PlanB: Bad irq number (%d) "
diff --git a/drivers/media/video/pvrusb2/pvrusb2-ctrl.c b/drivers/media/video/pvrusb2/pvrusb2-ctrl.c
index f569b00201dd..46f156fb108c 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-ctrl.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-ctrl.c
@@ -410,7 +410,7 @@ static int parse_mtoken(const char *ptr,unsigned int len,
410 int msk; 410 int msk;
411 *valptr = 0; 411 *valptr = 0;
412 for (idx = 0, msk = 1; valid_bits; idx++, msk <<= 1) { 412 for (idx = 0, msk = 1; valid_bits; idx++, msk <<= 1) {
413 if (!msk & valid_bits) continue; 413 if (!(msk & valid_bits)) continue;
414 valid_bits &= ~msk; 414 valid_bits &= ~msk;
415 if (!names[idx]) continue; 415 if (!names[idx]) continue;
416 slen = strlen(names[idx]); 416 slen = strlen(names[idx]);
diff --git a/drivers/media/video/pvrusb2/pvrusb2-main.c b/drivers/media/video/pvrusb2/pvrusb2-main.c
index ca9e2789c8ca..11b3b2e84b90 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-main.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-main.c
@@ -136,14 +136,13 @@ static int __init pvr_init(void)
136 136
137static void __exit pvr_exit(void) 137static void __exit pvr_exit(void)
138{ 138{
139
140 pvr2_trace(PVR2_TRACE_INIT,"pvr_exit"); 139 pvr2_trace(PVR2_TRACE_INIT,"pvr_exit");
141 140
141 usb_deregister(&pvr_driver);
142
142#ifdef CONFIG_VIDEO_PVRUSB2_SYSFS 143#ifdef CONFIG_VIDEO_PVRUSB2_SYSFS
143 pvr2_sysfs_class_destroy(class_ptr); 144 pvr2_sysfs_class_destroy(class_ptr);
144#endif /* CONFIG_VIDEO_PVRUSB2_SYSFS */ 145#endif /* CONFIG_VIDEO_PVRUSB2_SYSFS */
145
146 usb_deregister(&pvr_driver);
147} 146}
148 147
149module_init(pvr_init); 148module_init(pvr_init);
diff --git a/drivers/media/video/pvrusb2/pvrusb2-sysfs.c b/drivers/media/video/pvrusb2/pvrusb2-sysfs.c
index 2ee3c3049e8f..3c57a7d8200b 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-sysfs.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-sysfs.c
@@ -905,13 +905,6 @@ struct pvr2_sysfs *pvr2_sysfs_create(struct pvr2_context *mp,
905} 905}
906 906
907 907
908static int pvr2_sysfs_hotplug(struct device *d,
909 struct kobj_uevent_env *env)
910{
911 /* Even though we don't do anything here, we still need this function
912 because sysfs will still try to call it. */
913 return 0;
914}
915 908
916struct pvr2_sysfs_class *pvr2_sysfs_class_create(void) 909struct pvr2_sysfs_class *pvr2_sysfs_class_create(void)
917{ 910{
@@ -922,7 +915,6 @@ struct pvr2_sysfs_class *pvr2_sysfs_class_create(void)
922 clp->class.name = "pvrusb2"; 915 clp->class.name = "pvrusb2";
923 clp->class.class_release = pvr2_sysfs_class_release; 916 clp->class.class_release = pvr2_sysfs_class_release;
924 clp->class.dev_release = pvr2_sysfs_release; 917 clp->class.dev_release = pvr2_sysfs_release;
925 clp->class.dev_uevent = pvr2_sysfs_hotplug;
926 if (class_register(&clp->class)) { 918 if (class_register(&clp->class)) {
927 pvr2_sysfs_trace( 919 pvr2_sysfs_trace(
928 "Registration failed for pvr2_sysfs_class id=%p",clp); 920 "Registration failed for pvr2_sysfs_class id=%p",clp);
diff --git a/drivers/media/video/saa7134/Kconfig b/drivers/media/video/saa7134/Kconfig
index d6d8d660196d..3aa8cb2b860a 100644
--- a/drivers/media/video/saa7134/Kconfig
+++ b/drivers/media/video/saa7134/Kconfig
@@ -1,6 +1,6 @@
1config VIDEO_SAA7134 1config VIDEO_SAA7134
2 tristate "Philips SAA7134 support" 2 tristate "Philips SAA7134 support"
3 depends on VIDEO_DEV && PCI && I2C 3 depends on VIDEO_DEV && PCI && I2C && INPUT
4 select VIDEOBUF_DMA_SG 4 select VIDEOBUF_DMA_SG
5 select VIDEO_IR 5 select VIDEO_IR
6 select VIDEO_TUNER 6 select VIDEO_TUNER
diff --git a/drivers/media/video/saa7134/saa7134-alsa.c b/drivers/media/video/saa7134/saa7134-alsa.c
index c6f7279669c1..b9c5cf7dc849 100644
--- a/drivers/media/video/saa7134/saa7134-alsa.c
+++ b/drivers/media/video/saa7134/saa7134-alsa.c
@@ -543,8 +543,10 @@ static int snd_card_saa7134_hw_params(struct snd_pcm_substream * substream,
543 V4L functions, and force ALSA to use that as the DMA area */ 543 V4L functions, and force ALSA to use that as the DMA area */
544 544
545 substream->runtime->dma_area = dev->dmasound.dma.vmalloc; 545 substream->runtime->dma_area = dev->dmasound.dma.vmalloc;
546 substream->runtime->dma_bytes = dev->dmasound.bufsize;
547 substream->runtime->dma_addr = 0;
546 548
547 return 1; 549 return 0;
548 550
549} 551}
550 552
@@ -652,6 +654,17 @@ static int snd_card_saa7134_capture_open(struct snd_pcm_substream * substream)
652} 654}
653 655
654/* 656/*
657 * page callback (needed for mmap)
658 */
659
660static struct page *snd_card_saa7134_page(struct snd_pcm_substream *substream,
661 unsigned long offset)
662{
663 void *pageptr = substream->runtime->dma_area + offset;
664 return vmalloc_to_page(pageptr);
665}
666
667/*
655 * ALSA capture callbacks definition 668 * ALSA capture callbacks definition
656 */ 669 */
657 670
@@ -664,6 +677,7 @@ static struct snd_pcm_ops snd_card_saa7134_capture_ops = {
664 .prepare = snd_card_saa7134_capture_prepare, 677 .prepare = snd_card_saa7134_capture_prepare,
665 .trigger = snd_card_saa7134_capture_trigger, 678 .trigger = snd_card_saa7134_capture_trigger,
666 .pointer = snd_card_saa7134_capture_pointer, 679 .pointer = snd_card_saa7134_capture_pointer,
680 .page = snd_card_saa7134_page,
667}; 681};
668 682
669/* 683/*
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c
index a4c192fb4e41..4f3dad9ae6d6 100644
--- a/drivers/media/video/saa7134/saa7134-cards.c
+++ b/drivers/media/video/saa7134/saa7134-cards.c
@@ -2996,11 +2996,11 @@ struct saa7134_board saa7134_boards[] = {
2996 },{ 2996 },{
2997 .name = name_comp1, 2997 .name = name_comp1,
2998 .vmux = 0, 2998 .vmux = 0,
2999 .amux = LINE2, 2999 .amux = LINE1,
3000 },{ 3000 },{
3001 .name = name_svideo, 3001 .name = name_svideo,
3002 .vmux = 8, 3002 .vmux = 8,
3003 .amux = LINE2, 3003 .amux = LINE1,
3004 }}, 3004 }},
3005 }, 3005 },
3006 [SAA7134_BOARD_FLYDVBS_LR300] = { 3006 [SAA7134_BOARD_FLYDVBS_LR300] = {
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index 6a777604f070..9e99f3636d3d 100644
--- a/drivers/media/video/tuner-core.c
+++ b/drivers/media/video/tuner-core.c
@@ -30,7 +30,7 @@
30 30
31/* standard i2c insmod options */ 31/* standard i2c insmod options */
32static unsigned short normal_i2c[] = { 32static unsigned short normal_i2c[] = {
33#ifdef CONFIG_TUNER_TEA5761 33#if defined(CONFIG_TUNER_TEA5761) || (defined(CONFIG_TUNER_TEA5761_MODULE) && defined(MODULE))
34 0x10, 34 0x10,
35#endif 35#endif
36 0x42, 0x43, 0x4a, 0x4b, /* tda8290 */ 36 0x42, 0x43, 0x4a, 0x4b, /* tda8290 */
@@ -292,7 +292,6 @@ static void set_type(struct i2c_client *c, unsigned int type,
292 } 292 }
293 t->mode_mask = T_RADIO; 293 t->mode_mask = T_RADIO;
294 break; 294 break;
295#ifdef CONFIG_TUNER_TEA5761
296 case TUNER_TEA5761: 295 case TUNER_TEA5761:
297 if (tea5761_attach(&t->fe, t->i2c.adapter, t->i2c.addr) == NULL) { 296 if (tea5761_attach(&t->fe, t->i2c.adapter, t->i2c.addr) == NULL) {
298 t->type = TUNER_ABSENT; 297 t->type = TUNER_ABSENT;
@@ -301,7 +300,6 @@ static void set_type(struct i2c_client *c, unsigned int type,
301 } 300 }
302 t->mode_mask = T_RADIO; 301 t->mode_mask = T_RADIO;
303 break; 302 break;
304#endif
305 case TUNER_PHILIPS_FMD1216ME_MK3: 303 case TUNER_PHILIPS_FMD1216ME_MK3:
306 buffer[0] = 0x0b; 304 buffer[0] = 0x0b;
307 buffer[1] = 0xdc; 305 buffer[1] = 0xdc;
@@ -594,7 +592,6 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind)
594 /* autodetection code based on the i2c addr */ 592 /* autodetection code based on the i2c addr */
595 if (!no_autodetect) { 593 if (!no_autodetect) {
596 switch (addr) { 594 switch (addr) {
597#ifdef CONFIG_TUNER_TEA5761
598 case 0x10: 595 case 0x10:
599 if (tea5761_autodetection(t->i2c.adapter, t->i2c.addr) != EINVAL) { 596 if (tea5761_autodetection(t->i2c.adapter, t->i2c.addr) != EINVAL) {
600 t->type = TUNER_TEA5761; 597 t->type = TUNER_TEA5761;
@@ -606,7 +603,6 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind)
606 goto register_client; 603 goto register_client;
607 } 604 }
608 break; 605 break;
609#endif
610 case 0x42: 606 case 0x42:
611 case 0x43: 607 case 0x43:
612 case 0x4a: 608 case 0x4a:
diff --git a/drivers/media/video/tvp5150.c b/drivers/media/video/tvp5150.c
index e2f1c972754b..25d0aef88ef5 100644
--- a/drivers/media/video/tvp5150.c
+++ b/drivers/media/video/tvp5150.c
@@ -799,10 +799,10 @@ static inline void tvp5150_reset(struct i2c_client *c)
799 tvp5150_write_inittab(c, tvp5150_init_enable); 799 tvp5150_write_inittab(c, tvp5150_init_enable);
800 800
801 /* Initialize image preferences */ 801 /* Initialize image preferences */
802 tvp5150_write(c, TVP5150_BRIGHT_CTL, decoder->bright >> 8); 802 tvp5150_write(c, TVP5150_BRIGHT_CTL, decoder->bright);
803 tvp5150_write(c, TVP5150_CONTRAST_CTL, decoder->contrast >> 8); 803 tvp5150_write(c, TVP5150_CONTRAST_CTL, decoder->contrast);
804 tvp5150_write(c, TVP5150_SATURATION_CTL, decoder->contrast >> 8); 804 tvp5150_write(c, TVP5150_SATURATION_CTL, decoder->contrast);
805 tvp5150_write(c, TVP5150_HUE_CTL, (decoder->hue - 32768) >> 8); 805 tvp5150_write(c, TVP5150_HUE_CTL, decoder->hue);
806 806
807 tvp5150_set_std(c, decoder->norm); 807 tvp5150_set_std(c, decoder->norm);
808}; 808};
@@ -1077,10 +1077,10 @@ static int tvp5150_detect_client(struct i2c_adapter *adapter,
1077 core->norm = V4L2_STD_ALL; /* Default is autodetect */ 1077 core->norm = V4L2_STD_ALL; /* Default is autodetect */
1078 core->route.input = TVP5150_COMPOSITE1; 1078 core->route.input = TVP5150_COMPOSITE1;
1079 core->enable = 1; 1079 core->enable = 1;
1080 core->bright = 32768; 1080 core->bright = 128;
1081 core->contrast = 32768; 1081 core->contrast = 128;
1082 core->hue = 32768; 1082 core->hue = 0;
1083 core->sat = 32768; 1083 core->sat = 128;
1084 1084
1085 if (rv) { 1085 if (rv) {
1086 kfree(c); 1086 kfree(c);
diff --git a/drivers/message/i2o/i2o_block.c b/drivers/message/i2o/i2o_block.c
index 682406168de9..e4ad7a1c4fbd 100644
--- a/drivers/message/i2o/i2o_block.c
+++ b/drivers/message/i2o/i2o_block.c
@@ -1077,8 +1077,8 @@ static int i2o_block_probe(struct device *dev)
1077 blk_queue_max_sectors(queue, max_sectors); 1077 blk_queue_max_sectors(queue, max_sectors);
1078 blk_queue_max_hw_segments(queue, i2o_sg_tablesize(c, body_size)); 1078 blk_queue_max_hw_segments(queue, i2o_sg_tablesize(c, body_size));
1079 1079
1080 osm_debug("max sectors = %d\n", queue->max_phys_segments); 1080 osm_debug("max sectors = %d\n", queue->max_sectors);
1081 osm_debug("phys segments = %d\n", queue->max_sectors); 1081 osm_debug("phys segments = %d\n", queue->max_phys_segments);
1082 osm_debug("max hw segments = %d\n", queue->max_hw_segments); 1082 osm_debug("max hw segments = %d\n", queue->max_hw_segments);
1083 1083
1084 /* 1084 /*
diff --git a/drivers/net/82596.c b/drivers/net/82596.c
index bb30d5be7824..2797da7eeee6 100644
--- a/drivers/net/82596.c
+++ b/drivers/net/82596.c
@@ -1192,6 +1192,8 @@ struct net_device * __init i82596_probe(int unit)
1192 goto out; 1192 goto out;
1193 } 1193 }
1194 1194
1195 dev->base_addr = ioaddr;
1196
1195 for (i = 0; i < 8; i++) { 1197 for (i = 0; i < 8; i++) {
1196 eth_addr[i] = inb(ioaddr + 8 + i); 1198 eth_addr[i] = inb(ioaddr + 8 + i);
1197 checksum += eth_addr[i]; 1199 checksum += eth_addr[i];
@@ -1209,7 +1211,6 @@ struct net_device * __init i82596_probe(int unit)
1209 goto out1; 1211 goto out1;
1210 } 1212 }
1211 1213
1212 dev->base_addr = ioaddr;
1213 dev->irq = 10; 1214 dev->irq = 10;
1214 } 1215 }
1215#endif 1216#endif
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index d2ede5ff9fff..035fd41fb61f 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -265,7 +265,7 @@ static struct phy_driver marvell_drivers[] = {
265 .read_status = &genphy_read_status, 265 .read_status = &genphy_read_status,
266 .ack_interrupt = &marvell_ack_interrupt, 266 .ack_interrupt = &marvell_ack_interrupt,
267 .config_intr = &marvell_config_intr, 267 .config_intr = &marvell_config_intr,
268 .driver = {.owner = THIS_MODULE,}, 268 .driver = { .owner = THIS_MODULE },
269 }, 269 },
270 { 270 {
271 .phy_id = 0x01410c90, 271 .phy_id = 0x01410c90,
@@ -278,7 +278,7 @@ static struct phy_driver marvell_drivers[] = {
278 .read_status = &genphy_read_status, 278 .read_status = &genphy_read_status,
279 .ack_interrupt = &marvell_ack_interrupt, 279 .ack_interrupt = &marvell_ack_interrupt,
280 .config_intr = &marvell_config_intr, 280 .config_intr = &marvell_config_intr,
281 .driver = {.owner = THIS_MODULE,}, 281 .driver = { .owner = THIS_MODULE },
282 }, 282 },
283 { 283 {
284 .phy_id = 0x01410cc0, 284 .phy_id = 0x01410cc0,
@@ -291,7 +291,7 @@ static struct phy_driver marvell_drivers[] = {
291 .read_status = &genphy_read_status, 291 .read_status = &genphy_read_status,
292 .ack_interrupt = &marvell_ack_interrupt, 292 .ack_interrupt = &marvell_ack_interrupt,
293 .config_intr = &marvell_config_intr, 293 .config_intr = &marvell_config_intr,
294 .driver = {.owner = THIS_MODULE,}, 294 .driver = { .owner = THIS_MODULE },
295 }, 295 },
296 { 296 {
297 .phy_id = 0x01410cd0, 297 .phy_id = 0x01410cd0,
@@ -304,8 +304,21 @@ static struct phy_driver marvell_drivers[] = {
304 .read_status = &genphy_read_status, 304 .read_status = &genphy_read_status,
305 .ack_interrupt = &marvell_ack_interrupt, 305 .ack_interrupt = &marvell_ack_interrupt,
306 .config_intr = &marvell_config_intr, 306 .config_intr = &marvell_config_intr,
307 .driver = {.owner = THIS_MODULE,}, 307 .driver = { .owner = THIS_MODULE },
308 } 308 },
309 {
310 .phy_id = 0x01410e30,
311 .phy_id_mask = 0xfffffff0,
312 .name = "Marvell 88E1240",
313 .features = PHY_GBIT_FEATURES,
314 .flags = PHY_HAS_INTERRUPT,
315 .config_init = &m88e1111_config_init,
316 .config_aneg = &marvell_config_aneg,
317 .read_status = &genphy_read_status,
318 .ack_interrupt = &marvell_ack_interrupt,
319 .config_intr = &marvell_config_intr,
320 .driver = { .owner = THIS_MODULE },
321 },
309}; 322};
310 323
311static int __init marvell_init(void) 324static int __init marvell_init(void)
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index c0461217b108..f6e484812a98 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -706,7 +706,7 @@ int phy_driver_register(struct phy_driver *new_driver)
706 return retval; 706 return retval;
707 } 707 }
708 708
709 pr_info("%s: Registered new driver\n", new_driver->name); 709 pr_debug("%s: Registered new driver\n", new_driver->name);
710 710
711 return 0; 711 return 0;
712} 712}
diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c
index 120c8affe83d..c20a3bd21bb2 100644
--- a/drivers/net/sunhme.c
+++ b/drivers/net/sunhme.c
@@ -3143,8 +3143,8 @@ static int __devinit happy_meal_pci_probe(struct pci_dev *pdev,
3143 dev->irq = pdev->irq; 3143 dev->irq = pdev->irq;
3144 dev->dma = 0; 3144 dev->dma = 0;
3145 3145
3146 /* Happy Meal can do it all... */ 3146 /* Happy Meal can do it all... except VLAN. */
3147 dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM; 3147 dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_VLAN_CHALLENGED;
3148 3148
3149#if defined(CONFIG_SBUS) && defined(CONFIG_PCI) 3149#if defined(CONFIG_SBUS) && defined(CONFIG_PCI)
3150 /* Hook up PCI register/dma accessors. */ 3150 /* Hook up PCI register/dma accessors. */
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 09440d783e65..cad519910767 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -7365,10 +7365,6 @@ static int tg3_open(struct net_device *dev)
7365 } else if (pci_enable_msi(tp->pdev) == 0) { 7365 } else if (pci_enable_msi(tp->pdev) == 0) {
7366 u32 msi_mode; 7366 u32 msi_mode;
7367 7367
7368 /* Hardware bug - MSI won't work if INTX disabled. */
7369 if (tp->tg3_flags2 & TG3_FLG2_5780_CLASS)
7370 pci_intx(tp->pdev, 1);
7371
7372 msi_mode = tr32(MSGINT_MODE); 7368 msi_mode = tr32(MSGINT_MODE);
7373 tw32(MSGINT_MODE, msi_mode | MSGINT_MODE_ENABLE); 7369 tw32(MSGINT_MODE, msi_mode | MSGINT_MODE_ENABLE);
7374 tp->tg3_flags2 |= TG3_FLG2_USING_MSI; 7370 tp->tg3_flags2 |= TG3_FLG2_USING_MSI;
@@ -12681,11 +12677,6 @@ static int tg3_resume(struct pci_dev *pdev)
12681 if (err) 12677 if (err)
12682 return err; 12678 return err;
12683 12679
12684 /* Hardware bug - MSI won't work if INTX disabled. */
12685 if ((tp->tg3_flags2 & TG3_FLG2_5780_CLASS) &&
12686 (tp->tg3_flags2 & TG3_FLG2_USING_MSI))
12687 pci_intx(tp->pdev, 1);
12688
12689 netif_device_attach(dev); 12680 netif_device_attach(dev);
12690 12681
12691 tg3_full_lock(tp, 0); 12682 tg3_full_lock(tp, 0);
diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig
index 7a1d6d512837..e1ca42591ac4 100644
--- a/drivers/pci/Kconfig
+++ b/drivers/pci/Kconfig
@@ -21,6 +21,17 @@ config PCI_MSI
21 21
22 If you don't know what to do here, say N. 22 If you don't know what to do here, say N.
23 23
24config PCI_LEGACY
25 bool "Enable deprecated pci_find_* API"
26 depends on PCI
27 default y
28 help
29 Say Y here if you want to include support for the deprecated
30 pci_find_slot() and pci_find_device() APIs. Most drivers have
31 been converted over to using the proper hotplug APIs, so this
32 option serves to include/exclude only a few drivers that are
33 still using this API.
34
24config PCI_DEBUG 35config PCI_DEBUG
25 bool "PCI Debugging" 36 bool "PCI Debugging"
26 depends on PCI && DEBUG_KERNEL 37 depends on PCI && DEBUG_KERNEL
diff --git a/drivers/pci/hotplug/Kconfig b/drivers/pci/hotplug/Kconfig
index 63d62752fb91..a64449d489d6 100644
--- a/drivers/pci/hotplug/Kconfig
+++ b/drivers/pci/hotplug/Kconfig
@@ -41,7 +41,7 @@ config HOTPLUG_PCI_FAKE
41 41
42config HOTPLUG_PCI_COMPAQ 42config HOTPLUG_PCI_COMPAQ
43 tristate "Compaq PCI Hotplug driver" 43 tristate "Compaq PCI Hotplug driver"
44 depends on X86 && PCI_BIOS 44 depends on X86 && PCI_BIOS && PCI_LEGACY
45 help 45 help
46 Say Y here if you have a motherboard with a Compaq PCI Hotplug 46 Say Y here if you have a motherboard with a Compaq PCI Hotplug
47 controller. 47 controller.
@@ -63,7 +63,7 @@ config HOTPLUG_PCI_COMPAQ_NVRAM
63 63
64config HOTPLUG_PCI_IBM 64config HOTPLUG_PCI_IBM
65 tristate "IBM PCI Hotplug driver" 65 tristate "IBM PCI Hotplug driver"
66 depends on X86_IO_APIC && X86 && PCI_BIOS 66 depends on X86_IO_APIC && X86 && PCI_BIOS && PCI_LEGACY
67 help 67 help
68 Say Y here if you have a motherboard with a IBM PCI Hotplug 68 Say Y here if you have a motherboard with a IBM PCI Hotplug
69 controller. 69 controller.
@@ -119,7 +119,7 @@ config HOTPLUG_PCI_CPCI_ZT5550
119 119
120config HOTPLUG_PCI_CPCI_GENERIC 120config HOTPLUG_PCI_CPCI_GENERIC
121 tristate "Generic port I/O CompactPCI Hotplug driver" 121 tristate "Generic port I/O CompactPCI Hotplug driver"
122 depends on HOTPLUG_PCI_CPCI && X86 122 depends on HOTPLUG_PCI_CPCI && X86 && PCI_LEGACY
123 help 123 help
124 Say Y here if you have a CompactPCI system card that exposes the #ENUM 124 Say Y here if you have a CompactPCI system card that exposes the #ENUM
125 hotswap signal as a bit in a system register that can be read through 125 hotswap signal as a bit in a system register that can be read through
diff --git a/drivers/pci/hotplug/cpqphp_ctrl.c b/drivers/pci/hotplug/cpqphp_ctrl.c
index 3ef0a4875a62..856d57b4d604 100644
--- a/drivers/pci/hotplug/cpqphp_ctrl.c
+++ b/drivers/pci/hotplug/cpqphp_ctrl.c
@@ -1931,16 +1931,14 @@ void cpqhp_pushbutton_thread(unsigned long slot)
1931 return ; 1931 return ;
1932 } 1932 }
1933 1933
1934 if (func != NULL && ctrl != NULL) { 1934 if (cpqhp_process_SS(ctrl, func) != 0) {
1935 if (cpqhp_process_SS(ctrl, func) != 0) { 1935 amber_LED_on(ctrl, hp_slot);
1936 amber_LED_on (ctrl, hp_slot); 1936 green_LED_on(ctrl, hp_slot);
1937 green_LED_on (ctrl, hp_slot);
1938
1939 set_SOGO(ctrl);
1940 1937
1941 /* Wait for SOBS to be unset */ 1938 set_SOGO(ctrl);
1942 wait_for_ctrl_irq (ctrl); 1939
1943 } 1940 /* Wait for SOBS to be unset */
1941 wait_for_ctrl_irq(ctrl);
1944 } 1942 }
1945 1943
1946 p_slot->state = STATIC_STATE; 1944 p_slot->state = STATIC_STATE;
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 87e01615053d..07c9f09c856d 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -224,6 +224,12 @@ static struct msi_desc* alloc_msi_entry(void)
224 return entry; 224 return entry;
225} 225}
226 226
227static void pci_intx_for_msi(struct pci_dev *dev, int enable)
228{
229 if (!(dev->dev_flags & PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG))
230 pci_intx(dev, enable);
231}
232
227#ifdef CONFIG_PM 233#ifdef CONFIG_PM
228static void __pci_restore_msi_state(struct pci_dev *dev) 234static void __pci_restore_msi_state(struct pci_dev *dev)
229{ 235{
@@ -237,7 +243,7 @@ static void __pci_restore_msi_state(struct pci_dev *dev)
237 entry = get_irq_msi(dev->irq); 243 entry = get_irq_msi(dev->irq);
238 pos = entry->msi_attrib.pos; 244 pos = entry->msi_attrib.pos;
239 245
240 pci_intx(dev, 0); /* disable intx */ 246 pci_intx_for_msi(dev, 0);
241 msi_set_enable(dev, 0); 247 msi_set_enable(dev, 0);
242 write_msi_msg(dev->irq, &entry->msg); 248 write_msi_msg(dev->irq, &entry->msg);
243 if (entry->msi_attrib.maskbit) 249 if (entry->msi_attrib.maskbit)
@@ -260,7 +266,7 @@ static void __pci_restore_msix_state(struct pci_dev *dev)
260 return; 266 return;
261 267
262 /* route the table */ 268 /* route the table */
263 pci_intx(dev, 0); /* disable intx */ 269 pci_intx_for_msi(dev, 0);
264 msix_set_enable(dev, 0); 270 msix_set_enable(dev, 0);
265 271
266 list_for_each_entry(entry, &dev->msi_list, list) { 272 list_for_each_entry(entry, &dev->msi_list, list) {
@@ -343,7 +349,7 @@ static int msi_capability_init(struct pci_dev *dev)
343 } 349 }
344 350
345 /* Set MSI enabled bits */ 351 /* Set MSI enabled bits */
346 pci_intx(dev, 0); /* disable intx */ 352 pci_intx_for_msi(dev, 0);
347 msi_set_enable(dev, 1); 353 msi_set_enable(dev, 1);
348 dev->msi_enabled = 1; 354 dev->msi_enabled = 1;
349 355
@@ -433,7 +439,7 @@ static int msix_capability_init(struct pci_dev *dev,
433 i++; 439 i++;
434 } 440 }
435 /* Set MSI-X enabled bits */ 441 /* Set MSI-X enabled bits */
436 pci_intx(dev, 0); /* disable intx */ 442 pci_intx_for_msi(dev, 0);
437 msix_set_enable(dev, 1); 443 msix_set_enable(dev, 1);
438 dev->msix_enabled = 1; 444 dev->msix_enabled = 1;
439 445
@@ -528,7 +534,7 @@ void pci_disable_msi(struct pci_dev* dev)
528 return; 534 return;
529 535
530 msi_set_enable(dev, 0); 536 msi_set_enable(dev, 0);
531 pci_intx(dev, 1); /* enable intx */ 537 pci_intx_for_msi(dev, 1);
532 dev->msi_enabled = 0; 538 dev->msi_enabled = 0;
533 539
534 BUG_ON(list_empty(&dev->msi_list)); 540 BUG_ON(list_empty(&dev->msi_list));
@@ -640,7 +646,7 @@ void pci_disable_msix(struct pci_dev* dev)
640 return; 646 return;
641 647
642 msix_set_enable(dev, 0); 648 msix_set_enable(dev, 0);
643 pci_intx(dev, 1); /* enable intx */ 649 pci_intx_for_msi(dev, 1);
644 dev->msix_enabled = 0; 650 dev->msix_enabled = 0;
645 651
646 msix_free_all_irqs(dev); 652 msix_free_all_irqs(dev);
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index 6e2760b6c20a..6d1a21611818 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -143,8 +143,8 @@ const struct pci_device_id *pci_match_id(const struct pci_device_id *ids,
143 * system is in its list of supported devices. Returns the matching 143 * system is in its list of supported devices. Returns the matching
144 * pci_device_id structure or %NULL if there is no match. 144 * pci_device_id structure or %NULL if there is no match.
145 */ 145 */
146const struct pci_device_id *pci_match_device(struct pci_driver *drv, 146static const struct pci_device_id *pci_match_device(struct pci_driver *drv,
147 struct pci_dev *dev) 147 struct pci_dev *dev)
148{ 148{
149 struct pci_dynid *dynid; 149 struct pci_dynid *dynid;
150 150
@@ -559,7 +559,6 @@ static int __init pci_driver_init(void)
559postcore_initcall(pci_driver_init); 559postcore_initcall(pci_driver_init);
560 560
561EXPORT_SYMBOL(pci_match_id); 561EXPORT_SYMBOL(pci_match_id);
562EXPORT_SYMBOL(pci_match_device);
563EXPORT_SYMBOL(__pci_register_driver); 562EXPORT_SYMBOL(__pci_register_driver);
564EXPORT_SYMBOL(pci_unregister_driver); 563EXPORT_SYMBOL(pci_unregister_driver);
565EXPORT_SYMBOL(pci_dev_driver); 564EXPORT_SYMBOL(pci_dev_driver);
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index d0bb5b9d2120..26cc4dcf4f0e 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -1621,12 +1621,8 @@ static void __init quirk_disable_all_msi(struct pci_dev *dev)
1621 printk(KERN_WARNING "PCI: MSI quirk detected. MSI deactivated.\n"); 1621 printk(KERN_WARNING "PCI: MSI quirk detected. MSI deactivated.\n");
1622} 1622}
1623DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_GCNB_LE, quirk_disable_all_msi); 1623DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_GCNB_LE, quirk_disable_all_msi);
1624DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_HT1000_PCIX, quirk_disable_all_msi);
1625DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS400_200, quirk_disable_all_msi); 1624DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS400_200, quirk_disable_all_msi);
1626DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS480, quirk_disable_all_msi); 1625DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS480, quirk_disable_all_msi);
1627DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RD580, quirk_disable_all_msi);
1628DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RX790, quirk_disable_all_msi);
1629DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS690, quirk_disable_all_msi);
1630DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VT3351, quirk_disable_all_msi); 1626DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VT3351, quirk_disable_all_msi);
1631 1627
1632/* Disable MSI on chipsets that are known to not support it */ 1628/* Disable MSI on chipsets that are known to not support it */
@@ -1678,6 +1674,9 @@ static void __devinit quirk_msi_ht_cap(struct pci_dev *dev)
1678} 1674}
1679DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_HT2000_PCIE, 1675DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_HT2000_PCIE,
1680 quirk_msi_ht_cap); 1676 quirk_msi_ht_cap);
1677DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS,
1678 PCI_DEVICE_ID_SERVERWORKS_HT1000_PXB,
1679 quirk_msi_ht_cap);
1681 1680
1682/* The nVidia CK804 chipset may have 2 HT MSI mappings. 1681/* The nVidia CK804 chipset may have 2 HT MSI mappings.
1683 * MSI are supported if the MSI capability set in any of these mappings. 1682 * MSI are supported if the MSI capability set in any of these mappings.
@@ -1705,4 +1704,48 @@ static void __devinit quirk_nvidia_ck804_msi_ht_cap(struct pci_dev *dev)
1705} 1704}
1706DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_CK804_PCIE, 1705DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_CK804_PCIE,
1707 quirk_nvidia_ck804_msi_ht_cap); 1706 quirk_nvidia_ck804_msi_ht_cap);
1707
1708static void __devinit quirk_msi_intx_disable_bug(struct pci_dev *dev)
1709{
1710 dev->dev_flags |= PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG;
1711}
1712DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM,
1713 PCI_DEVICE_ID_TIGON3_5780,
1714 quirk_msi_intx_disable_bug);
1715DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM,
1716 PCI_DEVICE_ID_TIGON3_5780S,
1717 quirk_msi_intx_disable_bug);
1718DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM,
1719 PCI_DEVICE_ID_TIGON3_5714,
1720 quirk_msi_intx_disable_bug);
1721DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM,
1722 PCI_DEVICE_ID_TIGON3_5714S,
1723 quirk_msi_intx_disable_bug);
1724DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM,
1725 PCI_DEVICE_ID_TIGON3_5715,
1726 quirk_msi_intx_disable_bug);
1727DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM,
1728 PCI_DEVICE_ID_TIGON3_5715S,
1729 quirk_msi_intx_disable_bug);
1730
1731DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4390,
1732 quirk_msi_intx_disable_bug);
1733DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4391,
1734 quirk_msi_intx_disable_bug);
1735DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4392,
1736 quirk_msi_intx_disable_bug);
1737DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4393,
1738 quirk_msi_intx_disable_bug);
1739DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4394,
1740 quirk_msi_intx_disable_bug);
1741DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4395,
1742 quirk_msi_intx_disable_bug);
1743
1744DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4373,
1745 quirk_msi_intx_disable_bug);
1746DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4374,
1747 quirk_msi_intx_disable_bug);
1748DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4375,
1749 quirk_msi_intx_disable_bug);
1750
1708#endif /* CONFIG_PCI_MSI */ 1751#endif /* CONFIG_PCI_MSI */
diff --git a/drivers/pci/search.c b/drivers/pci/search.c
index b001b5922e33..8541034021f0 100644
--- a/drivers/pci/search.c
+++ b/drivers/pci/search.c
@@ -113,6 +113,8 @@ pci_find_next_bus(const struct pci_bus *from)
113 return b; 113 return b;
114} 114}
115 115
116#ifdef CONFIG_PCI_LEGACY
117
116/** 118/**
117 * pci_find_slot - locate PCI device from a given PCI slot 119 * pci_find_slot - locate PCI device from a given PCI slot
118 * @bus: number of PCI bus on which desired PCI device resides 120 * @bus: number of PCI bus on which desired PCI device resides
@@ -137,6 +139,8 @@ pci_find_slot(unsigned int bus, unsigned int devfn)
137 return NULL; 139 return NULL;
138} 140}
139 141
142#endif /* CONFIG_PCI_LEGACY */
143
140/** 144/**
141 * pci_get_slot - locate PCI device for a given PCI slot 145 * pci_get_slot - locate PCI device for a given PCI slot
142 * @bus: PCI bus on which desired PCI device resides 146 * @bus: PCI bus on which desired PCI device resides
@@ -200,6 +204,7 @@ struct pci_dev * pci_get_bus_and_slot(unsigned int bus, unsigned int devfn)
200 return NULL; 204 return NULL;
201} 205}
202 206
207#ifdef CONFIG_PCI_LEGACY
203/** 208/**
204 * pci_find_subsys - begin or continue searching for a PCI device by vendor/subvendor/device/subdevice id 209 * pci_find_subsys - begin or continue searching for a PCI device by vendor/subvendor/device/subdevice id
205 * @vendor: PCI vendor id to match, or %PCI_ANY_ID to match all vendor ids 210 * @vendor: PCI vendor id to match, or %PCI_ANY_ID to match all vendor ids
@@ -278,6 +283,7 @@ pci_find_device(unsigned int vendor, unsigned int device, const struct pci_dev *
278{ 283{
279 return pci_find_subsys(vendor, device, PCI_ANY_ID, PCI_ANY_ID, from); 284 return pci_find_subsys(vendor, device, PCI_ANY_ID, PCI_ANY_ID, from);
280} 285}
286#endif /* CONFIG_PCI_LEGACY */
281 287
282/** 288/**
283 * pci_get_subsys - begin or continue searching for a PCI device by vendor/subvendor/device/subdevice id 289 * pci_get_subsys - begin or continue searching for a PCI device by vendor/subvendor/device/subdevice id
@@ -468,8 +474,11 @@ int pci_dev_present(const struct pci_device_id *ids)
468EXPORT_SYMBOL(pci_dev_present); 474EXPORT_SYMBOL(pci_dev_present);
469EXPORT_SYMBOL(pci_find_present); 475EXPORT_SYMBOL(pci_find_present);
470 476
477#ifdef CONFIG_PCI_LEGACY
471EXPORT_SYMBOL(pci_find_device); 478EXPORT_SYMBOL(pci_find_device);
472EXPORT_SYMBOL(pci_find_slot); 479EXPORT_SYMBOL(pci_find_slot);
480#endif /* CONFIG_PCI_LEGACY */
481
473/* For boot time work */ 482/* For boot time work */
474EXPORT_SYMBOL(pci_find_bus); 483EXPORT_SYMBOL(pci_find_bus);
475EXPORT_SYMBOL(pci_find_next_bus); 484EXPORT_SYMBOL(pci_find_next_bus);
diff --git a/drivers/rtc/rtc-m48t59.c b/drivers/rtc/rtc-m48t59.c
index bf60d35f580b..2bad1637330a 100644
--- a/drivers/rtc/rtc-m48t59.c
+++ b/drivers/rtc/rtc-m48t59.c
@@ -464,7 +464,7 @@ static int __devexit m48t59_rtc_remove(struct platform_device *pdev)
464 return 0; 464 return 0;
465} 465}
466 466
467static struct platform_driver m48t59_rtc_platdrv = { 467static struct platform_driver m48t59_rtc_driver = {
468 .driver = { 468 .driver = {
469 .name = "rtc-m48t59", 469 .name = "rtc-m48t59",
470 .owner = THIS_MODULE, 470 .owner = THIS_MODULE,
@@ -475,12 +475,12 @@ static struct platform_driver m48t59_rtc_platdrv = {
475 475
476static int __init m48t59_rtc_init(void) 476static int __init m48t59_rtc_init(void)
477{ 477{
478 return platform_driver_register(&m48t59_rtc_platdrv); 478 return platform_driver_register(&m48t59_rtc_driver);
479} 479}
480 480
481static void __exit m48t59_rtc_exit(void) 481static void __exit m48t59_rtc_exit(void)
482{ 482{
483 platform_driver_unregister(&m48t59_rtc_platdrv); 483 platform_driver_unregister(&m48t59_rtc_driver);
484} 484}
485 485
486module_init(m48t59_rtc_init); 486module_init(m48t59_rtc_init);
diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c
index 859f870552e3..5e083d1f57e7 100644
--- a/drivers/s390/block/dcssblk.c
+++ b/drivers/s390/block/dcssblk.c
@@ -193,6 +193,12 @@ dcssblk_segment_warn(int rc, char* seg_name)
193 } 193 }
194} 194}
195 195
196static void dcssblk_unregister_callback(struct device *dev)
197{
198 device_unregister(dev);
199 put_device(dev);
200}
201
196/* 202/*
197 * device attribute for switching shared/nonshared (exclusive) 203 * device attribute for switching shared/nonshared (exclusive)
198 * operation (show + store) 204 * operation (show + store)
@@ -276,8 +282,7 @@ removeseg:
276 blk_cleanup_queue(dev_info->dcssblk_queue); 282 blk_cleanup_queue(dev_info->dcssblk_queue);
277 dev_info->gd->queue = NULL; 283 dev_info->gd->queue = NULL;
278 put_disk(dev_info->gd); 284 put_disk(dev_info->gd);
279 device_unregister(dev); 285 rc = device_schedule_callback(dev, dcssblk_unregister_callback);
280 put_device(dev);
281out: 286out:
282 up_write(&dcssblk_devices_sem); 287 up_write(&dcssblk_devices_sem);
283 return rc; 288 return rc;
diff --git a/drivers/s390/cio/cmf.c b/drivers/s390/cio/cmf.c
index 725b0dd14269..f4c132ab39ed 100644
--- a/drivers/s390/cio/cmf.c
+++ b/drivers/s390/cio/cmf.c
@@ -343,10 +343,10 @@ static int cmf_copy_block(struct ccw_device *cdev)
343 343
344 if (sch->schib.scsw.fctl & SCSW_FCTL_START_FUNC) { 344 if (sch->schib.scsw.fctl & SCSW_FCTL_START_FUNC) {
345 /* Don't copy if a start function is in progress. */ 345 /* Don't copy if a start function is in progress. */
346 if ((!sch->schib.scsw.actl & SCSW_ACTL_SUSPENDED) && 346 if ((!(sch->schib.scsw.actl & SCSW_ACTL_SUSPENDED)) &&
347 (sch->schib.scsw.actl & 347 (sch->schib.scsw.actl &
348 (SCSW_ACTL_DEVACT | SCSW_ACTL_SCHACT)) && 348 (SCSW_ACTL_DEVACT | SCSW_ACTL_SCHACT)) &&
349 (!sch->schib.scsw.stctl & SCSW_STCTL_SEC_STATUS)) 349 (!(sch->schib.scsw.stctl & SCSW_STCTL_SEC_STATUS)))
350 return -EBUSY; 350 return -EBUSY;
351 } 351 }
352 cmb_data = cdev->private->cmb; 352 cmb_data = cdev->private->cmb;
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c
index 7ee57f084a89..74f6b539974a 100644
--- a/drivers/s390/cio/device.c
+++ b/drivers/s390/cio/device.c
@@ -738,7 +738,7 @@ static int io_subchannel_initialize_dev(struct subchannel *sch,
738 atomic_set(&cdev->private->onoff, 0); 738 atomic_set(&cdev->private->onoff, 0);
739 cdev->dev.parent = &sch->dev; 739 cdev->dev.parent = &sch->dev;
740 cdev->dev.release = ccw_device_release; 740 cdev->dev.release = ccw_device_release;
741 INIT_LIST_HEAD(&cdev->private->kick_work.entry); 741 INIT_WORK(&cdev->private->kick_work, NULL);
742 cdev->dev.groups = ccwdev_attr_groups; 742 cdev->dev.groups = ccwdev_attr_groups;
743 /* Do first half of device_register. */ 743 /* Do first half of device_register. */
744 device_initialize(&cdev->dev); 744 device_initialize(&cdev->dev);
diff --git a/drivers/s390/net/smsgiucv.c b/drivers/s390/net/smsgiucv.c
index 3ccca5871fdf..47bb47b48581 100644
--- a/drivers/s390/net/smsgiucv.c
+++ b/drivers/s390/net/smsgiucv.c
@@ -148,6 +148,10 @@ static int __init smsg_init(void)
148{ 148{
149 int rc; 149 int rc;
150 150
151 if (!MACHINE_IS_VM) {
152 rc = -EPROTONOSUPPORT;
153 goto out;
154 }
151 rc = driver_register(&smsg_driver); 155 rc = driver_register(&smsg_driver);
152 if (rc != 0) 156 if (rc != 0)
153 goto out; 157 goto out;
diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
index 86cf10efb0c1..a6676be87843 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -725,7 +725,7 @@ config SCSI_FD_MCS
725 725
726config SCSI_GDTH 726config SCSI_GDTH
727 tristate "Intel/ICP (former GDT SCSI Disk Array) RAID Controller support" 727 tristate "Intel/ICP (former GDT SCSI Disk Array) RAID Controller support"
728 depends on (ISA || EISA || PCI) && SCSI && ISA_DMA_API 728 depends on (ISA || EISA || PCI) && SCSI && ISA_DMA_API && PCI_LEGACY
729 ---help--- 729 ---help---
730 Formerly called GDT SCSI Disk Array Controller Support. 730 Formerly called GDT SCSI Disk Array Controller Support.
731 731
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
index 22d91ee173c5..5f2396c03958 100644
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -556,7 +556,7 @@ static int ibmvscsi_send_srp_event(struct srp_event_struct *evt_struct,
556 unsigned long timeout) 556 unsigned long timeout)
557{ 557{
558 u64 *crq_as_u64 = (u64 *) &evt_struct->crq; 558 u64 *crq_as_u64 = (u64 *) &evt_struct->crq;
559 int request_status; 559 int request_status = 0;
560 int rc; 560 int rc;
561 561
562 /* If we have exhausted our request limit, just fail this request, 562 /* If we have exhausted our request limit, just fail this request,
@@ -574,6 +574,13 @@ static int ibmvscsi_send_srp_event(struct srp_event_struct *evt_struct,
574 if (request_status < -1) 574 if (request_status < -1)
575 goto send_error; 575 goto send_error;
576 /* Otherwise, we may have run out of requests. */ 576 /* Otherwise, we may have run out of requests. */
577 /* If request limit was 0 when we started the adapter is in the
578 * process of performing a login with the server adapter, or
579 * we may have run out of requests.
580 */
581 else if (request_status == -1 &&
582 evt_struct->iu.srp.login_req.opcode != SRP_LOGIN_REQ)
583 goto send_busy;
577 /* Abort and reset calls should make it through. 584 /* Abort and reset calls should make it through.
578 * Nothing except abort and reset should use the last two 585 * Nothing except abort and reset should use the last two
579 * slots unless we had two or less to begin with. 586 * slots unless we had two or less to begin with.
@@ -633,7 +640,8 @@ static int ibmvscsi_send_srp_event(struct srp_event_struct *evt_struct,
633 unmap_cmd_data(&evt_struct->iu.srp.cmd, evt_struct, hostdata->dev); 640 unmap_cmd_data(&evt_struct->iu.srp.cmd, evt_struct, hostdata->dev);
634 641
635 free_event_struct(&hostdata->pool, evt_struct); 642 free_event_struct(&hostdata->pool, evt_struct);
636 atomic_inc(&hostdata->request_limit); 643 if (request_status != -1)
644 atomic_inc(&hostdata->request_limit);
637 return SCSI_MLQUEUE_HOST_BUSY; 645 return SCSI_MLQUEUE_HOST_BUSY;
638 646
639 send_error: 647 send_error:
@@ -927,10 +935,11 @@ static int send_srp_login(struct ibmvscsi_host_data *hostdata)
927 login->req_buf_fmt = SRP_BUF_FORMAT_DIRECT | SRP_BUF_FORMAT_INDIRECT; 935 login->req_buf_fmt = SRP_BUF_FORMAT_DIRECT | SRP_BUF_FORMAT_INDIRECT;
928 936
929 spin_lock_irqsave(hostdata->host->host_lock, flags); 937 spin_lock_irqsave(hostdata->host->host_lock, flags);
930 /* Start out with a request limit of 1, since this is negotiated in 938 /* Start out with a request limit of 0, since this is negotiated in
931 * the login request we are just sending 939 * the login request we are just sending and login requests always
940 * get sent by the driver regardless of request_limit.
932 */ 941 */
933 atomic_set(&hostdata->request_limit, 1); 942 atomic_set(&hostdata->request_limit, 0);
934 943
935 rc = ibmvscsi_send_srp_event(evt_struct, hostdata, init_timeout * 2); 944 rc = ibmvscsi_send_srp_event(evt_struct, hostdata, init_timeout * 2);
936 spin_unlock_irqrestore(hostdata->host->host_lock, flags); 945 spin_unlock_irqrestore(hostdata->host->host_lock, flags);
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index c0755565fae9..4e46045dea6d 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -682,6 +682,7 @@ lpfc_scsi_prep_cmnd(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd,
682 IOCB_t *iocb_cmd = &lpfc_cmd->cur_iocbq.iocb; 682 IOCB_t *iocb_cmd = &lpfc_cmd->cur_iocbq.iocb;
683 struct lpfc_iocbq *piocbq = &(lpfc_cmd->cur_iocbq); 683 struct lpfc_iocbq *piocbq = &(lpfc_cmd->cur_iocbq);
684 int datadir = scsi_cmnd->sc_data_direction; 684 int datadir = scsi_cmnd->sc_data_direction;
685 char tag[2];
685 686
686 lpfc_cmd->fcp_rsp->rspSnsLen = 0; 687 lpfc_cmd->fcp_rsp->rspSnsLen = 0;
687 /* clear task management bits */ 688 /* clear task management bits */
@@ -692,8 +693,8 @@ lpfc_scsi_prep_cmnd(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd,
692 693
693 memcpy(&fcp_cmnd->fcpCdb[0], scsi_cmnd->cmnd, 16); 694 memcpy(&fcp_cmnd->fcpCdb[0], scsi_cmnd->cmnd, 16);
694 695
695 if (scsi_cmnd->device->tagged_supported) { 696 if (scsi_populate_tag_msg(scsi_cmnd, tag)) {
696 switch (scsi_cmnd->tag) { 697 switch (tag[0]) {
697 case HEAD_OF_QUEUE_TAG: 698 case HEAD_OF_QUEUE_TAG:
698 fcp_cmnd->fcpCntl1 = HEAD_OF_Q; 699 fcp_cmnd->fcpCntl1 = HEAD_OF_Q;
699 break; 700 break;
diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c
index 4652ad22516b..abef7048f25b 100644
--- a/drivers/scsi/osst.c
+++ b/drivers/scsi/osst.c
@@ -593,10 +593,11 @@ static int osst_verify_frame(struct osst_tape * STp, int frame_seq_number, int q
593 if (aux->frame_type != OS_FRAME_TYPE_DATA && 593 if (aux->frame_type != OS_FRAME_TYPE_DATA &&
594 aux->frame_type != OS_FRAME_TYPE_EOD && 594 aux->frame_type != OS_FRAME_TYPE_EOD &&
595 aux->frame_type != OS_FRAME_TYPE_MARKER) { 595 aux->frame_type != OS_FRAME_TYPE_MARKER) {
596 if (!quiet) 596 if (!quiet) {
597#if DEBUG 597#if DEBUG
598 printk(OSST_DEB_MSG "%s:D: Skipping frame, frame type %x\n", name, aux->frame_type); 598 printk(OSST_DEB_MSG "%s:D: Skipping frame, frame type %x\n", name, aux->frame_type);
599#endif 599#endif
600 }
600 goto err_out; 601 goto err_out;
601 } 602 }
602 if (aux->frame_type == OS_FRAME_TYPE_EOD && 603 if (aux->frame_type == OS_FRAME_TYPE_EOD &&
@@ -606,11 +607,12 @@ static int osst_verify_frame(struct osst_tape * STp, int frame_seq_number, int q
606 goto err_out; 607 goto err_out;
607 } 608 }
608 if (frame_seq_number != -1 && ntohl(aux->frame_seq_num) != frame_seq_number) { 609 if (frame_seq_number != -1 && ntohl(aux->frame_seq_num) != frame_seq_number) {
609 if (!quiet) 610 if (!quiet) {
610#if DEBUG 611#if DEBUG
611 printk(OSST_DEB_MSG "%s:D: Skipping frame, sequence number %u (expected %d)\n", 612 printk(OSST_DEB_MSG "%s:D: Skipping frame, sequence number %u (expected %d)\n",
612 name, ntohl(aux->frame_seq_num), frame_seq_number); 613 name, ntohl(aux->frame_seq_num), frame_seq_number);
613#endif 614#endif
615 }
614 goto err_out; 616 goto err_out;
615 } 617 }
616 if (aux->frame_type == OS_FRAME_TYPE_MARKER) { 618 if (aux->frame_type == OS_FRAME_TYPE_MARKER) {
diff --git a/drivers/serial/8250_early.c b/drivers/serial/8250_early.c
index 4d4c9f01be8d..1f16de719962 100644
--- a/drivers/serial/8250_early.c
+++ b/drivers/serial/8250_early.c
@@ -76,7 +76,7 @@ static void __init wait_for_xmitr(struct uart_port *port)
76 } 76 }
77} 77}
78 78
79static void __init putc(struct uart_port *port, int c) 79static void __init serial_putc(struct uart_port *port, int c)
80{ 80{
81 wait_for_xmitr(port); 81 wait_for_xmitr(port);
82 serial_out(port, UART_TX, c); 82 serial_out(port, UART_TX, c);
@@ -91,7 +91,7 @@ static void __init early_serial8250_write(struct console *console, const char *s
91 ier = serial_in(port, UART_IER); 91 ier = serial_in(port, UART_IER);
92 serial_out(port, UART_IER, 0); 92 serial_out(port, UART_IER, 0);
93 93
94 uart_console_write(port, s, count, putc); 94 uart_console_write(port, s, count, serial_putc);
95 95
96 /* Wait for transmitter to become empty and restore the IER */ 96 /* Wait for transmitter to become empty and restore the IER */
97 wait_for_xmitr(port); 97 wait_for_xmitr(port);
diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c
index 0e357562ce9e..ceb03c9e749f 100644
--- a/drivers/serial/8250_pci.c
+++ b/drivers/serial/8250_pci.c
@@ -1986,6 +1986,7 @@ static int pciserial_suspend_one(struct pci_dev *dev, pm_message_t state)
1986 1986
1987static int pciserial_resume_one(struct pci_dev *dev) 1987static int pciserial_resume_one(struct pci_dev *dev)
1988{ 1988{
1989 int err;
1989 struct serial_private *priv = pci_get_drvdata(dev); 1990 struct serial_private *priv = pci_get_drvdata(dev);
1990 1991
1991 pci_set_power_state(dev, PCI_D0); 1992 pci_set_power_state(dev, PCI_D0);
@@ -1995,7 +1996,9 @@ static int pciserial_resume_one(struct pci_dev *dev)
1995 /* 1996 /*
1996 * The device may have been disabled. Re-enable it. 1997 * The device may have been disabled. Re-enable it.
1997 */ 1998 */
1998 pci_enable_device(dev); 1999 err = pci_enable_device(dev);
2000 if (err)
2001 return err;
1999 2002
2000 pciserial_resume_ports(priv); 2003 pciserial_resume_ports(priv);
2001 } 2004 }
diff --git a/drivers/telephony/phonedev.c b/drivers/telephony/phonedev.c
index 4d8c2a5b3297..bcea8d9b718c 100644
--- a/drivers/telephony/phonedev.c
+++ b/drivers/telephony/phonedev.c
@@ -120,9 +120,8 @@ int phone_register_device(struct phone_device *p, int unit)
120void phone_unregister_device(struct phone_device *pfd) 120void phone_unregister_device(struct phone_device *pfd)
121{ 121{
122 mutex_lock(&phone_lock); 122 mutex_lock(&phone_lock);
123 if (phone_device[pfd->minor] != pfd) 123 if (likely(phone_device[pfd->minor] == pfd))
124 panic("phone: bad unregister"); 124 phone_device[pfd->minor] = NULL;
125 phone_device[pfd->minor] = NULL;
126 mutex_unlock(&phone_lock); 125 mutex_unlock(&phone_lock);
127} 126}
128 127
diff --git a/fs/afs/vlocation.c b/fs/afs/vlocation.c
index 7b4bbe48112d..849fc3160cb5 100644
--- a/fs/afs/vlocation.c
+++ b/fs/afs/vlocation.c
@@ -382,7 +382,7 @@ struct afs_vlocation *afs_vlocation_lookup(struct afs_cell *cell,
382 cell->name, key_serial(key), 382 cell->name, key_serial(key),
383 (int) namesz, (int) namesz, name, namesz); 383 (int) namesz, (int) namesz, name, namesz);
384 384
385 if (namesz > sizeof(vl->vldb.name)) { 385 if (namesz >= sizeof(vl->vldb.name)) {
386 _leave(" = -ENAMETOOLONG"); 386 _leave(" = -ENAMETOOLONG");
387 return ERR_PTR(-ENAMETOOLONG); 387 return ERR_PTR(-ENAMETOOLONG);
388 } 388 }
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c
index 9d70289f7df3..bbed2fd40fdc 100644
--- a/fs/ecryptfs/crypto.c
+++ b/fs/ecryptfs/crypto.c
@@ -115,11 +115,29 @@ static int ecryptfs_calculate_md5(char *dst,
115 } 115 }
116 crypt_stat->hash_tfm = desc.tfm; 116 crypt_stat->hash_tfm = desc.tfm;
117 } 117 }
118 crypto_hash_init(&desc); 118 rc = crypto_hash_init(&desc);
119 crypto_hash_update(&desc, &sg, len); 119 if (rc) {
120 crypto_hash_final(&desc, dst); 120 printk(KERN_ERR
121 mutex_unlock(&crypt_stat->cs_hash_tfm_mutex); 121 "%s: Error initializing crypto hash; rc = [%d]\n",
122 __FUNCTION__, rc);
123 goto out;
124 }
125 rc = crypto_hash_update(&desc, &sg, len);
126 if (rc) {
127 printk(KERN_ERR
128 "%s: Error updating crypto hash; rc = [%d]\n",
129 __FUNCTION__, rc);
130 goto out;
131 }
132 rc = crypto_hash_final(&desc, dst);
133 if (rc) {
134 printk(KERN_ERR
135 "%s: Error finalizing crypto hash; rc = [%d]\n",
136 __FUNCTION__, rc);
137 goto out;
138 }
122out: 139out:
140 mutex_unlock(&crypt_stat->cs_hash_tfm_mutex);
123 return rc; 141 return rc;
124} 142}
125 143
@@ -504,7 +522,6 @@ int ecryptfs_encrypt_page(struct page *page)
504 "\n", rc); 522 "\n", rc);
505 goto out; 523 goto out;
506 } 524 }
507 extent_offset++;
508 } 525 }
509out: 526out:
510 kfree(enc_extent_virt); 527 kfree(enc_extent_virt);
@@ -640,7 +657,6 @@ int ecryptfs_decrypt_page(struct page *page)
640 "rc = [%d]\n", __FUNCTION__, rc); 657 "rc = [%d]\n", __FUNCTION__, rc);
641 goto out; 658 goto out;
642 } 659 }
643 extent_offset++;
644 } 660 }
645out: 661out:
646 kfree(enc_extent_virt); 662 kfree(enc_extent_virt);
diff --git a/include/asm-arm26/irq_regs.h b/include/asm-arm26/irq_regs.h
deleted file mode 100644
index 3dd9c0b70270..000000000000
--- a/include/asm-arm26/irq_regs.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/irq_regs.h>
diff --git a/include/asm-m68knommu/unistd.h b/include/asm-m68knommu/unistd.h
index eb1b566793fe..27c2f9bb4dbd 100644
--- a/include/asm-m68knommu/unistd.h
+++ b/include/asm-m68knommu/unistd.h
@@ -185,8 +185,8 @@
185#define __NR_rt_sigtimedwait 177 185#define __NR_rt_sigtimedwait 177
186#define __NR_rt_sigqueueinfo 178 186#define __NR_rt_sigqueueinfo 178
187#define __NR_rt_sigsuspend 179 187#define __NR_rt_sigsuspend 179
188#define __NR_pread 180 188#define __NR_pread64 180
189#define __NR_pwrite 181 189#define __NR_pwrite64 181
190#define __NR_lchown 182 190#define __NR_lchown 182
191#define __NR_getcwd 183 191#define __NR_getcwd 183
192#define __NR_capget 184 192#define __NR_capget 184
diff --git a/include/asm-powerpc/commproc.h b/include/asm-powerpc/commproc.h
index 0307c84a5c1d..a2328b8addd8 100644
--- a/include/asm-powerpc/commproc.h
+++ b/include/asm-powerpc/commproc.h
@@ -91,7 +91,7 @@ extern uint m8xx_cpm_hostalloc(uint size);
91extern int m8xx_cpm_hostfree(uint start); 91extern int m8xx_cpm_hostfree(uint start);
92extern void m8xx_cpm_hostdump(void); 92extern void m8xx_cpm_hostdump(void);
93 93
94extern void cpm_load_patch(volatile immap_t *immr); 94extern void cpm_load_patch(cpm8xx_t *cp);
95 95
96/* Buffer descriptors used by many of the CPM protocols. 96/* Buffer descriptors used by many of the CPM protocols.
97*/ 97*/
diff --git a/include/asm-x86/lguest_hcall.h b/include/asm-x86/lguest_hcall.h
index 9c5092b6aa9f..2091779e91fb 100644
--- a/include/asm-x86/lguest_hcall.h
+++ b/include/asm-x86/lguest_hcall.h
@@ -54,9 +54,6 @@ hcall(unsigned long call,
54} 54}
55/*:*/ 55/*:*/
56 56
57void async_hcall(unsigned long call,
58 unsigned long arg1, unsigned long arg2, unsigned long arg3);
59
60/* Can't use our min() macro here: needs to be a constant */ 57/* Can't use our min() macro here: needs to be a constant */
61#define LGUEST_IRQS (NR_IRQS < 32 ? NR_IRQS: 32) 58#define LGUEST_IRQS (NR_IRQS < 32 ? NR_IRQS: 32)
62 59
diff --git a/include/linux/futex.h b/include/linux/futex.h
index 99650353adfa..92d420fe03f8 100644
--- a/include/linux/futex.h
+++ b/include/linux/futex.h
@@ -149,10 +149,6 @@ union futex_key {
149 int offset; 149 int offset;
150 } both; 150 } both;
151}; 151};
152int get_futex_key(u32 __user *uaddr, struct rw_semaphore *shared,
153 union futex_key *key);
154void get_futex_key_refs(union futex_key *key);
155void drop_futex_key_refs(union futex_key *key);
156 152
157#ifdef CONFIG_FUTEX 153#ifdef CONFIG_FUTEX
158extern void exit_robust_list(struct task_struct *curr); 154extern void exit_robust_list(struct task_struct *curr);
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 4ed4777bba67..dc75ccbcf991 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1031,14 +1031,7 @@ ide_startstop_t __ide_abort(ide_drive_t *, struct request *);
1031extern ide_startstop_t ide_abort(ide_drive_t *, const char *); 1031extern ide_startstop_t ide_abort(ide_drive_t *, const char *);
1032 1032
1033extern void ide_fix_driveid(struct hd_driveid *); 1033extern void ide_fix_driveid(struct hd_driveid *);
1034/* 1034
1035 * ide_fixstring() cleans up and (optionally) byte-swaps a text string,
1036 * removing leading/trailing blanks and compressing internal blanks.
1037 * It is primarily used to tidy up the model name/number fields as
1038 * returned by the WIN_[P]IDENTIFY commands.
1039 *
1040 * (s, bytecount, byteswap)
1041 */
1042extern void ide_fixstring(u8 *, const int, const int); 1035extern void ide_fixstring(u8 *, const int, const int);
1043 1036
1044int ide_wait_stat(ide_startstop_t *, ide_drive_t *, u8, u8, unsigned long); 1037int ide_wait_stat(ide_startstop_t *, ide_drive_t *, u8, u8, unsigned long);
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
index f73de6fb5c68..82de2fb62cb7 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -6,6 +6,7 @@
6#define _LINUX_KALLSYMS_H 6#define _LINUX_KALLSYMS_H
7 7
8#include <linux/errno.h> 8#include <linux/errno.h>
9#include <linux/stddef.h>
9 10
10#define KSYM_NAME_LEN 128 11#define KSYM_NAME_LEN 128
11#define KSYM_SYMBOL_LEN (sizeof("%s+%#lx/%#lx [%s]") + (KSYM_NAME_LEN - 1) + \ 12#define KSYM_SYMBOL_LEN (sizeof("%s+%#lx/%#lx [%s]") + (KSYM_NAME_LEN - 1) + \
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 5d2281f661f7..0dd93bb62fbe 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -109,6 +109,14 @@ enum pcie_reset_state {
109 pcie_hot_reset = (__force pcie_reset_state_t) 3 109 pcie_hot_reset = (__force pcie_reset_state_t) 3
110}; 110};
111 111
112typedef unsigned short __bitwise pci_dev_flags_t;
113enum pci_dev_flags {
114 /* INTX_DISABLE in PCI_COMMAND register disables MSI
115 * generation too.
116 */
117 PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG = (__force pci_dev_flags_t) 1,
118};
119
112typedef unsigned short __bitwise pci_bus_flags_t; 120typedef unsigned short __bitwise pci_bus_flags_t;
113enum pci_bus_flags { 121enum pci_bus_flags {
114 PCI_BUS_FLAGS_NO_MSI = (__force pci_bus_flags_t) 1, 122 PCI_BUS_FLAGS_NO_MSI = (__force pci_bus_flags_t) 1,
@@ -185,6 +193,7 @@ struct pci_dev {
185 unsigned int msix_enabled:1; 193 unsigned int msix_enabled:1;
186 unsigned int is_managed:1; 194 unsigned int is_managed:1;
187 unsigned int is_pcie:1; 195 unsigned int is_pcie:1;
196 pci_dev_flags_t dev_flags;
188 atomic_t enable_cnt; /* pci_enable_device has been called */ 197 atomic_t enable_cnt; /* pci_enable_device has been called */
189 198
190 u32 saved_config_space[16]; /* config space saved at suspend time */ 199 u32 saved_config_space[16]; /* config space saved at suspend time */
@@ -479,8 +488,11 @@ extern void pci_sort_breadthfirst(void);
479 488
480/* Generic PCI functions exported to card drivers */ 489/* Generic PCI functions exported to card drivers */
481 490
491#ifdef CONFIG_PCI_LEGACY
482struct pci_dev __deprecated *pci_find_device (unsigned int vendor, unsigned int device, const struct pci_dev *from); 492struct pci_dev __deprecated *pci_find_device (unsigned int vendor, unsigned int device, const struct pci_dev *from);
483struct pci_dev __deprecated *pci_find_slot (unsigned int bus, unsigned int devfn); 493struct pci_dev __deprecated *pci_find_slot (unsigned int bus, unsigned int devfn);
494#endif /* CONFIG_PCI_LEGACY */
495
484int pci_find_capability (struct pci_dev *dev, int cap); 496int pci_find_capability (struct pci_dev *dev, int cap);
485int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap); 497int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap);
486int pci_find_ext_capability (struct pci_dev *dev, int cap); 498int pci_find_ext_capability (struct pci_dev *dev, int cap);
@@ -622,7 +634,6 @@ static inline int __must_check pci_register_driver(struct pci_driver *driver)
622void pci_unregister_driver(struct pci_driver *); 634void pci_unregister_driver(struct pci_driver *);
623void pci_remove_behind_bridge(struct pci_dev *); 635void pci_remove_behind_bridge(struct pci_dev *);
624struct pci_driver *pci_dev_driver(const struct pci_dev *); 636struct pci_driver *pci_dev_driver(const struct pci_dev *);
625const struct pci_device_id *pci_match_device(struct pci_driver *drv, struct pci_dev *dev);
626const struct pci_device_id *pci_match_id(const struct pci_device_id *ids, struct pci_dev *dev); 637const struct pci_device_id *pci_match_id(const struct pci_device_id *ids, struct pci_dev *dev);
627int pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max, int pass); 638int pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max, int pass);
628 639
@@ -751,7 +762,6 @@ static inline void pci_unregister_driver(struct pci_driver *drv) { }
751static inline int pci_find_capability (struct pci_dev *dev, int cap) {return 0; } 762static inline int pci_find_capability (struct pci_dev *dev, int cap) {return 0; }
752static inline int pci_find_next_capability (struct pci_dev *dev, u8 post, int cap) { return 0; } 763static inline int pci_find_next_capability (struct pci_dev *dev, u8 post, int cap) { return 0; }
753static inline int pci_find_ext_capability (struct pci_dev *dev, int cap) {return 0; } 764static inline int pci_find_ext_capability (struct pci_dev *dev, int cap) {return 0; }
754static inline const struct pci_device_id *pci_match_device(const struct pci_device_id *ids, const struct pci_dev *dev) { return NULL; }
755 765
756/* Power management related routines */ 766/* Power management related routines */
757static inline int pci_save_state(struct pci_dev *dev) { return 0; } 767static inline int pci_save_state(struct pci_dev *dev) { return 0; }
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index e44aac8cf5ff..fbe19648bf91 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -360,9 +360,6 @@
360#define PCI_DEVICE_ID_ATI_RS400_166 0x5a32 360#define PCI_DEVICE_ID_ATI_RS400_166 0x5a32
361#define PCI_DEVICE_ID_ATI_RS400_200 0x5a33 361#define PCI_DEVICE_ID_ATI_RS400_200 0x5a33
362#define PCI_DEVICE_ID_ATI_RS480 0x5950 362#define PCI_DEVICE_ID_ATI_RS480 0x5950
363#define PCI_DEVICE_ID_ATI_RD580 0x5952
364#define PCI_DEVICE_ID_ATI_RX790 0x5957
365#define PCI_DEVICE_ID_ATI_RS690 0x7910
366/* ATI IXP Chipset */ 363/* ATI IXP Chipset */
367#define PCI_DEVICE_ID_ATI_IXP200_IDE 0x4349 364#define PCI_DEVICE_ID_ATI_IXP200_IDE 0x4349
368#define PCI_DEVICE_ID_ATI_IXP200_SMBUS 0x4353 365#define PCI_DEVICE_ID_ATI_IXP200_SMBUS 0x4353
@@ -1436,8 +1433,8 @@
1436#define PCI_DEVICE_ID_SERVERWORKS_HE 0x0008 1433#define PCI_DEVICE_ID_SERVERWORKS_HE 0x0008
1437#define PCI_DEVICE_ID_SERVERWORKS_LE 0x0009 1434#define PCI_DEVICE_ID_SERVERWORKS_LE 0x0009
1438#define PCI_DEVICE_ID_SERVERWORKS_GCNB_LE 0x0017 1435#define PCI_DEVICE_ID_SERVERWORKS_GCNB_LE 0x0017
1436#define PCI_DEVICE_ID_SERVERWORKS_HT1000_PXB 0x0036
1439#define PCI_DEVICE_ID_SERVERWORKS_EPB 0x0103 1437#define PCI_DEVICE_ID_SERVERWORKS_EPB 0x0103
1440#define PCI_DEVICE_ID_SERVERWORKS_HT1000_PCIX 0x0104
1441#define PCI_DEVICE_ID_SERVERWORKS_HT2000_PCIE 0x0132 1438#define PCI_DEVICE_ID_SERVERWORKS_HT2000_PCIE 0x0132
1442#define PCI_DEVICE_ID_SERVERWORKS_OSB4 0x0200 1439#define PCI_DEVICE_ID_SERVERWORKS_OSB4 0x0200
1443#define PCI_DEVICE_ID_SERVERWORKS_CSB5 0x0201 1440#define PCI_DEVICE_ID_SERVERWORKS_CSB5 0x0201
diff --git a/kernel/futex.c b/kernel/futex.c
index 32710451dc20..9dc591ab681a 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -181,8 +181,8 @@ static inline int match_futex(union futex_key *key1, union futex_key *key2)
181 * For other futexes, it points to &current->mm->mmap_sem and 181 * For other futexes, it points to &current->mm->mmap_sem and
182 * caller must have taken the reader lock. but NOT any spinlocks. 182 * caller must have taken the reader lock. but NOT any spinlocks.
183 */ 183 */
184int get_futex_key(u32 __user *uaddr, struct rw_semaphore *fshared, 184static int get_futex_key(u32 __user *uaddr, struct rw_semaphore *fshared,
185 union futex_key *key) 185 union futex_key *key)
186{ 186{
187 unsigned long address = (unsigned long)uaddr; 187 unsigned long address = (unsigned long)uaddr;
188 struct mm_struct *mm = current->mm; 188 struct mm_struct *mm = current->mm;
@@ -268,14 +268,13 @@ int get_futex_key(u32 __user *uaddr, struct rw_semaphore *fshared,
268 } 268 }
269 return err; 269 return err;
270} 270}
271EXPORT_SYMBOL_GPL(get_futex_key);
272 271
273/* 272/*
274 * Take a reference to the resource addressed by a key. 273 * Take a reference to the resource addressed by a key.
275 * Can be called while holding spinlocks. 274 * Can be called while holding spinlocks.
276 * 275 *
277 */ 276 */
278inline void get_futex_key_refs(union futex_key *key) 277static void get_futex_key_refs(union futex_key *key)
279{ 278{
280 if (key->both.ptr == 0) 279 if (key->both.ptr == 0)
281 return; 280 return;
@@ -288,13 +287,12 @@ inline void get_futex_key_refs(union futex_key *key)
288 break; 287 break;
289 } 288 }
290} 289}
291EXPORT_SYMBOL_GPL(get_futex_key_refs);
292 290
293/* 291/*
294 * Drop a reference to the resource addressed by a key. 292 * Drop a reference to the resource addressed by a key.
295 * The hash bucket spinlock must not be held. 293 * The hash bucket spinlock must not be held.
296 */ 294 */
297void drop_futex_key_refs(union futex_key *key) 295static void drop_futex_key_refs(union futex_key *key)
298{ 296{
299 if (!key->both.ptr) 297 if (!key->both.ptr)
300 return; 298 return;
@@ -307,7 +305,6 @@ void drop_futex_key_refs(union futex_key *key)
307 break; 305 break;
308 } 306 }
309} 307}
310EXPORT_SYMBOL_GPL(drop_futex_key_refs);
311 308
312static u32 cmpxchg_futex_value_locked(u32 __user *uaddr, u32 uval, u32 newval) 309static u32 cmpxchg_futex_value_locked(u32 __user *uaddr, u32 uval, u32 newval)
313{ 310{
diff --git a/kernel/sysctl_check.c b/kernel/sysctl_check.c
index ed6fe51df77a..5a2f2b2bf888 100644
--- a/kernel/sysctl_check.c
+++ b/kernel/sysctl_check.c
@@ -1432,6 +1432,7 @@ static void set_fail(const char **fail, struct ctl_table *table, const char *str
1432 printk(KERN_ERR "sysctl table check failed: "); 1432 printk(KERN_ERR "sysctl table check failed: ");
1433 sysctl_print_path(table); 1433 sysctl_print_path(table);
1434 printk(" %s\n", *fail); 1434 printk(" %s\n", *fail);
1435 dump_stack();
1435 } 1436 }
1436 *fail = str; 1437 *fail = str;
1437} 1438}
diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
index 8cfb8b2ce773..aa82d7bf478a 100644
--- a/kernel/time/tick-broadcast.c
+++ b/kernel/time/tick-broadcast.c
@@ -508,7 +508,7 @@ static void tick_broadcast_clear_oneshot(int cpu)
508} 508}
509 509
510/** 510/**
511 * tick_broadcast_setup_highres - setup the broadcast device for highres 511 * tick_broadcast_setup_oneshot - setup the broadcast device
512 */ 512 */
513void tick_broadcast_setup_oneshot(struct clock_event_device *bc) 513void tick_broadcast_setup_oneshot(struct clock_event_device *bc)
514{ 514{
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 5997456ebbc9..27a2338deb4a 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -321,7 +321,7 @@ ktime_t tick_nohz_get_sleep_length(void)
321} 321}
322 322
323/** 323/**
324 * nohz_restart_sched_tick - restart the idle tick from the idle task 324 * tick_nohz_restart_sched_tick - restart the idle tick from the idle task
325 * 325 *
326 * Restart the idle tick when the CPU is woken up from idle 326 * Restart the idle tick when the CPU is woken up from idle
327 */ 327 */
diff --git a/kernel/timer.c b/kernel/timer.c
index fb4e67d5dd60..00e44e2afd67 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -790,7 +790,7 @@ static unsigned long cmp_next_hrtimer_event(unsigned long now,
790} 790}
791 791
792/** 792/**
793 * next_timer_interrupt - return the jiffy of the next pending timer 793 * get_next_timer_interrupt - return the jiffy of the next pending timer
794 * @now: current time (in jiffies) 794 * @now: current time (in jiffies)
795 */ 795 */
796unsigned long get_next_timer_interrupt(unsigned long now) 796unsigned long get_next_timer_interrupt(unsigned long now)
diff --git a/lib/bitmap.c b/lib/bitmap.c
index 26ebafa8c41d..2c9242e3fed0 100644
--- a/lib/bitmap.c
+++ b/lib/bitmap.c
@@ -469,6 +469,10 @@ int bitmap_scnlistprintf(char *buf, unsigned int buflen,
469 /* current bit is 'cur', most recently seen range is [rbot, rtop] */ 469 /* current bit is 'cur', most recently seen range is [rbot, rtop] */
470 int cur, rbot, rtop; 470 int cur, rbot, rtop;
471 471
472 if (buflen == 0)
473 return 0;
474 buf[0] = 0;
475
472 rbot = cur = find_first_bit(maskp, nmaskbits); 476 rbot = cur = find_first_bit(maskp, nmaskbits);
473 while (cur < nmaskbits) { 477 while (cur < nmaskbits) {
474 rtop = cur; 478 rtop = cur;
diff --git a/mm/memory.c b/mm/memory.c
index eefd5b68bc42..9791e4786843 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2748,4 +2748,3 @@ int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, in
2748 2748
2749 return buf - old_buf; 2749 return buf - old_buf;
2750} 2750}
2751EXPORT_SYMBOL_GPL(access_process_vm);
diff --git a/mm/slub.c b/mm/slub.c
index bcdb2c8941a5..84f59fde1a10 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1511,26 +1511,8 @@ new_slab:
1511 1511
1512 if (new) { 1512 if (new) {
1513 c = get_cpu_slab(s, smp_processor_id()); 1513 c = get_cpu_slab(s, smp_processor_id());
1514 if (c->page) { 1514 if (c->page)
1515 /*
1516 * Someone else populated the cpu_slab while we
1517 * enabled interrupts, or we have gotten scheduled
1518 * on another cpu. The page may not be on the
1519 * requested node even if __GFP_THISNODE was
1520 * specified. So we need to recheck.
1521 */
1522 if (node_match(c, node)) {
1523 /*
1524 * Current cpuslab is acceptable and we
1525 * want the current one since its cache hot
1526 */
1527 discard_slab(s, new);
1528 slab_lock(c->page);
1529 goto load_freelist;
1530 }
1531 /* New slab does not fit our expectations */
1532 flush_slab(s, c); 1515 flush_slab(s, c);
1533 }
1534 slab_lock(new); 1516 slab_lock(new);
1535 SetSlabFrozen(new); 1517 SetSlabFrozen(new);
1536 c->page = new; 1518 c->page = new;