aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/slow-work.txt4
-rw-r--r--MAINTAINERS5
-rw-r--r--arch/alpha/include/asm/thread_info.h27
-rw-r--r--arch/alpha/kernel/core_marvel.c2
-rw-r--r--arch/alpha/kernel/core_titan.c2
-rw-r--r--arch/alpha/kernel/irq.c2
-rw-r--r--arch/alpha/kernel/irq_alpha.c2
-rw-r--r--arch/alpha/kernel/irq_i8259.c2
-rw-r--r--arch/alpha/kernel/irq_pyxis.c2
-rw-r--r--arch/alpha/kernel/irq_srm.c2
-rw-r--r--arch/alpha/kernel/sys_alcor.c2
-rw-r--r--arch/alpha/kernel/sys_cabriolet.c2
-rw-r--r--arch/alpha/kernel/sys_dp264.c4
-rw-r--r--arch/alpha/kernel/sys_eb64p.c2
-rw-r--r--arch/alpha/kernel/sys_eiger.c2
-rw-r--r--arch/alpha/kernel/sys_jensen.c2
-rw-r--r--arch/alpha/kernel/sys_marvel.c6
-rw-r--r--arch/alpha/kernel/sys_mikasa.c2
-rw-r--r--arch/alpha/kernel/sys_noritake.c2
-rw-r--r--arch/alpha/kernel/sys_rawhide.c2
-rw-r--r--arch/alpha/kernel/sys_ruffian.c2
-rw-r--r--arch/alpha/kernel/sys_rx164.c2
-rw-r--r--arch/alpha/kernel/sys_sable.c2
-rw-r--r--arch/alpha/kernel/sys_takara.c2
-rw-r--r--arch/alpha/kernel/sys_titan.c2
-rw-r--r--arch/alpha/kernel/sys_wildfire.c2
-rw-r--r--arch/mips/Kconfig21
-rw-r--r--arch/mips/include/asm/mman.h1
-rw-r--r--arch/mips/include/asm/system.h15
-rw-r--r--arch/mips/kernel/syscall.c4
-rw-r--r--arch/mips/rb532/devices.c3
-rw-r--r--drivers/block/aoe/aoecmd.c23
-rw-r--r--drivers/char/tty_port.c7
-rw-r--r--drivers/gpio/langwell_gpio.c11
-rw-r--r--drivers/input/serio/i8042-x86ia64io.h21
-rw-r--r--drivers/md/raid1.c7
-rw-r--r--drivers/media/dvb/dvb-core/dvb_frontend.c1
-rw-r--r--drivers/mmc/host/pxamci.c4
-rw-r--r--drivers/regulator/wm831x-isink.c2
-rw-r--r--drivers/rtc/rtc-pcf50633.c3
-rw-r--r--drivers/rtc/rtc-x1205.c6
-rw-r--r--drivers/serial/bcm63xx_uart.c4
-rw-r--r--drivers/serial/of_serial.c1
-rw-r--r--drivers/staging/hv/BlkVsc.c1
-rw-r--r--drivers/staging/hv/Channel.c16
-rw-r--r--drivers/staging/hv/ChannelMgmt.c2
-rw-r--r--drivers/staging/hv/NetVsc.c1
-rw-r--r--drivers/staging/hv/NetVsc.h1
-rw-r--r--drivers/staging/hv/StorVsc.c10
-rw-r--r--drivers/staging/hv/blkvsc_drv.c1
-rw-r--r--drivers/staging/hv/netvsc_drv.c1
-rw-r--r--drivers/staging/rtl8187se/TODO3
-rw-r--r--drivers/staging/rtl8192su/TODO3
-rw-r--r--drivers/staging/vt6655/TODO5
-rw-r--r--drivers/staging/vt6656/TODO5
-rw-r--r--drivers/usb/core/hub.c2
-rw-r--r--drivers/usb/gadget/amd5536udc.c49
-rw-r--r--drivers/usb/host/ehci-hcd.c2
-rw-r--r--drivers/usb/host/ehci-pci.c4
-rw-r--r--drivers/usb/host/ehci-q.c16
-rw-r--r--drivers/usb/host/ehci-sched.c12
-rw-r--r--drivers/usb/host/ehci.h2
-rw-r--r--drivers/usb/musb/cppi_dma.c10
-rw-r--r--drivers/usb/musb/musb_core.c4
-rw-r--r--drivers/usb/musb/musb_gadget.c79
-rw-r--r--drivers/usb/musb/musb_gadget_ep0.c3
-rw-r--r--drivers/usb/musb/musb_host.c5
-rw-r--r--drivers/usb/serial/ftdi_sio.c3
-rw-r--r--drivers/usb/serial/option.c5
-rw-r--r--drivers/video/da8xx-fb.c11
-rw-r--r--drivers/watchdog/rc32434_wdt.c4
-rw-r--r--fs/9p/cache.c2
-rw-r--r--fs/cachefiles/rdwr.c2
-rw-r--r--include/linux/slow-work.h8
-rw-r--r--init/Kconfig10
-rw-r--r--init/main.c11
-rw-r--r--kernel/Makefile2
-rw-r--r--kernel/module.c5
-rw-r--r--kernel/slow-work-debugfs.c (renamed from kernel/slow-work-proc.c)4
-rw-r--r--kernel/slow-work.c64
-rw-r--r--kernel/slow-work.h6
81 files changed, 359 insertions, 237 deletions
diff --git a/Documentation/slow-work.txt b/Documentation/slow-work.txt
index 52bc31433723..9dbf4470c7e1 100644
--- a/Documentation/slow-work.txt
+++ b/Documentation/slow-work.txt
@@ -279,9 +279,9 @@ The slow-work thread pool has a number of configurables:
279VIEWING EXECUTING AND QUEUED ITEMS 279VIEWING EXECUTING AND QUEUED ITEMS
280================================== 280==================================
281 281
282If CONFIG_SLOW_WORK_PROC is enabled, a proc file is made available: 282If CONFIG_SLOW_WORK_DEBUG is enabled, a debugfs file is made available:
283 283
284 /proc/slow_work_rq 284 /sys/kernel/debug/slow_work/runqueue
285 285
286through which the list of work items being executed and the queues of items to 286through which the list of work items being executed and the queues of items to
287be executed may be viewed. The owner of a work item is given the chance to 287be executed may be viewed. The owner of a work item is given the chance to
diff --git a/MAINTAINERS b/MAINTAINERS
index 16129e67678a..4f96ac81089c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3015,11 +3015,8 @@ S: Maintained
3015F: fs/autofs4/ 3015F: fs/autofs4/
3016 3016
3017KERNEL BUILD 3017KERNEL BUILD
3018M: Sam Ravnborg <sam@ravnborg.org>
3019T: git git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-next.git
3020T: git git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fixes.git
3021L: linux-kbuild@vger.kernel.org 3018L: linux-kbuild@vger.kernel.org
3022S: Maintained 3019S: Orphan
3023F: Documentation/kbuild/ 3020F: Documentation/kbuild/
3024F: Makefile 3021F: Makefile
3025F: scripts/Makefile.* 3022F: scripts/Makefile.*
diff --git a/arch/alpha/include/asm/thread_info.h b/arch/alpha/include/asm/thread_info.h
index 815680b585ed..b3e888638bb7 100644
--- a/arch/alpha/include/asm/thread_info.h
+++ b/arch/alpha/include/asm/thread_info.h
@@ -61,21 +61,24 @@ register struct thread_info *__current_thread_info __asm__("$8");
61/* 61/*
62 * Thread information flags: 62 * Thread information flags:
63 * - these are process state flags and used from assembly 63 * - these are process state flags and used from assembly
64 * - pending work-to-be-done flags come first to fit in and immediate operand. 64 * - pending work-to-be-done flags come first and must be assigned to be
65 * within bits 0 to 7 to fit in and immediate operand.
66 * - ALPHA_UAC_SHIFT below must be kept consistent with the unaligned
67 * control flags.
65 * 68 *
66 * TIF_SYSCALL_TRACE is known to be 0 via blbs. 69 * TIF_SYSCALL_TRACE is known to be 0 via blbs.
67 */ 70 */
68#define TIF_SYSCALL_TRACE 0 /* syscall trace active */ 71#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
69#define TIF_SIGPENDING 1 /* signal pending */ 72#define TIF_NOTIFY_RESUME 1 /* callback before returning to user */
70#define TIF_NEED_RESCHED 2 /* rescheduling necessary */ 73#define TIF_SIGPENDING 2 /* signal pending */
71#define TIF_POLLING_NRFLAG 3 /* poll_idle is polling NEED_RESCHED */ 74#define TIF_NEED_RESCHED 3 /* rescheduling necessary */
72#define TIF_DIE_IF_KERNEL 4 /* dik recursion lock */ 75#define TIF_POLLING_NRFLAG 8 /* poll_idle is polling NEED_RESCHED */
73#define TIF_UAC_NOPRINT 5 /* see sysinfo.h */ 76#define TIF_DIE_IF_KERNEL 9 /* dik recursion lock */
74#define TIF_UAC_NOFIX 6 77#define TIF_UAC_NOPRINT 10 /* see sysinfo.h */
75#define TIF_UAC_SIGBUS 7 78#define TIF_UAC_NOFIX 11
76#define TIF_MEMDIE 8 79#define TIF_UAC_SIGBUS 12
77#define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal */ 80#define TIF_MEMDIE 13
78#define TIF_NOTIFY_RESUME 10 /* callback before returning to user */ 81#define TIF_RESTORE_SIGMASK 14 /* restore signal mask in do_signal */
79#define TIF_FREEZE 16 /* is freezing for suspend */ 82#define TIF_FREEZE 16 /* is freezing for suspend */
80 83
81#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 84#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
@@ -94,7 +97,7 @@ register struct thread_info *__current_thread_info __asm__("$8");
94#define _TIF_ALLWORK_MASK (_TIF_WORK_MASK \ 97#define _TIF_ALLWORK_MASK (_TIF_WORK_MASK \
95 | _TIF_SYSCALL_TRACE) 98 | _TIF_SYSCALL_TRACE)
96 99
97#define ALPHA_UAC_SHIFT 6 100#define ALPHA_UAC_SHIFT 10
98#define ALPHA_UAC_MASK (1 << TIF_UAC_NOPRINT | 1 << TIF_UAC_NOFIX | \ 101#define ALPHA_UAC_MASK (1 << TIF_UAC_NOPRINT | 1 << TIF_UAC_NOFIX | \
99 1 << TIF_UAC_SIGBUS) 102 1 << TIF_UAC_SIGBUS)
100 103
diff --git a/arch/alpha/kernel/core_marvel.c b/arch/alpha/kernel/core_marvel.c
index 8e059e58b0ac..53dd2f1a53aa 100644
--- a/arch/alpha/kernel/core_marvel.c
+++ b/arch/alpha/kernel/core_marvel.c
@@ -1103,6 +1103,8 @@ marvel_agp_info(void)
1103 * Allocate the info structure. 1103 * Allocate the info structure.
1104 */ 1104 */
1105 agp = kmalloc(sizeof(*agp), GFP_KERNEL); 1105 agp = kmalloc(sizeof(*agp), GFP_KERNEL);
1106 if (!agp)
1107 return NULL;
1106 1108
1107 /* 1109 /*
1108 * Fill it in. 1110 * Fill it in.
diff --git a/arch/alpha/kernel/core_titan.c b/arch/alpha/kernel/core_titan.c
index 76686497b1e2..219bf271c0ba 100644
--- a/arch/alpha/kernel/core_titan.c
+++ b/arch/alpha/kernel/core_titan.c
@@ -757,6 +757,8 @@ titan_agp_info(void)
757 * Allocate the info structure. 757 * Allocate the info structure.
758 */ 758 */
759 agp = kmalloc(sizeof(*agp), GFP_KERNEL); 759 agp = kmalloc(sizeof(*agp), GFP_KERNEL);
760 if (!agp)
761 return NULL;
760 762
761 /* 763 /*
762 * Fill it in. 764 * Fill it in.
diff --git a/arch/alpha/kernel/irq.c b/arch/alpha/kernel/irq.c
index cc7834661427..c0de072b8305 100644
--- a/arch/alpha/kernel/irq.c
+++ b/arch/alpha/kernel/irq.c
@@ -92,7 +92,7 @@ show_interrupts(struct seq_file *p, void *v)
92 for_each_online_cpu(j) 92 for_each_online_cpu(j)
93 seq_printf(p, "%10u ", kstat_irqs_cpu(irq, j)); 93 seq_printf(p, "%10u ", kstat_irqs_cpu(irq, j));
94#endif 94#endif
95 seq_printf(p, " %14s", irq_desc[irq].chip->typename); 95 seq_printf(p, " %14s", irq_desc[irq].chip->name);
96 seq_printf(p, " %c%s", 96 seq_printf(p, " %c%s",
97 (action->flags & IRQF_DISABLED)?'+':' ', 97 (action->flags & IRQF_DISABLED)?'+':' ',
98 action->name); 98 action->name);
diff --git a/arch/alpha/kernel/irq_alpha.c b/arch/alpha/kernel/irq_alpha.c
index 38c805dfc544..cfde865b78e0 100644
--- a/arch/alpha/kernel/irq_alpha.c
+++ b/arch/alpha/kernel/irq_alpha.c
@@ -228,7 +228,7 @@ struct irqaction timer_irqaction = {
228}; 228};
229 229
230static struct irq_chip rtc_irq_type = { 230static struct irq_chip rtc_irq_type = {
231 .typename = "RTC", 231 .name = "RTC",
232 .startup = rtc_startup, 232 .startup = rtc_startup,
233 .shutdown = rtc_enable_disable, 233 .shutdown = rtc_enable_disable,
234 .enable = rtc_enable_disable, 234 .enable = rtc_enable_disable,
diff --git a/arch/alpha/kernel/irq_i8259.c b/arch/alpha/kernel/irq_i8259.c
index 50bfec9b588f..83a9ac280890 100644
--- a/arch/alpha/kernel/irq_i8259.c
+++ b/arch/alpha/kernel/irq_i8259.c
@@ -84,7 +84,7 @@ i8259a_end_irq(unsigned int irq)
84} 84}
85 85
86struct irq_chip i8259a_irq_type = { 86struct irq_chip i8259a_irq_type = {
87 .typename = "XT-PIC", 87 .name = "XT-PIC",
88 .startup = i8259a_startup_irq, 88 .startup = i8259a_startup_irq,
89 .shutdown = i8259a_disable_irq, 89 .shutdown = i8259a_disable_irq,
90 .enable = i8259a_enable_irq, 90 .enable = i8259a_enable_irq,
diff --git a/arch/alpha/kernel/irq_pyxis.c b/arch/alpha/kernel/irq_pyxis.c
index 69199a76ec4a..989ce46a0cf3 100644
--- a/arch/alpha/kernel/irq_pyxis.c
+++ b/arch/alpha/kernel/irq_pyxis.c
@@ -71,7 +71,7 @@ pyxis_mask_and_ack_irq(unsigned int irq)
71} 71}
72 72
73static struct irq_chip pyxis_irq_type = { 73static struct irq_chip pyxis_irq_type = {
74 .typename = "PYXIS", 74 .name = "PYXIS",
75 .startup = pyxis_startup_irq, 75 .startup = pyxis_startup_irq,
76 .shutdown = pyxis_disable_irq, 76 .shutdown = pyxis_disable_irq,
77 .enable = pyxis_enable_irq, 77 .enable = pyxis_enable_irq,
diff --git a/arch/alpha/kernel/irq_srm.c b/arch/alpha/kernel/irq_srm.c
index 85229369a1f8..d63e93e1e8bf 100644
--- a/arch/alpha/kernel/irq_srm.c
+++ b/arch/alpha/kernel/irq_srm.c
@@ -49,7 +49,7 @@ srm_end_irq(unsigned int irq)
49 49
50/* Handle interrupts from the SRM, assuming no additional weirdness. */ 50/* Handle interrupts from the SRM, assuming no additional weirdness. */
51static struct irq_chip srm_irq_type = { 51static struct irq_chip srm_irq_type = {
52 .typename = "SRM", 52 .name = "SRM",
53 .startup = srm_startup_irq, 53 .startup = srm_startup_irq,
54 .shutdown = srm_disable_irq, 54 .shutdown = srm_disable_irq,
55 .enable = srm_enable_irq, 55 .enable = srm_enable_irq,
diff --git a/arch/alpha/kernel/sys_alcor.c b/arch/alpha/kernel/sys_alcor.c
index 382035ef7394..20a30b8b9655 100644
--- a/arch/alpha/kernel/sys_alcor.c
+++ b/arch/alpha/kernel/sys_alcor.c
@@ -90,7 +90,7 @@ alcor_end_irq(unsigned int irq)
90} 90}
91 91
92static struct irq_chip alcor_irq_type = { 92static struct irq_chip alcor_irq_type = {
93 .typename = "ALCOR", 93 .name = "ALCOR",
94 .startup = alcor_startup_irq, 94 .startup = alcor_startup_irq,
95 .shutdown = alcor_disable_irq, 95 .shutdown = alcor_disable_irq,
96 .enable = alcor_enable_irq, 96 .enable = alcor_enable_irq,
diff --git a/arch/alpha/kernel/sys_cabriolet.c b/arch/alpha/kernel/sys_cabriolet.c
index ed349436732b..affd0f3f25df 100644
--- a/arch/alpha/kernel/sys_cabriolet.c
+++ b/arch/alpha/kernel/sys_cabriolet.c
@@ -72,7 +72,7 @@ cabriolet_end_irq(unsigned int irq)
72} 72}
73 73
74static struct irq_chip cabriolet_irq_type = { 74static struct irq_chip cabriolet_irq_type = {
75 .typename = "CABRIOLET", 75 .name = "CABRIOLET",
76 .startup = cabriolet_startup_irq, 76 .startup = cabriolet_startup_irq,
77 .shutdown = cabriolet_disable_irq, 77 .shutdown = cabriolet_disable_irq,
78 .enable = cabriolet_enable_irq, 78 .enable = cabriolet_enable_irq,
diff --git a/arch/alpha/kernel/sys_dp264.c b/arch/alpha/kernel/sys_dp264.c
index 46e70ece5176..d64e1e497e76 100644
--- a/arch/alpha/kernel/sys_dp264.c
+++ b/arch/alpha/kernel/sys_dp264.c
@@ -199,7 +199,7 @@ clipper_set_affinity(unsigned int irq, const struct cpumask *affinity)
199} 199}
200 200
201static struct irq_chip dp264_irq_type = { 201static struct irq_chip dp264_irq_type = {
202 .typename = "DP264", 202 .name = "DP264",
203 .startup = dp264_startup_irq, 203 .startup = dp264_startup_irq,
204 .shutdown = dp264_disable_irq, 204 .shutdown = dp264_disable_irq,
205 .enable = dp264_enable_irq, 205 .enable = dp264_enable_irq,
@@ -210,7 +210,7 @@ static struct irq_chip dp264_irq_type = {
210}; 210};
211 211
212static struct irq_chip clipper_irq_type = { 212static struct irq_chip clipper_irq_type = {
213 .typename = "CLIPPER", 213 .name = "CLIPPER",
214 .startup = clipper_startup_irq, 214 .startup = clipper_startup_irq,
215 .shutdown = clipper_disable_irq, 215 .shutdown = clipper_disable_irq,
216 .enable = clipper_enable_irq, 216 .enable = clipper_enable_irq,
diff --git a/arch/alpha/kernel/sys_eb64p.c b/arch/alpha/kernel/sys_eb64p.c
index 660c23ef661f..df2090ce5e7f 100644
--- a/arch/alpha/kernel/sys_eb64p.c
+++ b/arch/alpha/kernel/sys_eb64p.c
@@ -70,7 +70,7 @@ eb64p_end_irq(unsigned int irq)
70} 70}
71 71
72static struct irq_chip eb64p_irq_type = { 72static struct irq_chip eb64p_irq_type = {
73 .typename = "EB64P", 73 .name = "EB64P",
74 .startup = eb64p_startup_irq, 74 .startup = eb64p_startup_irq,
75 .shutdown = eb64p_disable_irq, 75 .shutdown = eb64p_disable_irq,
76 .enable = eb64p_enable_irq, 76 .enable = eb64p_enable_irq,
diff --git a/arch/alpha/kernel/sys_eiger.c b/arch/alpha/kernel/sys_eiger.c
index b99ea488d844..3ca1dbcf4044 100644
--- a/arch/alpha/kernel/sys_eiger.c
+++ b/arch/alpha/kernel/sys_eiger.c
@@ -81,7 +81,7 @@ eiger_end_irq(unsigned int irq)
81} 81}
82 82
83static struct irq_chip eiger_irq_type = { 83static struct irq_chip eiger_irq_type = {
84 .typename = "EIGER", 84 .name = "EIGER",
85 .startup = eiger_startup_irq, 85 .startup = eiger_startup_irq,
86 .shutdown = eiger_disable_irq, 86 .shutdown = eiger_disable_irq,
87 .enable = eiger_enable_irq, 87 .enable = eiger_enable_irq,
diff --git a/arch/alpha/kernel/sys_jensen.c b/arch/alpha/kernel/sys_jensen.c
index ef0b83a070ac..7a7ae36fff91 100644
--- a/arch/alpha/kernel/sys_jensen.c
+++ b/arch/alpha/kernel/sys_jensen.c
@@ -119,7 +119,7 @@ jensen_local_end(unsigned int irq)
119} 119}
120 120
121static struct irq_chip jensen_local_irq_type = { 121static struct irq_chip jensen_local_irq_type = {
122 .typename = "LOCAL", 122 .name = "LOCAL",
123 .startup = jensen_local_startup, 123 .startup = jensen_local_startup,
124 .shutdown = jensen_local_shutdown, 124 .shutdown = jensen_local_shutdown,
125 .enable = jensen_local_enable, 125 .enable = jensen_local_enable,
diff --git a/arch/alpha/kernel/sys_marvel.c b/arch/alpha/kernel/sys_marvel.c
index bbfc4f20ca72..0bb3b5c4f693 100644
--- a/arch/alpha/kernel/sys_marvel.c
+++ b/arch/alpha/kernel/sys_marvel.c
@@ -170,7 +170,7 @@ marvel_irq_noop_return(unsigned int irq)
170} 170}
171 171
172static struct irq_chip marvel_legacy_irq_type = { 172static struct irq_chip marvel_legacy_irq_type = {
173 .typename = "LEGACY", 173 .name = "LEGACY",
174 .startup = marvel_irq_noop_return, 174 .startup = marvel_irq_noop_return,
175 .shutdown = marvel_irq_noop, 175 .shutdown = marvel_irq_noop,
176 .enable = marvel_irq_noop, 176 .enable = marvel_irq_noop,
@@ -180,7 +180,7 @@ static struct irq_chip marvel_legacy_irq_type = {
180}; 180};
181 181
182static struct irq_chip io7_lsi_irq_type = { 182static struct irq_chip io7_lsi_irq_type = {
183 .typename = "LSI", 183 .name = "LSI",
184 .startup = io7_startup_irq, 184 .startup = io7_startup_irq,
185 .shutdown = io7_disable_irq, 185 .shutdown = io7_disable_irq,
186 .enable = io7_enable_irq, 186 .enable = io7_enable_irq,
@@ -190,7 +190,7 @@ static struct irq_chip io7_lsi_irq_type = {
190}; 190};
191 191
192static struct irq_chip io7_msi_irq_type = { 192static struct irq_chip io7_msi_irq_type = {
193 .typename = "MSI", 193 .name = "MSI",
194 .startup = io7_startup_irq, 194 .startup = io7_startup_irq,
195 .shutdown = io7_disable_irq, 195 .shutdown = io7_disable_irq,
196 .enable = io7_enable_irq, 196 .enable = io7_enable_irq,
diff --git a/arch/alpha/kernel/sys_mikasa.c b/arch/alpha/kernel/sys_mikasa.c
index 4e366641a08e..ee8865169811 100644
--- a/arch/alpha/kernel/sys_mikasa.c
+++ b/arch/alpha/kernel/sys_mikasa.c
@@ -69,7 +69,7 @@ mikasa_end_irq(unsigned int irq)
69} 69}
70 70
71static struct irq_chip mikasa_irq_type = { 71static struct irq_chip mikasa_irq_type = {
72 .typename = "MIKASA", 72 .name = "MIKASA",
73 .startup = mikasa_startup_irq, 73 .startup = mikasa_startup_irq,
74 .shutdown = mikasa_disable_irq, 74 .shutdown = mikasa_disable_irq,
75 .enable = mikasa_enable_irq, 75 .enable = mikasa_enable_irq,
diff --git a/arch/alpha/kernel/sys_noritake.c b/arch/alpha/kernel/sys_noritake.c
index 35753a173bac..86503fe73a88 100644
--- a/arch/alpha/kernel/sys_noritake.c
+++ b/arch/alpha/kernel/sys_noritake.c
@@ -74,7 +74,7 @@ noritake_end_irq(unsigned int irq)
74} 74}
75 75
76static struct irq_chip noritake_irq_type = { 76static struct irq_chip noritake_irq_type = {
77 .typename = "NORITAKE", 77 .name = "NORITAKE",
78 .startup = noritake_startup_irq, 78 .startup = noritake_startup_irq,
79 .shutdown = noritake_disable_irq, 79 .shutdown = noritake_disable_irq,
80 .enable = noritake_enable_irq, 80 .enable = noritake_enable_irq,
diff --git a/arch/alpha/kernel/sys_rawhide.c b/arch/alpha/kernel/sys_rawhide.c
index f3aec7e085c8..26c322bf89ee 100644
--- a/arch/alpha/kernel/sys_rawhide.c
+++ b/arch/alpha/kernel/sys_rawhide.c
@@ -136,7 +136,7 @@ rawhide_end_irq(unsigned int irq)
136} 136}
137 137
138static struct irq_chip rawhide_irq_type = { 138static struct irq_chip rawhide_irq_type = {
139 .typename = "RAWHIDE", 139 .name = "RAWHIDE",
140 .startup = rawhide_startup_irq, 140 .startup = rawhide_startup_irq,
141 .shutdown = rawhide_disable_irq, 141 .shutdown = rawhide_disable_irq,
142 .enable = rawhide_enable_irq, 142 .enable = rawhide_enable_irq,
diff --git a/arch/alpha/kernel/sys_ruffian.c b/arch/alpha/kernel/sys_ruffian.c
index d9f9cfeb9931..8de1046fe91e 100644
--- a/arch/alpha/kernel/sys_ruffian.c
+++ b/arch/alpha/kernel/sys_ruffian.c
@@ -66,7 +66,7 @@ ruffian_init_irq(void)
66 common_init_isa_dma(); 66 common_init_isa_dma();
67} 67}
68 68
69#define RUFFIAN_LATCH ((PIT_TICK_RATE + HZ / 2) / HZ) 69#define RUFFIAN_LATCH DIV_ROUND_CLOSEST(PIT_TICK_RATE, HZ)
70 70
71static void __init 71static void __init
72ruffian_init_rtc(void) 72ruffian_init_rtc(void)
diff --git a/arch/alpha/kernel/sys_rx164.c b/arch/alpha/kernel/sys_rx164.c
index fc9246373452..be161129eab9 100644
--- a/arch/alpha/kernel/sys_rx164.c
+++ b/arch/alpha/kernel/sys_rx164.c
@@ -73,7 +73,7 @@ rx164_end_irq(unsigned int irq)
73} 73}
74 74
75static struct irq_chip rx164_irq_type = { 75static struct irq_chip rx164_irq_type = {
76 .typename = "RX164", 76 .name = "RX164",
77 .startup = rx164_startup_irq, 77 .startup = rx164_startup_irq,
78 .shutdown = rx164_disable_irq, 78 .shutdown = rx164_disable_irq,
79 .enable = rx164_enable_irq, 79 .enable = rx164_enable_irq,
diff --git a/arch/alpha/kernel/sys_sable.c b/arch/alpha/kernel/sys_sable.c
index 426eb6906d01..b2abe27a23cf 100644
--- a/arch/alpha/kernel/sys_sable.c
+++ b/arch/alpha/kernel/sys_sable.c
@@ -502,7 +502,7 @@ sable_lynx_mask_and_ack_irq(unsigned int irq)
502} 502}
503 503
504static struct irq_chip sable_lynx_irq_type = { 504static struct irq_chip sable_lynx_irq_type = {
505 .typename = "SABLE/LYNX", 505 .name = "SABLE/LYNX",
506 .startup = sable_lynx_startup_irq, 506 .startup = sable_lynx_startup_irq,
507 .shutdown = sable_lynx_disable_irq, 507 .shutdown = sable_lynx_disable_irq,
508 .enable = sable_lynx_enable_irq, 508 .enable = sable_lynx_enable_irq,
diff --git a/arch/alpha/kernel/sys_takara.c b/arch/alpha/kernel/sys_takara.c
index 830318c21661..230464885b5c 100644
--- a/arch/alpha/kernel/sys_takara.c
+++ b/arch/alpha/kernel/sys_takara.c
@@ -75,7 +75,7 @@ takara_end_irq(unsigned int irq)
75} 75}
76 76
77static struct irq_chip takara_irq_type = { 77static struct irq_chip takara_irq_type = {
78 .typename = "TAKARA", 78 .name = "TAKARA",
79 .startup = takara_startup_irq, 79 .startup = takara_startup_irq,
80 .shutdown = takara_disable_irq, 80 .shutdown = takara_disable_irq,
81 .enable = takara_enable_irq, 81 .enable = takara_enable_irq,
diff --git a/arch/alpha/kernel/sys_titan.c b/arch/alpha/kernel/sys_titan.c
index 88978fc60f83..288053342c83 100644
--- a/arch/alpha/kernel/sys_titan.c
+++ b/arch/alpha/kernel/sys_titan.c
@@ -195,7 +195,7 @@ init_titan_irqs(struct irq_chip * ops, int imin, int imax)
195} 195}
196 196
197static struct irq_chip titan_irq_type = { 197static struct irq_chip titan_irq_type = {
198 .typename = "TITAN", 198 .name = "TITAN",
199 .startup = titan_startup_irq, 199 .startup = titan_startup_irq,
200 .shutdown = titan_disable_irq, 200 .shutdown = titan_disable_irq,
201 .enable = titan_enable_irq, 201 .enable = titan_enable_irq,
diff --git a/arch/alpha/kernel/sys_wildfire.c b/arch/alpha/kernel/sys_wildfire.c
index e91b4c3838a8..62fd972e18ef 100644
--- a/arch/alpha/kernel/sys_wildfire.c
+++ b/arch/alpha/kernel/sys_wildfire.c
@@ -158,7 +158,7 @@ wildfire_end_irq(unsigned int irq)
158} 158}
159 159
160static struct irq_chip wildfire_irq_type = { 160static struct irq_chip wildfire_irq_type = {
161 .typename = "WILDFIRE", 161 .name = "WILDFIRE",
162 .startup = wildfire_startup_irq, 162 .startup = wildfire_startup_irq,
163 .shutdown = wildfire_disable_irq, 163 .shutdown = wildfire_disable_irq,
164 .enable = wildfire_enable_irq, 164 .enable = wildfire_enable_irq,
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 1aad0d9f5074..fd7620f025fa 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -358,7 +358,14 @@ config SGI_IP22
358 select SWAP_IO_SPACE 358 select SWAP_IO_SPACE
359 select SYS_HAS_CPU_R4X00 359 select SYS_HAS_CPU_R4X00
360 select SYS_HAS_CPU_R5000 360 select SYS_HAS_CPU_R5000
361 select SYS_HAS_EARLY_PRINTK 361 #
362 # Disable EARLY_PRINTK for now since it leads to overwritten prom
363 # memory during early boot on some machines.
364 #
365 # See http://www.linux-mips.org/cgi-bin/mesg.cgi?a=linux-mips&i=20091119164009.GA15038%40deprecation.cyrius.com
366 # for a more details discussion
367 #
368 # select SYS_HAS_EARLY_PRINTK
362 select SYS_SUPPORTS_32BIT_KERNEL 369 select SYS_SUPPORTS_32BIT_KERNEL
363 select SYS_SUPPORTS_64BIT_KERNEL 370 select SYS_SUPPORTS_64BIT_KERNEL
364 select SYS_SUPPORTS_BIG_ENDIAN 371 select SYS_SUPPORTS_BIG_ENDIAN
@@ -410,7 +417,14 @@ config SGI_IP28
410 select SGI_HAS_ZILOG 417 select SGI_HAS_ZILOG
411 select SWAP_IO_SPACE 418 select SWAP_IO_SPACE
412 select SYS_HAS_CPU_R10000 419 select SYS_HAS_CPU_R10000
413 select SYS_HAS_EARLY_PRINTK 420 #
421 # Disable EARLY_PRINTK for now since it leads to overwritten prom
422 # memory during early boot on some machines.
423 #
424 # See http://www.linux-mips.org/cgi-bin/mesg.cgi?a=linux-mips&i=20091119164009.GA15038%40deprecation.cyrius.com
425 # for a more details discussion
426 #
427 # select SYS_HAS_EARLY_PRINTK
414 select SYS_SUPPORTS_64BIT_KERNEL 428 select SYS_SUPPORTS_64BIT_KERNEL
415 select SYS_SUPPORTS_BIG_ENDIAN 429 select SYS_SUPPORTS_BIG_ENDIAN
416 help 430 help
@@ -1439,6 +1453,7 @@ choice
1439 1453
1440config PAGE_SIZE_4KB 1454config PAGE_SIZE_4KB
1441 bool "4kB" 1455 bool "4kB"
1456 depends on !CPU_LOONGSON2
1442 help 1457 help
1443 This option select the standard 4kB Linux page size. On some 1458 This option select the standard 4kB Linux page size. On some
1444 R3000-family processors this is the only available page size. Using 1459 R3000-family processors this is the only available page size. Using
@@ -1763,7 +1778,7 @@ config SYS_SUPPORTS_SMARTMIPS
1763 1778
1764config ARCH_FLATMEM_ENABLE 1779config ARCH_FLATMEM_ENABLE
1765 def_bool y 1780 def_bool y
1766 depends on !NUMA 1781 depends on !NUMA && !CPU_LOONGSON2
1767 1782
1768config ARCH_DISCONTIGMEM_ENABLE 1783config ARCH_DISCONTIGMEM_ENABLE
1769 bool 1784 bool
diff --git a/arch/mips/include/asm/mman.h b/arch/mips/include/asm/mman.h
index a2250f390a29..c892bfb3e2c1 100644
--- a/arch/mips/include/asm/mman.h
+++ b/arch/mips/include/asm/mman.h
@@ -75,6 +75,7 @@
75 75
76#define MADV_MERGEABLE 12 /* KSM may merge identical pages */ 76#define MADV_MERGEABLE 12 /* KSM may merge identical pages */
77#define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages */ 77#define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages */
78#define MADV_HWPOISON 100 /* poison a page for testing */
78 79
79/* compatibility flags */ 80/* compatibility flags */
80#define MAP_FILE 0 81#define MAP_FILE 0
diff --git a/arch/mips/include/asm/system.h b/arch/mips/include/asm/system.h
index fcf5f98d90cc..83b5509e09e8 100644
--- a/arch/mips/include/asm/system.h
+++ b/arch/mips/include/asm/system.h
@@ -12,6 +12,7 @@
12#ifndef _ASM_SYSTEM_H 12#ifndef _ASM_SYSTEM_H
13#define _ASM_SYSTEM_H 13#define _ASM_SYSTEM_H
14 14
15#include <linux/kernel.h>
15#include <linux/types.h> 16#include <linux/types.h>
16#include <linux/irqflags.h> 17#include <linux/irqflags.h>
17 18
@@ -193,10 +194,6 @@ extern __u64 __xchg_u64_unsupported_on_32bit_kernels(volatile __u64 * m, __u64 v
193#define __xchg_u64 __xchg_u64_unsupported_on_32bit_kernels 194#define __xchg_u64 __xchg_u64_unsupported_on_32bit_kernels
194#endif 195#endif
195 196
196/* This function doesn't exist, so you'll get a linker error
197 if something tries to do an invalid xchg(). */
198extern void __xchg_called_with_bad_pointer(void);
199
200static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size) 197static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size)
201{ 198{
202 switch (size) { 199 switch (size) {
@@ -205,11 +202,17 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz
205 case 8: 202 case 8:
206 return __xchg_u64(ptr, x); 203 return __xchg_u64(ptr, x);
207 } 204 }
208 __xchg_called_with_bad_pointer(); 205
209 return x; 206 return x;
210} 207}
211 208
212#define xchg(ptr, x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x), (ptr), sizeof(*(ptr)))) 209#define xchg(ptr, x) \
210({ \
211 BUILD_BUG_ON(sizeof(*(ptr)) & ~0xc); \
212 \
213 ((__typeof__(*(ptr))) \
214 __xchg((unsigned long)(x), (ptr), sizeof(*(ptr)))); \
215})
213 216
214extern void set_handler(unsigned long offset, void *addr, unsigned long len); 217extern void set_handler(unsigned long offset, void *addr, unsigned long len);
215extern void set_uncached_handler(unsigned long offset, void *addr, unsigned long len); 218extern void set_uncached_handler(unsigned long offset, void *addr, unsigned long len);
diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c
index 3fe1fcfa2e73..fe0d79805603 100644
--- a/arch/mips/kernel/syscall.c
+++ b/arch/mips/kernel/syscall.c
@@ -306,6 +306,7 @@ static inline int mips_atomic_set(struct pt_regs *regs,
306 306
307 if (cpu_has_llsc && R10000_LLSC_WAR) { 307 if (cpu_has_llsc && R10000_LLSC_WAR) {
308 __asm__ __volatile__ ( 308 __asm__ __volatile__ (
309 " .set mips3 \n"
309 " li %[err], 0 \n" 310 " li %[err], 0 \n"
310 "1: ll %[old], (%[addr]) \n" 311 "1: ll %[old], (%[addr]) \n"
311 " move %[tmp], %[new] \n" 312 " move %[tmp], %[new] \n"
@@ -320,6 +321,7 @@ static inline int mips_atomic_set(struct pt_regs *regs,
320 " "STR(PTR)" 1b, 4b \n" 321 " "STR(PTR)" 1b, 4b \n"
321 " "STR(PTR)" 2b, 4b \n" 322 " "STR(PTR)" 2b, 4b \n"
322 " .previous \n" 323 " .previous \n"
324 " .set mips0 \n"
323 : [old] "=&r" (old), 325 : [old] "=&r" (old),
324 [err] "=&r" (err), 326 [err] "=&r" (err),
325 [tmp] "=&r" (tmp) 327 [tmp] "=&r" (tmp)
@@ -329,6 +331,7 @@ static inline int mips_atomic_set(struct pt_regs *regs,
329 : "memory"); 331 : "memory");
330 } else if (cpu_has_llsc) { 332 } else if (cpu_has_llsc) {
331 __asm__ __volatile__ ( 333 __asm__ __volatile__ (
334 " .set mips3 \n"
332 " li %[err], 0 \n" 335 " li %[err], 0 \n"
333 "1: ll %[old], (%[addr]) \n" 336 "1: ll %[old], (%[addr]) \n"
334 " move %[tmp], %[new] \n" 337 " move %[tmp], %[new] \n"
@@ -347,6 +350,7 @@ static inline int mips_atomic_set(struct pt_regs *regs,
347 " "STR(PTR)" 1b, 5b \n" 350 " "STR(PTR)" 1b, 5b \n"
348 " "STR(PTR)" 2b, 5b \n" 351 " "STR(PTR)" 2b, 5b \n"
349 " .previous \n" 352 " .previous \n"
353 " .set mips0 \n"
350 : [old] "=&r" (old), 354 : [old] "=&r" (old),
351 [err] "=&r" (err), 355 [err] "=&r" (err),
352 [tmp] "=&r" (tmp) 356 [tmp] "=&r" (tmp)
diff --git a/arch/mips/rb532/devices.c b/arch/mips/rb532/devices.c
index 9f40e1ff9b4f..041fc1afc3f4 100644
--- a/arch/mips/rb532/devices.c
+++ b/arch/mips/rb532/devices.c
@@ -110,7 +110,6 @@ static struct korina_device korina_dev0_data = {
110static struct platform_device korina_dev0 = { 110static struct platform_device korina_dev0 = {
111 .id = -1, 111 .id = -1,
112 .name = "korina", 112 .name = "korina",
113 .dev.driver_data = &korina_dev0_data,
114 .resource = korina_dev0_res, 113 .resource = korina_dev0_res,
115 .num_resources = ARRAY_SIZE(korina_dev0_res), 114 .num_resources = ARRAY_SIZE(korina_dev0_res),
116}; 115};
@@ -332,6 +331,8 @@ static int __init plat_setup_devices(void)
332 /* set the uart clock to the current cpu frequency */ 331 /* set the uart clock to the current cpu frequency */
333 rb532_uart_res[0].uartclk = idt_cpu_freq; 332 rb532_uart_res[0].uartclk = idt_cpu_freq;
334 333
334 dev_set_drvdata(&korina_dev0.dev, &korina_dev0_data);
335
335 return platform_add_devices(rb532_devs, ARRAY_SIZE(rb532_devs)); 336 return platform_add_devices(rb532_devs, ARRAY_SIZE(rb532_devs));
336} 337}
337 338
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c
index 965ece2c7e4d..13bb69d2abb3 100644
--- a/drivers/block/aoe/aoecmd.c
+++ b/drivers/block/aoe/aoecmd.c
@@ -735,6 +735,21 @@ diskstats(struct gendisk *disk, struct bio *bio, ulong duration, sector_t sector
735 part_stat_unlock(); 735 part_stat_unlock();
736} 736}
737 737
738/*
739 * Ensure we don't create aliases in VI caches
740 */
741static inline void
742killalias(struct bio *bio)
743{
744 struct bio_vec *bv;
745 int i;
746
747 if (bio_data_dir(bio) == READ)
748 __bio_for_each_segment(bv, bio, i, 0) {
749 flush_dcache_page(bv->bv_page);
750 }
751}
752
738void 753void
739aoecmd_ata_rsp(struct sk_buff *skb) 754aoecmd_ata_rsp(struct sk_buff *skb)
740{ 755{
@@ -853,8 +868,12 @@ aoecmd_ata_rsp(struct sk_buff *skb)
853 868
854 if (buf && --buf->nframesout == 0 && buf->resid == 0) { 869 if (buf && --buf->nframesout == 0 && buf->resid == 0) {
855 diskstats(d->gd, buf->bio, jiffies - buf->stime, buf->sector); 870 diskstats(d->gd, buf->bio, jiffies - buf->stime, buf->sector);
856 n = (buf->flags & BUFFL_FAIL) ? -EIO : 0; 871 if (buf->flags & BUFFL_FAIL)
857 bio_endio(buf->bio, n); 872 bio_endio(buf->bio, -EIO);
873 else {
874 killalias(buf->bio);
875 bio_endio(buf->bio, 0);
876 }
858 mempool_free(buf, d->bufpool); 877 mempool_free(buf, d->bufpool);
859 } 878 }
860 879
diff --git a/drivers/char/tty_port.c b/drivers/char/tty_port.c
index 2e8552dc5eda..c63f3d33914a 100644
--- a/drivers/char/tty_port.c
+++ b/drivers/char/tty_port.c
@@ -219,8 +219,11 @@ int tty_port_block_til_ready(struct tty_port *port,
219 219
220 /* if non-blocking mode is set we can pass directly to open unless 220 /* if non-blocking mode is set we can pass directly to open unless
221 the port has just hung up or is in another error state */ 221 the port has just hung up or is in another error state */
222 if ((filp->f_flags & O_NONBLOCK) || 222 if (tty->flags & (1 << TTY_IO_ERROR)) {
223 (tty->flags & (1 << TTY_IO_ERROR))) { 223 port->flags |= ASYNC_NORMAL_ACTIVE;
224 return 0;
225 }
226 if (filp->f_flags & O_NONBLOCK) {
224 /* Indicate we are open */ 227 /* Indicate we are open */
225 if (tty->termios->c_cflag & CBAUD) 228 if (tty->termios->c_cflag & CBAUD)
226 tty_port_raise_dtr_rts(port); 229 tty_port_raise_dtr_rts(port);
diff --git a/drivers/gpio/langwell_gpio.c b/drivers/gpio/langwell_gpio.c
index 5711ce5353c6..4baf3d7d0f8e 100644
--- a/drivers/gpio/langwell_gpio.c
+++ b/drivers/gpio/langwell_gpio.c
@@ -144,13 +144,6 @@ static int lnw_irq_type(unsigned irq, unsigned type)
144 144
145static void lnw_irq_unmask(unsigned irq) 145static void lnw_irq_unmask(unsigned irq)
146{ 146{
147 struct lnw_gpio *lnw = get_irq_chip_data(irq);
148 u32 gpio = irq - lnw->irq_base;
149 u8 reg = gpio / 32;
150 void __iomem *gedr;
151
152 gedr = (void __iomem *)(&lnw->reg_base->GEDR[reg]);
153 writel(BIT(gpio % 32), gedr);
154}; 147};
155 148
156static void lnw_irq_mask(unsigned irq) 149static void lnw_irq_mask(unsigned irq)
@@ -183,13 +176,11 @@ static void lnw_irq_handler(unsigned irq, struct irq_desc *desc)
183 gedr_v = readl(gedr); 176 gedr_v = readl(gedr);
184 if (!gedr_v) 177 if (!gedr_v)
185 continue; 178 continue;
186 for (gpio = reg*32; gpio < reg*32+32; gpio++) { 179 for (gpio = reg*32; gpio < reg*32+32; gpio++)
187 gedr_v = readl(gedr);
188 if (gedr_v & BIT(gpio % 32)) { 180 if (gedr_v & BIT(gpio % 32)) {
189 pr_debug("pin %d triggered\n", gpio); 181 pr_debug("pin %d triggered\n", gpio);
190 generic_handle_irq(lnw->irq_base + gpio); 182 generic_handle_irq(lnw->irq_base + gpio);
191 } 183 }
192 }
193 /* clear the edge detect status bit */ 184 /* clear the edge detect status bit */
194 writel(gedr_v, gedr); 185 writel(gedr_v, gedr);
195 } 186 }
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
index a537925f7651..2bcf1ace27c0 100644
--- a/drivers/input/serio/i8042-x86ia64io.h
+++ b/drivers/input/serio/i8042-x86ia64io.h
@@ -447,6 +447,27 @@ static struct dmi_system_id __initdata i8042_dmi_reset_table[] = {
447 DMI_MATCH(DMI_PRODUCT_NAME, "N10"), 447 DMI_MATCH(DMI_PRODUCT_NAME, "N10"),
448 }, 448 },
449 }, 449 },
450 {
451 .ident = "Dell Vostro 1320",
452 .matches = {
453 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
454 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1320"),
455 },
456 },
457 {
458 .ident = "Dell Vostro 1520",
459 .matches = {
460 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
461 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1520"),
462 },
463 },
464 {
465 .ident = "Dell Vostro 1720",
466 .matches = {
467 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
468 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1720"),
469 },
470 },
450 { } 471 { }
451}; 472};
452 473
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index a053423785c9..e07ce2e033a9 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1650,11 +1650,12 @@ static void raid1d(mddev_t *mddev)
1650 r1_bio->sector, 1650 r1_bio->sector,
1651 r1_bio->sectors); 1651 r1_bio->sectors);
1652 unfreeze_array(conf); 1652 unfreeze_array(conf);
1653 } 1653 } else
1654 md_error(mddev,
1655 conf->mirrors[r1_bio->read_disk].rdev);
1654 1656
1655 bio = r1_bio->bios[r1_bio->read_disk]; 1657 bio = r1_bio->bios[r1_bio->read_disk];
1656 if ((disk=read_balance(conf, r1_bio)) == -1 || 1658 if ((disk=read_balance(conf, r1_bio)) == -1) {
1657 disk == r1_bio->read_disk) {
1658 printk(KERN_ALERT "raid1: %s: unrecoverable I/O" 1659 printk(KERN_ALERT "raid1: %s: unrecoverable I/O"
1659 " read error for block %llu\n", 1660 " read error for block %llu\n",
1660 bdevname(bio->bi_bdev,b), 1661 bdevname(bio->bi_bdev,b),
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c
index ddf639ed2fd8..98082416aa52 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -31,6 +31,7 @@
31#include <linux/wait.h> 31#include <linux/wait.h>
32#include <linux/slab.h> 32#include <linux/slab.h>
33#include <linux/poll.h> 33#include <linux/poll.h>
34#include <linux/semaphore.h>
34#include <linux/module.h> 35#include <linux/module.h>
35#include <linux/list.h> 36#include <linux/list.h>
36#include <linux/freezer.h> 37#include <linux/freezer.h>
diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c
index b00d67319058..9fb480bb0e0a 100644
--- a/drivers/mmc/host/pxamci.c
+++ b/drivers/mmc/host/pxamci.c
@@ -760,6 +760,8 @@ static int pxamci_remove(struct platform_device *pdev)
760 if (mmc) { 760 if (mmc) {
761 struct pxamci_host *host = mmc_priv(mmc); 761 struct pxamci_host *host = mmc_priv(mmc);
762 762
763 mmc_remove_host(mmc);
764
763 if (host->pdata) { 765 if (host->pdata) {
764 gpio_cd = host->pdata->gpio_card_detect; 766 gpio_cd = host->pdata->gpio_card_detect;
765 gpio_ro = host->pdata->gpio_card_ro; 767 gpio_ro = host->pdata->gpio_card_ro;
@@ -779,8 +781,6 @@ static int pxamci_remove(struct platform_device *pdev)
779 if (host->pdata && host->pdata->exit) 781 if (host->pdata && host->pdata->exit)
780 host->pdata->exit(&pdev->dev, mmc); 782 host->pdata->exit(&pdev->dev, mmc);
781 783
782 mmc_remove_host(mmc);
783
784 pxamci_stop_clock(host); 784 pxamci_stop_clock(host);
785 writel(TXFIFO_WR_REQ|RXFIFO_RD_REQ|CLK_IS_OFF|STOP_CMD| 785 writel(TXFIFO_WR_REQ|RXFIFO_RD_REQ|CLK_IS_OFF|STOP_CMD|
786 END_CMD_RES|PRG_DONE|DATA_TRAN_DONE, 786 END_CMD_RES|PRG_DONE|DATA_TRAN_DONE,
diff --git a/drivers/regulator/wm831x-isink.c b/drivers/regulator/wm831x-isink.c
index 1d8d9879d3a1..48857008758c 100644
--- a/drivers/regulator/wm831x-isink.c
+++ b/drivers/regulator/wm831x-isink.c
@@ -167,6 +167,8 @@ static __devinit int wm831x_isink_probe(struct platform_device *pdev)
167 return -ENOMEM; 167 return -ENOMEM;
168 } 168 }
169 169
170 isink->wm831x = wm831x;
171
170 res = platform_get_resource(pdev, IORESOURCE_IO, 0); 172 res = platform_get_resource(pdev, IORESOURCE_IO, 0);
171 if (res == NULL) { 173 if (res == NULL) {
172 dev_err(&pdev->dev, "No I/O resource\n"); 174 dev_err(&pdev->dev, "No I/O resource\n");
diff --git a/drivers/rtc/rtc-pcf50633.c b/drivers/rtc/rtc-pcf50633.c
index 33a10c47260e..4c5d5d0c4cfc 100644
--- a/drivers/rtc/rtc-pcf50633.c
+++ b/drivers/rtc/rtc-pcf50633.c
@@ -292,8 +292,9 @@ static int __devinit pcf50633_rtc_probe(struct platform_device *pdev)
292 &pcf50633_rtc_ops, THIS_MODULE); 292 &pcf50633_rtc_ops, THIS_MODULE);
293 293
294 if (IS_ERR(rtc->rtc_dev)) { 294 if (IS_ERR(rtc->rtc_dev)) {
295 int ret = PTR_ERR(rtc->rtc_dev);
295 kfree(rtc); 296 kfree(rtc);
296 return PTR_ERR(rtc->rtc_dev); 297 return ret;
297 } 298 }
298 299
299 pcf50633_register_irq(rtc->pcf, PCF50633_IRQ_ALARM, 300 pcf50633_register_irq(rtc->pcf, PCF50633_IRQ_ALARM,
diff --git a/drivers/rtc/rtc-x1205.c b/drivers/rtc/rtc-x1205.c
index 310c10795e9a..6583c1a8b070 100644
--- a/drivers/rtc/rtc-x1205.c
+++ b/drivers/rtc/rtc-x1205.c
@@ -195,7 +195,7 @@ static int x1205_set_datetime(struct i2c_client *client, struct rtc_time *tm,
195 /* year, since the rtc epoch*/ 195 /* year, since the rtc epoch*/
196 buf[CCR_YEAR] = bin2bcd(tm->tm_year % 100); 196 buf[CCR_YEAR] = bin2bcd(tm->tm_year % 100);
197 buf[CCR_WDAY] = tm->tm_wday & 0x07; 197 buf[CCR_WDAY] = tm->tm_wday & 0x07;
198 buf[CCR_Y2K] = bin2bcd(tm->tm_year / 100); 198 buf[CCR_Y2K] = bin2bcd((tm->tm_year + 1900) / 100);
199 } 199 }
200 200
201 /* If writing alarm registers, set compare bits on registers 0-4 */ 201 /* If writing alarm registers, set compare bits on registers 0-4 */
@@ -280,9 +280,9 @@ static int x1205_fix_osc(struct i2c_client *client)
280 int err; 280 int err;
281 struct rtc_time tm; 281 struct rtc_time tm;
282 282
283 tm.tm_hour = tm.tm_min = tm.tm_sec = 0; 283 memset(&tm, 0, sizeof(tm));
284 284
285 err = x1205_set_datetime(client, &tm, 0, X1205_CCR_BASE, 0); 285 err = x1205_set_datetime(client, &tm, 1, X1205_CCR_BASE, 0);
286 if (err < 0) 286 if (err < 0)
287 dev_err(&client->dev, "unable to restart the oscillator\n"); 287 dev_err(&client->dev, "unable to restart the oscillator\n");
288 288
diff --git a/drivers/serial/bcm63xx_uart.c b/drivers/serial/bcm63xx_uart.c
index beddaa6e9069..37ad0c449937 100644
--- a/drivers/serial/bcm63xx_uart.c
+++ b/drivers/serial/bcm63xx_uart.c
@@ -242,7 +242,7 @@ static void bcm_uart_do_rx(struct uart_port *port)
242 * higher than fifo size anyway since we're much faster than 242 * higher than fifo size anyway since we're much faster than
243 * serial port */ 243 * serial port */
244 max_count = 32; 244 max_count = 32;
245 tty = port->info->port.tty; 245 tty = port->state->port.tty;
246 do { 246 do {
247 unsigned int iestat, c, cstat; 247 unsigned int iestat, c, cstat;
248 char flag; 248 char flag;
@@ -318,7 +318,7 @@ static void bcm_uart_do_tx(struct uart_port *port)
318 return; 318 return;
319 } 319 }
320 320
321 xmit = &port->info->xmit; 321 xmit = &port->state->xmit;
322 if (uart_circ_empty(xmit)) 322 if (uart_circ_empty(xmit))
323 goto txq_empty; 323 goto txq_empty;
324 324
diff --git a/drivers/serial/of_serial.c b/drivers/serial/of_serial.c
index 02406ba6da1c..cdf172eda2e3 100644
--- a/drivers/serial/of_serial.c
+++ b/drivers/serial/of_serial.c
@@ -161,6 +161,7 @@ static int of_platform_serial_remove(struct of_device *ofdev)
161static struct of_device_id __devinitdata of_platform_serial_table[] = { 161static struct of_device_id __devinitdata of_platform_serial_table[] = {
162 { .type = "serial", .compatible = "ns8250", .data = (void *)PORT_8250, }, 162 { .type = "serial", .compatible = "ns8250", .data = (void *)PORT_8250, },
163 { .type = "serial", .compatible = "ns16450", .data = (void *)PORT_16450, }, 163 { .type = "serial", .compatible = "ns16450", .data = (void *)PORT_16450, },
164 { .type = "serial", .compatible = "ns16550a", .data = (void *)PORT_16550A, },
164 { .type = "serial", .compatible = "ns16550", .data = (void *)PORT_16550, }, 165 { .type = "serial", .compatible = "ns16550", .data = (void *)PORT_16550, },
165 { .type = "serial", .compatible = "ns16750", .data = (void *)PORT_16750, }, 166 { .type = "serial", .compatible = "ns16750", .data = (void *)PORT_16750, },
166 { .type = "serial", .compatible = "ns16850", .data = (void *)PORT_16850, }, 167 { .type = "serial", .compatible = "ns16850", .data = (void *)PORT_16850, },
diff --git a/drivers/staging/hv/BlkVsc.c b/drivers/staging/hv/BlkVsc.c
index 51aa861292fc..a48ee3a12646 100644
--- a/drivers/staging/hv/BlkVsc.c
+++ b/drivers/staging/hv/BlkVsc.c
@@ -16,6 +16,7 @@
16 * Place - Suite 330, Boston, MA 02111-1307 USA. 16 * Place - Suite 330, Boston, MA 02111-1307 USA.
17 * 17 *
18 * Authors: 18 * Authors:
19 * Haiyang Zhang <haiyangz@microsoft.com>
19 * Hank Janssen <hjanssen@microsoft.com> 20 * Hank Janssen <hjanssen@microsoft.com>
20 * 21 *
21 */ 22 */
diff --git a/drivers/staging/hv/Channel.c b/drivers/staging/hv/Channel.c
index d649ee169d95..746370e82115 100644
--- a/drivers/staging/hv/Channel.c
+++ b/drivers/staging/hv/Channel.c
@@ -611,7 +611,7 @@ void VmbusChannelClose(struct vmbus_channel *Channel)
611 611
612 /* Stop callback and cancel the timer asap */ 612 /* Stop callback and cancel the timer asap */
613 Channel->OnChannelCallback = NULL; 613 Channel->OnChannelCallback = NULL;
614 del_timer(&Channel->poll_timer); 614 del_timer_sync(&Channel->poll_timer);
615 615
616 /* Send a closing message */ 616 /* Send a closing message */
617 info = kmalloc(sizeof(*info) + 617 info = kmalloc(sizeof(*info) +
@@ -978,14 +978,10 @@ void VmbusChannelOnChannelEvent(struct vmbus_channel *Channel)
978{ 978{
979 DumpVmbusChannel(Channel); 979 DumpVmbusChannel(Channel);
980 ASSERT(Channel->OnChannelCallback); 980 ASSERT(Channel->OnChannelCallback);
981#ifdef ENABLE_POLLING 981
982 del_timer(&Channel->poll_timer);
983 Channel->OnChannelCallback(Channel->ChannelCallbackContext);
984 channel->poll_timer.expires(jiffies + usecs_to_jiffies(100);
985 add_timer(&channel->poll_timer);
986#else
987 Channel->OnChannelCallback(Channel->ChannelCallbackContext); 982 Channel->OnChannelCallback(Channel->ChannelCallbackContext);
988#endif 983
984 mod_timer(&Channel->poll_timer, jiffies + usecs_to_jiffies(100));
989} 985}
990 986
991/** 987/**
@@ -997,10 +993,6 @@ void VmbusChannelOnTimer(unsigned long data)
997 993
998 if (channel->OnChannelCallback) { 994 if (channel->OnChannelCallback) {
999 channel->OnChannelCallback(channel->ChannelCallbackContext); 995 channel->OnChannelCallback(channel->ChannelCallbackContext);
1000#ifdef ENABLE_POLLING
1001 channel->poll_timer.expires(jiffies + usecs_to_jiffies(100);
1002 add_timer(&channel->poll_timer);
1003#endif
1004 } 996 }
1005} 997}
1006 998
diff --git a/drivers/staging/hv/ChannelMgmt.c b/drivers/staging/hv/ChannelMgmt.c
index 3db62caedcff..ef38467ed4e2 100644
--- a/drivers/staging/hv/ChannelMgmt.c
+++ b/drivers/staging/hv/ChannelMgmt.c
@@ -119,7 +119,7 @@ static inline void ReleaseVmbusChannel(void *context)
119 */ 119 */
120void FreeVmbusChannel(struct vmbus_channel *Channel) 120void FreeVmbusChannel(struct vmbus_channel *Channel)
121{ 121{
122 del_timer(&Channel->poll_timer); 122 del_timer_sync(&Channel->poll_timer);
123 123
124 /* 124 /*
125 * We have to release the channel's workqueue/thread in the vmbus's 125 * We have to release the channel's workqueue/thread in the vmbus's
diff --git a/drivers/staging/hv/NetVsc.c b/drivers/staging/hv/NetVsc.c
index d384c0ddf069..1c717f9a554e 100644
--- a/drivers/staging/hv/NetVsc.c
+++ b/drivers/staging/hv/NetVsc.c
@@ -15,6 +15,7 @@
15 * Place - Suite 330, Boston, MA 02111-1307 USA. 15 * Place - Suite 330, Boston, MA 02111-1307 USA.
16 * 16 *
17 * Authors: 17 * Authors:
18 * Haiyang Zhang <haiyangz@microsoft.com>
18 * Hank Janssen <hjanssen@microsoft.com> 19 * Hank Janssen <hjanssen@microsoft.com>
19 */ 20 */
20#include <linux/kernel.h> 21#include <linux/kernel.h>
diff --git a/drivers/staging/hv/NetVsc.h b/drivers/staging/hv/NetVsc.h
index 3e7112f7c755..6e0e03494126 100644
--- a/drivers/staging/hv/NetVsc.h
+++ b/drivers/staging/hv/NetVsc.h
@@ -16,6 +16,7 @@
16 * Place - Suite 330, Boston, MA 02111-1307 USA. 16 * Place - Suite 330, Boston, MA 02111-1307 USA.
17 * 17 *
18 * Authors: 18 * Authors:
19 * Haiyang Zhang <haiyangz@microsoft.com>
19 * Hank Janssen <hjanssen@microsoft.com> 20 * Hank Janssen <hjanssen@microsoft.com>
20 * 21 *
21 */ 22 */
diff --git a/drivers/staging/hv/StorVsc.c b/drivers/staging/hv/StorVsc.c
index 14015c927940..2f7c425896f7 100644
--- a/drivers/staging/hv/StorVsc.c
+++ b/drivers/staging/hv/StorVsc.c
@@ -196,7 +196,7 @@ static int StorVscChannelInit(struct hv_device *Device)
196 * Now, initiate the vsc/vsp initialization protocol on the open 196 * Now, initiate the vsc/vsp initialization protocol on the open
197 * channel 197 * channel
198 */ 198 */
199 memset(request, sizeof(struct storvsc_request_extension), 0); 199 memset(request, 0, sizeof(struct storvsc_request_extension));
200 request->WaitEvent = osd_WaitEventCreate(); 200 request->WaitEvent = osd_WaitEventCreate();
201 201
202 vstorPacket->Operation = VStorOperationBeginInitialization; 202 vstorPacket->Operation = VStorOperationBeginInitialization;
@@ -233,7 +233,7 @@ static int StorVscChannelInit(struct hv_device *Device)
233 DPRINT_INFO(STORVSC, "QUERY_PROTOCOL_VERSION_OPERATION..."); 233 DPRINT_INFO(STORVSC, "QUERY_PROTOCOL_VERSION_OPERATION...");
234 234
235 /* reuse the packet for version range supported */ 235 /* reuse the packet for version range supported */
236 memset(vstorPacket, sizeof(struct vstor_packet), 0); 236 memset(vstorPacket, 0, sizeof(struct vstor_packet));
237 vstorPacket->Operation = VStorOperationQueryProtocolVersion; 237 vstorPacket->Operation = VStorOperationQueryProtocolVersion;
238 vstorPacket->Flags = REQUEST_COMPLETION_FLAG; 238 vstorPacket->Flags = REQUEST_COMPLETION_FLAG;
239 239
@@ -266,7 +266,7 @@ static int StorVscChannelInit(struct hv_device *Device)
266 /* Query channel properties */ 266 /* Query channel properties */
267 DPRINT_INFO(STORVSC, "QUERY_PROPERTIES_OPERATION..."); 267 DPRINT_INFO(STORVSC, "QUERY_PROPERTIES_OPERATION...");
268 268
269 memset(vstorPacket, sizeof(struct vstor_packet), 0); 269 memset(vstorPacket, 0, sizeof(struct vstor_packet));
270 vstorPacket->Operation = VStorOperationQueryProperties; 270 vstorPacket->Operation = VStorOperationQueryProperties;
271 vstorPacket->Flags = REQUEST_COMPLETION_FLAG; 271 vstorPacket->Flags = REQUEST_COMPLETION_FLAG;
272 vstorPacket->StorageChannelProperties.PortNumber = 272 vstorPacket->StorageChannelProperties.PortNumber =
@@ -305,7 +305,7 @@ static int StorVscChannelInit(struct hv_device *Device)
305 305
306 DPRINT_INFO(STORVSC, "END_INITIALIZATION_OPERATION..."); 306 DPRINT_INFO(STORVSC, "END_INITIALIZATION_OPERATION...");
307 307
308 memset(vstorPacket, sizeof(struct vstor_packet), 0); 308 memset(vstorPacket, 0, sizeof(struct vstor_packet));
309 vstorPacket->Operation = VStorOperationEndInitialization; 309 vstorPacket->Operation = VStorOperationEndInitialization;
310 vstorPacket->Flags = REQUEST_COMPLETION_FLAG; 310 vstorPacket->Flags = REQUEST_COMPLETION_FLAG;
311 311
@@ -508,7 +508,7 @@ static int StorVscConnectToVsp(struct hv_device *Device)
508 int ret; 508 int ret;
509 509
510 storDriver = (struct storvsc_driver_object *)Device->Driver; 510 storDriver = (struct storvsc_driver_object *)Device->Driver;
511 memset(&props, sizeof(struct vmstorage_channel_properties), 0); 511 memset(&props, 0, sizeof(struct vmstorage_channel_properties));
512 512
513 /* Open the channel */ 513 /* Open the channel */
514 ret = Device->Driver->VmbusChannelInterface.Open(Device, 514 ret = Device->Driver->VmbusChannelInterface.Open(Device,
diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c
index 99c49261a8b4..62b282844a53 100644
--- a/drivers/staging/hv/blkvsc_drv.c
+++ b/drivers/staging/hv/blkvsc_drv.c
@@ -15,6 +15,7 @@
15 * Place - Suite 330, Boston, MA 02111-1307 USA. 15 * Place - Suite 330, Boston, MA 02111-1307 USA.
16 * 16 *
17 * Authors: 17 * Authors:
18 * Haiyang Zhang <haiyangz@microsoft.com>
18 * Hank Janssen <hjanssen@microsoft.com> 19 * Hank Janssen <hjanssen@microsoft.com>
19 */ 20 */
20#include <linux/init.h> 21#include <linux/init.h>
diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
index 3192d50f7251..0d7459e2d036 100644
--- a/drivers/staging/hv/netvsc_drv.c
+++ b/drivers/staging/hv/netvsc_drv.c
@@ -15,6 +15,7 @@
15 * Place - Suite 330, Boston, MA 02111-1307 USA. 15 * Place - Suite 330, Boston, MA 02111-1307 USA.
16 * 16 *
17 * Authors: 17 * Authors:
18 * Haiyang Zhang <haiyangz@microsoft.com>
18 * Hank Janssen <hjanssen@microsoft.com> 19 * Hank Janssen <hjanssen@microsoft.com>
19 */ 20 */
20#include <linux/init.h> 21#include <linux/init.h>
diff --git a/drivers/staging/rtl8187se/TODO b/drivers/staging/rtl8187se/TODO
index c09a9160739d..a762e79873e9 100644
--- a/drivers/staging/rtl8187se/TODO
+++ b/drivers/staging/rtl8187se/TODO
@@ -11,5 +11,4 @@ TODO:
11- sparse fixes 11- sparse fixes
12- integrate with drivers/net/wireless/rtl818x 12- integrate with drivers/net/wireless/rtl818x
13 13
14Please send any patches to Greg Kroah-Hartman <greg@kroah.com> and 14Please send any patches to Greg Kroah-Hartman <greg@kroah.com>.
15Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>.
diff --git a/drivers/staging/rtl8192su/TODO b/drivers/staging/rtl8192su/TODO
index b13be9edb278..f11eec700030 100644
--- a/drivers/staging/rtl8192su/TODO
+++ b/drivers/staging/rtl8192su/TODO
@@ -14,5 +14,4 @@ TODO:
14- sparse fixes 14- sparse fixes
15- integrate with drivers/net/wireless/rtl818x 15- integrate with drivers/net/wireless/rtl818x
16 16
17Please send any patches to Greg Kroah-Hartman <greg@kroah.com> and 17Please send any patches to Greg Kroah-Hartman <greg@kroah.com>.
18Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>.
diff --git a/drivers/staging/vt6655/TODO b/drivers/staging/vt6655/TODO
index 8462cd17eb61..cb04aaafc46f 100644
--- a/drivers/staging/vt6655/TODO
+++ b/drivers/staging/vt6655/TODO
@@ -16,6 +16,5 @@ TODO:
16- sparse fixes 16- sparse fixes
17- integrate with drivers/net/wireless 17- integrate with drivers/net/wireless
18 18
19Please send any patches to Greg Kroah-Hartman <greg@kroah.com>, 19Please send any patches to Greg Kroah-Hartman <greg@kroah.com>
20Forest Bond <forest@alittletooquiet.net> and Bartlomiej Zolnierkiewicz 20and Forest Bond <forest@alittletooquiet.net>.
21<bzolnier@gmail.com>.
diff --git a/drivers/staging/vt6656/TODO b/drivers/staging/vt6656/TODO
index 17cf50c6735e..a318995ba07f 100644
--- a/drivers/staging/vt6656/TODO
+++ b/drivers/staging/vt6656/TODO
@@ -15,6 +15,5 @@ TODO:
15- sparse fixes 15- sparse fixes
16- integrate with drivers/net/wireless 16- integrate with drivers/net/wireless
17 17
18Please send any patches to Greg Kroah-Hartman <greg@kroah.com>, 18Please send any patches to Greg Kroah-Hartman <greg@kroah.com>
19Forest Bond <forest@alittletooquiet.net> and Bartlomiej Zolnierkiewicz 19and Forest Bond <forest@alittletooquiet.net>.
20<bzolnier@gmail.com>.
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 5ce839137ad6..0f857e645058 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -444,7 +444,7 @@ resubmit:
444static inline int 444static inline int
445hub_clear_tt_buffer (struct usb_device *hdev, u16 devinfo, u16 tt) 445hub_clear_tt_buffer (struct usb_device *hdev, u16 devinfo, u16 tt)
446{ 446{
447 return usb_control_msg(hdev, usb_rcvctrlpipe(hdev, 0), 447 return usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0),
448 HUB_CLEAR_TT_BUFFER, USB_RT_PORT, devinfo, 448 HUB_CLEAR_TT_BUFFER, USB_RT_PORT, devinfo,
449 tt, NULL, 0, 1000); 449 tt, NULL, 0, 1000);
450} 450}
diff --git a/drivers/usb/gadget/amd5536udc.c b/drivers/usb/gadget/amd5536udc.c
index d5b65962dd36..731150d4b1d9 100644
--- a/drivers/usb/gadget/amd5536udc.c
+++ b/drivers/usb/gadget/amd5536udc.c
@@ -1213,7 +1213,12 @@ udc_queue(struct usb_ep *usbep, struct usb_request *usbreq, gfp_t gfp)
1213 tmp &= AMD_UNMASK_BIT(ep->num); 1213 tmp &= AMD_UNMASK_BIT(ep->num);
1214 writel(tmp, &dev->regs->ep_irqmsk); 1214 writel(tmp, &dev->regs->ep_irqmsk);
1215 } 1215 }
1216 } 1216 } else if (ep->in) {
1217 /* enable ep irq */
1218 tmp = readl(&dev->regs->ep_irqmsk);
1219 tmp &= AMD_UNMASK_BIT(ep->num);
1220 writel(tmp, &dev->regs->ep_irqmsk);
1221 }
1217 1222
1218 } else if (ep->dma) { 1223 } else if (ep->dma) {
1219 1224
@@ -2005,18 +2010,17 @@ __acquires(dev->lock)
2005{ 2010{
2006 int tmp; 2011 int tmp;
2007 2012
2008 /* empty queues and init hardware */
2009 udc_basic_init(dev);
2010 for (tmp = 0; tmp < UDC_EP_NUM; tmp++) {
2011 empty_req_queue(&dev->ep[tmp]);
2012 }
2013
2014 if (dev->gadget.speed != USB_SPEED_UNKNOWN) { 2013 if (dev->gadget.speed != USB_SPEED_UNKNOWN) {
2015 spin_unlock(&dev->lock); 2014 spin_unlock(&dev->lock);
2016 driver->disconnect(&dev->gadget); 2015 driver->disconnect(&dev->gadget);
2017 spin_lock(&dev->lock); 2016 spin_lock(&dev->lock);
2018 } 2017 }
2019 /* init */ 2018
2019 /* empty queues and init hardware */
2020 udc_basic_init(dev);
2021 for (tmp = 0; tmp < UDC_EP_NUM; tmp++)
2022 empty_req_queue(&dev->ep[tmp]);
2023
2020 udc_setup_endpoints(dev); 2024 udc_setup_endpoints(dev);
2021} 2025}
2022 2026
@@ -2472,6 +2476,13 @@ static irqreturn_t udc_data_in_isr(struct udc *dev, int ep_ix)
2472 } 2476 }
2473 } 2477 }
2474 2478
2479 } else if (!use_dma && ep->in) {
2480 /* disable interrupt */
2481 tmp = readl(
2482 &dev->regs->ep_irqmsk);
2483 tmp |= AMD_BIT(ep->num);
2484 writel(tmp,
2485 &dev->regs->ep_irqmsk);
2475 } 2486 }
2476 } 2487 }
2477 /* clear status bits */ 2488 /* clear status bits */
@@ -3279,6 +3290,17 @@ static int udc_pci_probe(
3279 goto finished; 3290 goto finished;
3280 } 3291 }
3281 3292
3293 spin_lock_init(&dev->lock);
3294 /* udc csr registers base */
3295 dev->csr = dev->virt_addr + UDC_CSR_ADDR;
3296 /* dev registers base */
3297 dev->regs = dev->virt_addr + UDC_DEVCFG_ADDR;
3298 /* ep registers base */
3299 dev->ep_regs = dev->virt_addr + UDC_EPREGS_ADDR;
3300 /* fifo's base */
3301 dev->rxfifo = (u32 __iomem *)(dev->virt_addr + UDC_RXFIFO_ADDR);
3302 dev->txfifo = (u32 __iomem *)(dev->virt_addr + UDC_TXFIFO_ADDR);
3303
3282 if (request_irq(pdev->irq, udc_irq, IRQF_SHARED, name, dev) != 0) { 3304 if (request_irq(pdev->irq, udc_irq, IRQF_SHARED, name, dev) != 0) {
3283 dev_dbg(&dev->pdev->dev, "request_irq(%d) fail\n", pdev->irq); 3305 dev_dbg(&dev->pdev->dev, "request_irq(%d) fail\n", pdev->irq);
3284 kfree(dev); 3306 kfree(dev);
@@ -3331,7 +3353,6 @@ static int udc_probe(struct udc *dev)
3331 udc_pollstall_timer.data = 0; 3353 udc_pollstall_timer.data = 0;
3332 3354
3333 /* device struct setup */ 3355 /* device struct setup */
3334 spin_lock_init(&dev->lock);
3335 dev->gadget.ops = &udc_ops; 3356 dev->gadget.ops = &udc_ops;
3336 3357
3337 dev_set_name(&dev->gadget.dev, "gadget"); 3358 dev_set_name(&dev->gadget.dev, "gadget");
@@ -3340,16 +3361,6 @@ static int udc_probe(struct udc *dev)
3340 dev->gadget.name = name; 3361 dev->gadget.name = name;
3341 dev->gadget.is_dualspeed = 1; 3362 dev->gadget.is_dualspeed = 1;
3342 3363
3343 /* udc csr registers base */
3344 dev->csr = dev->virt_addr + UDC_CSR_ADDR;
3345 /* dev registers base */
3346 dev->regs = dev->virt_addr + UDC_DEVCFG_ADDR;
3347 /* ep registers base */
3348 dev->ep_regs = dev->virt_addr + UDC_EPREGS_ADDR;
3349 /* fifo's base */
3350 dev->rxfifo = (u32 __iomem *)(dev->virt_addr + UDC_RXFIFO_ADDR);
3351 dev->txfifo = (u32 __iomem *)(dev->virt_addr + UDC_TXFIFO_ADDR);
3352
3353 /* init registers, interrupts, ... */ 3364 /* init registers, interrupts, ... */
3354 startup_registers(dev); 3365 startup_registers(dev);
3355 3366
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 9835e0713943..f5f5601701c9 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -28,6 +28,7 @@
28#include <linux/errno.h> 28#include <linux/errno.h>
29#include <linux/init.h> 29#include <linux/init.h>
30#include <linux/timer.h> 30#include <linux/timer.h>
31#include <linux/ktime.h>
31#include <linux/list.h> 32#include <linux/list.h>
32#include <linux/interrupt.h> 33#include <linux/interrupt.h>
33#include <linux/usb.h> 34#include <linux/usb.h>
@@ -676,6 +677,7 @@ static int ehci_run (struct usb_hcd *hcd)
676 ehci_readl(ehci, &ehci->regs->command); /* unblock posted writes */ 677 ehci_readl(ehci, &ehci->regs->command); /* unblock posted writes */
677 msleep(5); 678 msleep(5);
678 up_write(&ehci_cf_port_reset_rwsem); 679 up_write(&ehci_cf_port_reset_rwsem);
680 ehci->last_periodic_enable = ktime_get_real();
679 681
680 temp = HC_VERSION(ehci_readl(ehci, &ehci->caps->hc_capbase)); 682 temp = HC_VERSION(ehci_readl(ehci, &ehci->caps->hc_capbase));
681 ehci_info (ehci, 683 ehci_info (ehci,
diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
index 378861b9d79a..ead5f4f2aa5a 100644
--- a/drivers/usb/host/ehci-pci.c
+++ b/drivers/usb/host/ehci-pci.c
@@ -111,6 +111,10 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
111 switch (pdev->vendor) { 111 switch (pdev->vendor) {
112 case PCI_VENDOR_ID_INTEL: 112 case PCI_VENDOR_ID_INTEL:
113 ehci->need_io_watchdog = 0; 113 ehci->need_io_watchdog = 0;
114 if (pdev->device == 0x27cc) {
115 ehci->broken_periodic = 1;
116 ehci_info(ehci, "using broken periodic workaround\n");
117 }
114 break; 118 break;
115 case PCI_VENDOR_ID_TDI: 119 case PCI_VENDOR_ID_TDI:
116 if (pdev->device == PCI_DEVICE_ID_TDI_EHCI) { 120 if (pdev->device == PCI_DEVICE_ID_TDI_EHCI) {
diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c
index 00ad9ce392ed..139a2cc3f641 100644
--- a/drivers/usb/host/ehci-q.c
+++ b/drivers/usb/host/ehci-q.c
@@ -487,8 +487,20 @@ halt:
487 * we must clear the TT buffer (11.17.5). 487 * we must clear the TT buffer (11.17.5).
488 */ 488 */
489 if (unlikely(last_status != -EINPROGRESS && 489 if (unlikely(last_status != -EINPROGRESS &&
490 last_status != -EREMOTEIO)) 490 last_status != -EREMOTEIO)) {
491 ehci_clear_tt_buffer(ehci, qh, urb, token); 491 /* The TT's in some hubs malfunction when they
492 * receive this request following a STALL (they
493 * stop sending isochronous packets). Since a
494 * STALL can't leave the TT buffer in a busy
495 * state (if you believe Figures 11-48 - 11-51
496 * in the USB 2.0 spec), we won't clear the TT
497 * buffer in this case. Strictly speaking this
498 * is a violation of the spec.
499 */
500 if (last_status != -EPIPE)
501 ehci_clear_tt_buffer(ehci, qh, urb,
502 token);
503 }
492 } 504 }
493 505
494 /* if we're removing something not at the queue head, 506 /* if we're removing something not at the queue head,
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
index b25cdea93a1f..a5535b5e3fe2 100644
--- a/drivers/usb/host/ehci-sched.c
+++ b/drivers/usb/host/ehci-sched.c
@@ -475,6 +475,8 @@ static int enable_periodic (struct ehci_hcd *ehci)
475 /* make sure ehci_work scans these */ 475 /* make sure ehci_work scans these */
476 ehci->next_uframe = ehci_readl(ehci, &ehci->regs->frame_index) 476 ehci->next_uframe = ehci_readl(ehci, &ehci->regs->frame_index)
477 % (ehci->periodic_size << 3); 477 % (ehci->periodic_size << 3);
478 if (unlikely(ehci->broken_periodic))
479 ehci->last_periodic_enable = ktime_get_real();
478 return 0; 480 return 0;
479} 481}
480 482
@@ -486,6 +488,16 @@ static int disable_periodic (struct ehci_hcd *ehci)
486 if (--ehci->periodic_sched) 488 if (--ehci->periodic_sched)
487 return 0; 489 return 0;
488 490
491 if (unlikely(ehci->broken_periodic)) {
492 /* delay experimentally determined */
493 ktime_t safe = ktime_add_us(ehci->last_periodic_enable, 1000);
494 ktime_t now = ktime_get_real();
495 s64 delay = ktime_us_delta(safe, now);
496
497 if (unlikely(delay > 0))
498 udelay(delay);
499 }
500
489 /* did setting PSE not take effect yet? 501 /* did setting PSE not take effect yet?
490 * takes effect only at frame boundaries... 502 * takes effect only at frame boundaries...
491 */ 503 */
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index 064e76821ff5..2d85e21ff282 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -118,6 +118,7 @@ struct ehci_hcd { /* one per controller */
118 unsigned stamp; 118 unsigned stamp;
119 unsigned random_frame; 119 unsigned random_frame;
120 unsigned long next_statechange; 120 unsigned long next_statechange;
121 ktime_t last_periodic_enable;
121 u32 command; 122 u32 command;
122 123
123 /* SILICON QUIRKS */ 124 /* SILICON QUIRKS */
@@ -127,6 +128,7 @@ struct ehci_hcd { /* one per controller */
127 unsigned big_endian_desc:1; 128 unsigned big_endian_desc:1;
128 unsigned has_amcc_usb23:1; 129 unsigned has_amcc_usb23:1;
129 unsigned need_io_watchdog:1; 130 unsigned need_io_watchdog:1;
131 unsigned broken_periodic:1;
130 132
131 /* required for usb32 quirk */ 133 /* required for usb32 quirk */
132 #define OHCI_CTRL_HCFS (3 << 6) 134 #define OHCI_CTRL_HCFS (3 << 6)
diff --git a/drivers/usb/musb/cppi_dma.c b/drivers/usb/musb/cppi_dma.c
index c3577bbbae6c..ef2332a9941d 100644
--- a/drivers/usb/musb/cppi_dma.c
+++ b/drivers/usb/musb/cppi_dma.c
@@ -1442,11 +1442,6 @@ static int cppi_channel_abort(struct dma_channel *channel)
1442 musb_writew(regs, MUSB_TXCSR, value); 1442 musb_writew(regs, MUSB_TXCSR, value);
1443 musb_writew(regs, MUSB_TXCSR, value); 1443 musb_writew(regs, MUSB_TXCSR, value);
1444 1444
1445 /* re-enable interrupt */
1446 if (enabled)
1447 musb_writel(tibase, DAVINCI_TXCPPI_INTENAB_REG,
1448 (1 << cppi_ch->index));
1449
1450 /* While we scrub the TX state RAM, ensure that we clean 1445 /* While we scrub the TX state RAM, ensure that we clean
1451 * up any interrupt that's currently asserted: 1446 * up any interrupt that's currently asserted:
1452 * 1. Write to completion Ptr value 0x1(bit 0 set) 1447 * 1. Write to completion Ptr value 0x1(bit 0 set)
@@ -1459,6 +1454,11 @@ static int cppi_channel_abort(struct dma_channel *channel)
1459 cppi_reset_tx(tx_ram, 1); 1454 cppi_reset_tx(tx_ram, 1);
1460 musb_writel(&tx_ram->tx_complete, 0, 0); 1455 musb_writel(&tx_ram->tx_complete, 0, 0);
1461 1456
1457 /* re-enable interrupt */
1458 if (enabled)
1459 musb_writel(tibase, DAVINCI_TXCPPI_INTENAB_REG,
1460 (1 << cppi_ch->index));
1461
1462 cppi_dump_tx(5, cppi_ch, " (done teardown)"); 1462 cppi_dump_tx(5, cppi_ch, " (done teardown)");
1463 1463
1464 /* REVISIT tx side _should_ clean up the same way 1464 /* REVISIT tx side _should_ clean up the same way
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 3a61ddb62bd2..547e0e390726 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -1450,7 +1450,7 @@ static int __init musb_core_init(u16 musb_type, struct musb *musb)
1450#endif 1450#endif
1451 1451
1452 if (hw_ep->max_packet_sz_tx) { 1452 if (hw_ep->max_packet_sz_tx) {
1453 printk(KERN_DEBUG 1453 DBG(1,
1454 "%s: hw_ep %d%s, %smax %d\n", 1454 "%s: hw_ep %d%s, %smax %d\n",
1455 musb_driver_name, i, 1455 musb_driver_name, i,
1456 hw_ep->is_shared_fifo ? "shared" : "tx", 1456 hw_ep->is_shared_fifo ? "shared" : "tx",
@@ -1459,7 +1459,7 @@ static int __init musb_core_init(u16 musb_type, struct musb *musb)
1459 hw_ep->max_packet_sz_tx); 1459 hw_ep->max_packet_sz_tx);
1460 } 1460 }
1461 if (hw_ep->max_packet_sz_rx && !hw_ep->is_shared_fifo) { 1461 if (hw_ep->max_packet_sz_rx && !hw_ep->is_shared_fifo) {
1462 printk(KERN_DEBUG 1462 DBG(1,
1463 "%s: hw_ep %d%s, %smax %d\n", 1463 "%s: hw_ep %d%s, %smax %d\n",
1464 musb_driver_name, i, 1464 musb_driver_name, i,
1465 "rx", 1465 "rx",
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index 8b3c4e2ed7b8..74073f9a43f0 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -4,6 +4,7 @@
4 * Copyright 2005 Mentor Graphics Corporation 4 * Copyright 2005 Mentor Graphics Corporation
5 * Copyright (C) 2005-2006 by Texas Instruments 5 * Copyright (C) 2005-2006 by Texas Instruments
6 * Copyright (C) 2006-2007 Nokia Corporation 6 * Copyright (C) 2006-2007 Nokia Corporation
7 * Copyright (C) 2009 MontaVista Software, Inc. <source@mvista.com>
7 * 8 *
8 * This program is free software; you can redistribute it and/or 9 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License 10 * modify it under the terms of the GNU General Public License
@@ -436,14 +437,6 @@ void musb_g_tx(struct musb *musb, u8 epnum)
436 csr |= MUSB_TXCSR_P_WZC_BITS; 437 csr |= MUSB_TXCSR_P_WZC_BITS;
437 csr &= ~MUSB_TXCSR_P_SENTSTALL; 438 csr &= ~MUSB_TXCSR_P_SENTSTALL;
438 musb_writew(epio, MUSB_TXCSR, csr); 439 musb_writew(epio, MUSB_TXCSR, csr);
439 if (dma_channel_status(dma) == MUSB_DMA_STATUS_BUSY) {
440 dma->status = MUSB_DMA_STATUS_CORE_ABORT;
441 musb->dma_controller->channel_abort(dma);
442 }
443
444 if (request)
445 musb_g_giveback(musb_ep, request, -EPIPE);
446
447 break; 440 break;
448 } 441 }
449 442
@@ -582,15 +575,25 @@ void musb_g_tx(struct musb *musb, u8 epnum)
582 */ 575 */
583static void rxstate(struct musb *musb, struct musb_request *req) 576static void rxstate(struct musb *musb, struct musb_request *req)
584{ 577{
585 u16 csr = 0;
586 const u8 epnum = req->epnum; 578 const u8 epnum = req->epnum;
587 struct usb_request *request = &req->request; 579 struct usb_request *request = &req->request;
588 struct musb_ep *musb_ep = &musb->endpoints[epnum].ep_out; 580 struct musb_ep *musb_ep = &musb->endpoints[epnum].ep_out;
589 void __iomem *epio = musb->endpoints[epnum].regs; 581 void __iomem *epio = musb->endpoints[epnum].regs;
590 unsigned fifo_count = 0; 582 unsigned fifo_count = 0;
591 u16 len = musb_ep->packet_sz; 583 u16 len = musb_ep->packet_sz;
584 u16 csr = musb_readw(epio, MUSB_RXCSR);
592 585
593 csr = musb_readw(epio, MUSB_RXCSR); 586 /* We shouldn't get here while DMA is active, but we do... */
587 if (dma_channel_status(musb_ep->dma) == MUSB_DMA_STATUS_BUSY) {
588 DBG(4, "DMA pending...\n");
589 return;
590 }
591
592 if (csr & MUSB_RXCSR_P_SENDSTALL) {
593 DBG(5, "%s stalling, RXCSR %04x\n",
594 musb_ep->end_point.name, csr);
595 return;
596 }
594 597
595 if (is_cppi_enabled() && musb_ep->dma) { 598 if (is_cppi_enabled() && musb_ep->dma) {
596 struct dma_controller *c = musb->dma_controller; 599 struct dma_controller *c = musb->dma_controller;
@@ -761,19 +764,10 @@ void musb_g_rx(struct musb *musb, u8 epnum)
761 csr, dma ? " (dma)" : "", request); 764 csr, dma ? " (dma)" : "", request);
762 765
763 if (csr & MUSB_RXCSR_P_SENTSTALL) { 766 if (csr & MUSB_RXCSR_P_SENTSTALL) {
764 if (dma_channel_status(dma) == MUSB_DMA_STATUS_BUSY) {
765 dma->status = MUSB_DMA_STATUS_CORE_ABORT;
766 (void) musb->dma_controller->channel_abort(dma);
767 request->actual += musb_ep->dma->actual_len;
768 }
769
770 csr |= MUSB_RXCSR_P_WZC_BITS; 767 csr |= MUSB_RXCSR_P_WZC_BITS;
771 csr &= ~MUSB_RXCSR_P_SENTSTALL; 768 csr &= ~MUSB_RXCSR_P_SENTSTALL;
772 musb_writew(epio, MUSB_RXCSR, csr); 769 musb_writew(epio, MUSB_RXCSR, csr);
773 770 return;
774 if (request)
775 musb_g_giveback(musb_ep, request, -EPIPE);
776 goto done;
777 } 771 }
778 772
779 if (csr & MUSB_RXCSR_P_OVERRUN) { 773 if (csr & MUSB_RXCSR_P_OVERRUN) {
@@ -795,7 +789,7 @@ void musb_g_rx(struct musb *musb, u8 epnum)
795 DBG((csr & MUSB_RXCSR_DMAENAB) ? 4 : 1, 789 DBG((csr & MUSB_RXCSR_DMAENAB) ? 4 : 1,
796 "%s busy, csr %04x\n", 790 "%s busy, csr %04x\n",
797 musb_ep->end_point.name, csr); 791 musb_ep->end_point.name, csr);
798 goto done; 792 return;
799 } 793 }
800 794
801 if (dma && (csr & MUSB_RXCSR_DMAENAB)) { 795 if (dma && (csr & MUSB_RXCSR_DMAENAB)) {
@@ -826,22 +820,15 @@ void musb_g_rx(struct musb *musb, u8 epnum)
826 if ((request->actual < request->length) 820 if ((request->actual < request->length)
827 && (musb_ep->dma->actual_len 821 && (musb_ep->dma->actual_len
828 == musb_ep->packet_sz)) 822 == musb_ep->packet_sz))
829 goto done; 823 return;
830#endif 824#endif
831 musb_g_giveback(musb_ep, request, 0); 825 musb_g_giveback(musb_ep, request, 0);
832 826
833 request = next_request(musb_ep); 827 request = next_request(musb_ep);
834 if (!request) 828 if (!request)
835 goto done; 829 return;
836
837 /* don't start more i/o till the stall clears */
838 musb_ep_select(mbase, epnum);
839 csr = musb_readw(epio, MUSB_RXCSR);
840 if (csr & MUSB_RXCSR_P_SENDSTALL)
841 goto done;
842 } 830 }
843 831
844
845 /* analyze request if the ep is hot */ 832 /* analyze request if the ep is hot */
846 if (request) 833 if (request)
847 rxstate(musb, to_musb_request(request)); 834 rxstate(musb, to_musb_request(request));
@@ -849,8 +836,6 @@ void musb_g_rx(struct musb *musb, u8 epnum)
849 DBG(3, "packet waiting for %s%s request\n", 836 DBG(3, "packet waiting for %s%s request\n",
850 musb_ep->desc ? "" : "inactive ", 837 musb_ep->desc ? "" : "inactive ",
851 musb_ep->end_point.name); 838 musb_ep->end_point.name);
852
853done:
854 return; 839 return;
855} 840}
856 841
@@ -1244,7 +1229,7 @@ int musb_gadget_set_halt(struct usb_ep *ep, int value)
1244 void __iomem *mbase; 1229 void __iomem *mbase;
1245 unsigned long flags; 1230 unsigned long flags;
1246 u16 csr; 1231 u16 csr;
1247 struct musb_request *request = NULL; 1232 struct musb_request *request;
1248 int status = 0; 1233 int status = 0;
1249 1234
1250 if (!ep) 1235 if (!ep)
@@ -1260,24 +1245,29 @@ int musb_gadget_set_halt(struct usb_ep *ep, int value)
1260 1245
1261 musb_ep_select(mbase, epnum); 1246 musb_ep_select(mbase, epnum);
1262 1247
1263 /* cannot portably stall with non-empty FIFO */
1264 request = to_musb_request(next_request(musb_ep)); 1248 request = to_musb_request(next_request(musb_ep));
1265 if (value && musb_ep->is_in) { 1249 if (value) {
1266 csr = musb_readw(epio, MUSB_TXCSR); 1250 if (request) {
1267 if (csr & MUSB_TXCSR_FIFONOTEMPTY) { 1251 DBG(3, "request in progress, cannot halt %s\n",
1268 DBG(3, "%s fifo busy, cannot halt\n", ep->name); 1252 ep->name);
1269 spin_unlock_irqrestore(&musb->lock, flags); 1253 status = -EAGAIN;
1270 return -EAGAIN; 1254 goto done;
1255 }
1256 /* Cannot portably stall with non-empty FIFO */
1257 if (musb_ep->is_in) {
1258 csr = musb_readw(epio, MUSB_TXCSR);
1259 if (csr & MUSB_TXCSR_FIFONOTEMPTY) {
1260 DBG(3, "FIFO busy, cannot halt %s\n", ep->name);
1261 status = -EAGAIN;
1262 goto done;
1263 }
1271 } 1264 }
1272
1273 } 1265 }
1274 1266
1275 /* set/clear the stall and toggle bits */ 1267 /* set/clear the stall and toggle bits */
1276 DBG(2, "%s: %s stall\n", ep->name, value ? "set" : "clear"); 1268 DBG(2, "%s: %s stall\n", ep->name, value ? "set" : "clear");
1277 if (musb_ep->is_in) { 1269 if (musb_ep->is_in) {
1278 csr = musb_readw(epio, MUSB_TXCSR); 1270 csr = musb_readw(epio, MUSB_TXCSR);
1279 if (csr & MUSB_TXCSR_FIFONOTEMPTY)
1280 csr |= MUSB_TXCSR_FLUSHFIFO;
1281 csr |= MUSB_TXCSR_P_WZC_BITS 1271 csr |= MUSB_TXCSR_P_WZC_BITS
1282 | MUSB_TXCSR_CLRDATATOG; 1272 | MUSB_TXCSR_CLRDATATOG;
1283 if (value) 1273 if (value)
@@ -1300,14 +1290,13 @@ int musb_gadget_set_halt(struct usb_ep *ep, int value)
1300 musb_writew(epio, MUSB_RXCSR, csr); 1290 musb_writew(epio, MUSB_RXCSR, csr);
1301 } 1291 }
1302 1292
1303done:
1304
1305 /* maybe start the first request in the queue */ 1293 /* maybe start the first request in the queue */
1306 if (!musb_ep->busy && !value && request) { 1294 if (!musb_ep->busy && !value && request) {
1307 DBG(3, "restarting the request\n"); 1295 DBG(3, "restarting the request\n");
1308 musb_ep_restart(musb, request); 1296 musb_ep_restart(musb, request);
1309 } 1297 }
1310 1298
1299done:
1311 spin_unlock_irqrestore(&musb->lock, flags); 1300 spin_unlock_irqrestore(&musb->lock, flags);
1312 return status; 1301 return status;
1313} 1302}
diff --git a/drivers/usb/musb/musb_gadget_ep0.c b/drivers/usb/musb/musb_gadget_ep0.c
index 7a6778675ad3..522efb31b56b 100644
--- a/drivers/usb/musb/musb_gadget_ep0.c
+++ b/drivers/usb/musb/musb_gadget_ep0.c
@@ -511,7 +511,8 @@ static void ep0_txstate(struct musb *musb)
511 511
512 /* update the flags */ 512 /* update the flags */
513 if (fifo_count < MUSB_MAX_END0_PACKET 513 if (fifo_count < MUSB_MAX_END0_PACKET
514 || request->actual == request->length) { 514 || (request->actual == request->length
515 && !request->zero)) {
515 musb->ep0_state = MUSB_EP0_STAGE_STATUSOUT; 516 musb->ep0_state = MUSB_EP0_STAGE_STATUSOUT;
516 csr |= MUSB_CSR0_P_DATAEND; 517 csr |= MUSB_CSR0_P_DATAEND;
517 } else 518 } else
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
index cf94511485f2..e3ab40a966eb 100644
--- a/drivers/usb/musb/musb_host.c
+++ b/drivers/usb/musb/musb_host.c
@@ -1301,8 +1301,11 @@ void musb_host_tx(struct musb *musb, u8 epnum)
1301 return; 1301 return;
1302 } else if (usb_pipeisoc(pipe) && dma) { 1302 } else if (usb_pipeisoc(pipe) && dma) {
1303 if (musb_tx_dma_program(musb->dma_controller, hw_ep, qh, urb, 1303 if (musb_tx_dma_program(musb->dma_controller, hw_ep, qh, urb,
1304 offset, length)) 1304 offset, length)) {
1305 if (is_cppi_enabled() || tusb_dma_omap())
1306 musb_h_tx_dma_start(hw_ep);
1305 return; 1307 return;
1308 }
1306 } else if (tx_csr & MUSB_TXCSR_DMAENAB) { 1309 } else if (tx_csr & MUSB_TXCSR_DMAENAB) {
1307 DBG(1, "not complete, but DMA enabled?\n"); 1310 DBG(1, "not complete, but DMA enabled?\n");
1308 return; 1311 return;
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 9c60d6d4908a..ebcc6d0e2e91 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -1937,7 +1937,7 @@ static void ftdi_write_bulk_callback(struct urb *urb)
1937 return; 1937 return;
1938 } 1938 }
1939 /* account for transferred data */ 1939 /* account for transferred data */
1940 countback = urb->actual_length; 1940 countback = urb->transfer_buffer_length;
1941 data_offset = priv->write_offset; 1941 data_offset = priv->write_offset;
1942 if (data_offset > 0) { 1942 if (data_offset > 0) {
1943 /* Subtract the control bytes */ 1943 /* Subtract the control bytes */
@@ -1950,7 +1950,6 @@ static void ftdi_write_bulk_callback(struct urb *urb)
1950 1950
1951 if (status) { 1951 if (status) {
1952 dbg("nonzero write bulk status received: %d", status); 1952 dbg("nonzero write bulk status received: %d", status);
1953 return;
1954 } 1953 }
1955 1954
1956 usb_serial_port_softint(port); 1955 usb_serial_port_softint(port);
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 319aaf9725b3..0577e4b61114 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -336,6 +336,10 @@ static int option_resume(struct usb_serial *serial);
336#define AIRPLUS_VENDOR_ID 0x1011 336#define AIRPLUS_VENDOR_ID 0x1011
337#define AIRPLUS_PRODUCT_MCD650 0x3198 337#define AIRPLUS_PRODUCT_MCD650 0x3198
338 338
339/* 4G Systems products */
340#define FOUR_G_SYSTEMS_VENDOR_ID 0x1c9e
341#define FOUR_G_SYSTEMS_PRODUCT_W14 0x9603
342
339static struct usb_device_id option_ids[] = { 343static struct usb_device_id option_ids[] = {
340 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, 344 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
341 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) }, 345 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) },
@@ -599,6 +603,7 @@ static struct usb_device_id option_ids[] = {
599 { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S) }, 603 { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S) },
600 { USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) }, 604 { USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) },
601 { USB_DEVICE(TLAYTECH_VENDOR_ID, TLAYTECH_PRODUCT_TEU800) }, 605 { USB_DEVICE(TLAYTECH_VENDOR_ID, TLAYTECH_PRODUCT_TEU800) },
606 { USB_DEVICE(FOUR_G_SYSTEMS_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W14) },
602 { } /* Terminating entry */ 607 { } /* Terminating entry */
603}; 608};
604MODULE_DEVICE_TABLE(usb, option_ids); 609MODULE_DEVICE_TABLE(usb, option_ids);
diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
index 035d56835b75..ea1fd3f47511 100644
--- a/drivers/video/da8xx-fb.c
+++ b/drivers/video/da8xx-fb.c
@@ -554,11 +554,11 @@ static int fb_check_var(struct fb_var_screeninfo *var,
554 var->transp.length = 0; 554 var->transp.length = 0;
555 break; 555 break;
556 case 16: /* RGB 565 */ 556 case 16: /* RGB 565 */
557 var->red.offset = 0; 557 var->red.offset = 11;
558 var->red.length = 5; 558 var->red.length = 5;
559 var->green.offset = 5; 559 var->green.offset = 5;
560 var->green.length = 6; 560 var->green.length = 6;
561 var->blue.offset = 11; 561 var->blue.offset = 0;
562 var->blue.length = 5; 562 var->blue.length = 5;
563 var->transp.offset = 0; 563 var->transp.offset = 0;
564 var->transp.length = 0; 564 var->transp.length = 0;
@@ -591,7 +591,7 @@ static int __devexit fb_remove(struct platform_device *dev)
591 unregister_framebuffer(info); 591 unregister_framebuffer(info);
592 fb_dealloc_cmap(&info->cmap); 592 fb_dealloc_cmap(&info->cmap);
593 dma_free_coherent(NULL, par->databuf_sz + PAGE_SIZE, 593 dma_free_coherent(NULL, par->databuf_sz + PAGE_SIZE,
594 info->screen_base, 594 info->screen_base - PAGE_SIZE,
595 info->fix.smem_start); 595 info->fix.smem_start);
596 free_irq(par->irq, par); 596 free_irq(par->irq, par);
597 clk_disable(par->lcdc_clk); 597 clk_disable(par->lcdc_clk);
@@ -749,6 +749,7 @@ static int __init fb_probe(struct platform_device *device)
749 (PAGE_SIZE - par->palette_sz); 749 (PAGE_SIZE - par->palette_sz);
750 750
751 /* the rest of the frame buffer is pixel data */ 751 /* the rest of the frame buffer is pixel data */
752 da8xx_fb_info->screen_base = par->v_palette_base + par->palette_sz;
752 da8xx_fb_fix.smem_start = par->p_palette_base + par->palette_sz; 753 da8xx_fb_fix.smem_start = par->p_palette_base + par->palette_sz;
753 da8xx_fb_fix.smem_len = par->databuf_sz - par->palette_sz; 754 da8xx_fb_fix.smem_len = par->databuf_sz - par->palette_sz;
754 da8xx_fb_fix.line_length = (lcdc_info->width * lcd_cfg->bpp) / 8; 755 da8xx_fb_fix.line_length = (lcdc_info->width * lcd_cfg->bpp) / 8;
@@ -787,6 +788,8 @@ static int __init fb_probe(struct platform_device *device)
787 da8xx_fb_info->var = da8xx_fb_var; 788 da8xx_fb_info->var = da8xx_fb_var;
788 da8xx_fb_info->fbops = &da8xx_fb_ops; 789 da8xx_fb_info->fbops = &da8xx_fb_ops;
789 da8xx_fb_info->pseudo_palette = par->pseudo_palette; 790 da8xx_fb_info->pseudo_palette = par->pseudo_palette;
791 da8xx_fb_info->fix.visual = (da8xx_fb_info->var.bits_per_pixel <= 8) ?
792 FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR;
790 793
791 ret = fb_alloc_cmap(&da8xx_fb_info->cmap, PALETTE_SIZE, 0); 794 ret = fb_alloc_cmap(&da8xx_fb_info->cmap, PALETTE_SIZE, 0);
792 if (ret) 795 if (ret)
@@ -825,7 +828,7 @@ err_free_irq:
825 828
826err_release_fb_mem: 829err_release_fb_mem:
827 dma_free_coherent(NULL, par->databuf_sz + PAGE_SIZE, 830 dma_free_coherent(NULL, par->databuf_sz + PAGE_SIZE,
828 da8xx_fb_info->screen_base, 831 da8xx_fb_info->screen_base - PAGE_SIZE,
829 da8xx_fb_info->fix.smem_start); 832 da8xx_fb_info->fix.smem_start);
830 833
831err_release_fb: 834err_release_fb:
diff --git a/drivers/watchdog/rc32434_wdt.c b/drivers/watchdog/rc32434_wdt.c
index f6cccc9df022..bf12d06b5877 100644
--- a/drivers/watchdog/rc32434_wdt.c
+++ b/drivers/watchdog/rc32434_wdt.c
@@ -62,7 +62,7 @@ extern unsigned int idt_cpu_freq;
62static int timeout = WATCHDOG_TIMEOUT; 62static int timeout = WATCHDOG_TIMEOUT;
63module_param(timeout, int, 0); 63module_param(timeout, int, 0);
64MODULE_PARM_DESC(timeout, "Watchdog timeout value, in seconds (default=" 64MODULE_PARM_DESC(timeout, "Watchdog timeout value, in seconds (default="
65 WATCHDOG_TIMEOUT ")"); 65 __MODULE_STRING(WATCHDOG_TIMEOUT) ")");
66 66
67static int nowayout = WATCHDOG_NOWAYOUT; 67static int nowayout = WATCHDOG_NOWAYOUT;
68module_param(nowayout, int, 0); 68module_param(nowayout, int, 0);
@@ -276,7 +276,7 @@ static int __devinit rc32434_wdt_probe(struct platform_device *pdev)
276 return -ENODEV; 276 return -ENODEV;
277 } 277 }
278 278
279 wdt_reg = ioremap_nocache(r->start, r->end - r->start); 279 wdt_reg = ioremap_nocache(r->start, resource_size(r));
280 if (!wdt_reg) { 280 if (!wdt_reg) {
281 printk(KERN_ERR PFX "failed to remap I/O resources\n"); 281 printk(KERN_ERR PFX "failed to remap I/O resources\n");
282 return -ENXIO; 282 return -ENXIO;
diff --git a/fs/9p/cache.c b/fs/9p/cache.c
index bcc5357a9069..e777961939f3 100644
--- a/fs/9p/cache.c
+++ b/fs/9p/cache.c
@@ -343,7 +343,7 @@ int __v9fs_fscache_release_page(struct page *page, gfp_t gfp)
343 343
344 BUG_ON(!vcookie->fscache); 344 BUG_ON(!vcookie->fscache);
345 345
346 return fscache_maybe_release_page(vnode->cache, page, gfp); 346 return fscache_maybe_release_page(vcookie->fscache, page, gfp);
347} 347}
348 348
349void __v9fs_fscache_invalidate_page(struct page *page) 349void __v9fs_fscache_invalidate_page(struct page *page)
diff --git a/fs/cachefiles/rdwr.c b/fs/cachefiles/rdwr.c
index 1d8332563863..a6c8c6fe8df9 100644
--- a/fs/cachefiles/rdwr.c
+++ b/fs/cachefiles/rdwr.c
@@ -11,6 +11,7 @@
11 11
12#include <linux/mount.h> 12#include <linux/mount.h>
13#include <linux/file.h> 13#include <linux/file.h>
14#include <linux/ima.h>
14#include "internal.h" 15#include "internal.h"
15 16
16/* 17/*
@@ -922,6 +923,7 @@ int cachefiles_write_page(struct fscache_storage *op, struct page *page)
922 if (IS_ERR(file)) { 923 if (IS_ERR(file)) {
923 ret = PTR_ERR(file); 924 ret = PTR_ERR(file);
924 } else { 925 } else {
926 ima_counts_get(file);
925 ret = -EIO; 927 ret = -EIO;
926 if (file->f_op->write) { 928 if (file->f_op->write) {
927 pos = (loff_t) page->index << PAGE_SHIFT; 929 pos = (loff_t) page->index << PAGE_SHIFT;
diff --git a/include/linux/slow-work.h b/include/linux/slow-work.h
index 5035a2691739..13337bf6c3f5 100644
--- a/include/linux/slow-work.h
+++ b/include/linux/slow-work.h
@@ -20,7 +20,7 @@
20#include <linux/timer.h> 20#include <linux/timer.h>
21 21
22struct slow_work; 22struct slow_work;
23#ifdef CONFIG_SLOW_WORK_PROC 23#ifdef CONFIG_SLOW_WORK_DEBUG
24struct seq_file; 24struct seq_file;
25#endif 25#endif
26 26
@@ -42,8 +42,8 @@ struct slow_work_ops {
42 /* execute a work item */ 42 /* execute a work item */
43 void (*execute)(struct slow_work *work); 43 void (*execute)(struct slow_work *work);
44 44
45#ifdef CONFIG_SLOW_WORK_PROC 45#ifdef CONFIG_SLOW_WORK_DEBUG
46 /* describe a work item for /proc */ 46 /* describe a work item for debugfs */
47 void (*desc)(struct slow_work *work, struct seq_file *m); 47 void (*desc)(struct slow_work *work, struct seq_file *m);
48#endif 48#endif
49}; 49};
@@ -64,7 +64,7 @@ struct slow_work {
64#define SLOW_WORK_DELAYED 5 /* item is struct delayed_slow_work with active timer */ 64#define SLOW_WORK_DELAYED 5 /* item is struct delayed_slow_work with active timer */
65 const struct slow_work_ops *ops; /* operations table for this item */ 65 const struct slow_work_ops *ops; /* operations table for this item */
66 struct list_head link; /* link in queue */ 66 struct list_head link; /* link in queue */
67#ifdef CONFIG_SLOW_WORK_PROC 67#ifdef CONFIG_SLOW_WORK_DEBUG
68 struct timespec mark; /* jiffies at which queued or exec begun */ 68 struct timespec mark; /* jiffies at which queued or exec begun */
69#endif 69#endif
70}; 70};
diff --git a/init/Kconfig b/init/Kconfig
index ab5c64801fe5..eb4b33725db1 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -606,7 +606,7 @@ config SYSFS_DEPRECATED
606 bool 606 bool
607 607
608config SYSFS_DEPRECATED_V2 608config SYSFS_DEPRECATED_V2
609 bool "remove sysfs features which may confuse old userspace tools" 609 bool "enable deprecated sysfs features which may confuse old userspace tools"
610 depends on SYSFS 610 depends on SYSFS
611 default n 611 default n
612 select SYSFS_DEPRECATED 612 select SYSFS_DEPRECATED
@@ -1098,12 +1098,12 @@ config SLOW_WORK
1098 1098
1099 See Documentation/slow-work.txt. 1099 See Documentation/slow-work.txt.
1100 1100
1101config SLOW_WORK_PROC 1101config SLOW_WORK_DEBUG
1102 bool "Slow work debugging through /proc" 1102 bool "Slow work debugging through debugfs"
1103 default n 1103 default n
1104 depends on SLOW_WORK && PROC_FS 1104 depends on SLOW_WORK && DEBUG_FS
1105 help 1105 help
1106 Display the contents of the slow work run queue through /proc, 1106 Display the contents of the slow work run queue through debugfs,
1107 including items currently executing. 1107 including items currently executing.
1108 1108
1109 See Documentation/slow-work.txt. 1109 See Documentation/slow-work.txt.
diff --git a/init/main.c b/init/main.c
index 5988debfc505..4051d75dd2d6 100644
--- a/init/main.c
+++ b/init/main.c
@@ -251,7 +251,7 @@ early_param("loglevel", loglevel);
251 251
252/* 252/*
253 * Unknown boot options get handed to init, unless they look like 253 * Unknown boot options get handed to init, unless they look like
254 * failed parameters 254 * unused parameters (modprobe will find them in /proc/cmdline).
255 */ 255 */
256static int __init unknown_bootoption(char *param, char *val) 256static int __init unknown_bootoption(char *param, char *val)
257{ 257{
@@ -272,14 +272,9 @@ static int __init unknown_bootoption(char *param, char *val)
272 if (obsolete_checksetup(param)) 272 if (obsolete_checksetup(param))
273 return 0; 273 return 0;
274 274
275 /* 275 /* Unused module parameter. */
276 * Preemptive maintenance for "why didn't my misspelled command 276 if (strchr(param, '.') && (!val || strchr(param, '.') < val))
277 * line work?"
278 */
279 if (strchr(param, '.') && (!val || strchr(param, '.') < val)) {
280 printk(KERN_ERR "Unknown boot option `%s': ignoring\n", param);
281 return 0; 277 return 0;
282 }
283 278
284 if (panic_later) 279 if (panic_later)
285 return 0; 280 return 0;
diff --git a/kernel/Makefile b/kernel/Makefile
index 776ffed1556d..d7c13d249b2d 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -94,7 +94,7 @@ obj-$(CONFIG_X86_DS) += trace/
94obj-$(CONFIG_RING_BUFFER) += trace/ 94obj-$(CONFIG_RING_BUFFER) += trace/
95obj-$(CONFIG_SMP) += sched_cpupri.o 95obj-$(CONFIG_SMP) += sched_cpupri.o
96obj-$(CONFIG_SLOW_WORK) += slow-work.o 96obj-$(CONFIG_SLOW_WORK) += slow-work.o
97obj-$(CONFIG_SLOW_WORK_PROC) += slow-work-proc.o 97obj-$(CONFIG_SLOW_WORK_DEBUG) += slow-work-debugfs.o
98obj-$(CONFIG_PERF_EVENTS) += perf_event.o 98obj-$(CONFIG_PERF_EVENTS) += perf_event.o
99 99
100ifneq ($(CONFIG_SCHED_OMIT_FRAME_POINTER),y) 100ifneq ($(CONFIG_SCHED_OMIT_FRAME_POINTER),y)
diff --git a/kernel/module.c b/kernel/module.c
index 8b7d8805819d..5842a71cf052 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1187,7 +1187,8 @@ static void add_sect_attrs(struct module *mod, unsigned int nsect,
1187 1187
1188 /* Count loaded sections and allocate structures */ 1188 /* Count loaded sections and allocate structures */
1189 for (i = 0; i < nsect; i++) 1189 for (i = 0; i < nsect; i++)
1190 if (sechdrs[i].sh_flags & SHF_ALLOC) 1190 if (sechdrs[i].sh_flags & SHF_ALLOC
1191 && sechdrs[i].sh_size)
1191 nloaded++; 1192 nloaded++;
1192 size[0] = ALIGN(sizeof(*sect_attrs) 1193 size[0] = ALIGN(sizeof(*sect_attrs)
1193 + nloaded * sizeof(sect_attrs->attrs[0]), 1194 + nloaded * sizeof(sect_attrs->attrs[0]),
@@ -1207,6 +1208,8 @@ static void add_sect_attrs(struct module *mod, unsigned int nsect,
1207 for (i = 0; i < nsect; i++) { 1208 for (i = 0; i < nsect; i++) {
1208 if (! (sechdrs[i].sh_flags & SHF_ALLOC)) 1209 if (! (sechdrs[i].sh_flags & SHF_ALLOC))
1209 continue; 1210 continue;
1211 if (!sechdrs[i].sh_size)
1212 continue;
1210 sattr->address = sechdrs[i].sh_addr; 1213 sattr->address = sechdrs[i].sh_addr;
1211 sattr->name = kstrdup(secstrings + sechdrs[i].sh_name, 1214 sattr->name = kstrdup(secstrings + sechdrs[i].sh_name,
1212 GFP_KERNEL); 1215 GFP_KERNEL);
diff --git a/kernel/slow-work-proc.c b/kernel/slow-work-debugfs.c
index 3988032571f5..e45c43645298 100644
--- a/kernel/slow-work-proc.c
+++ b/kernel/slow-work-debugfs.c
@@ -57,7 +57,7 @@ static void slow_work_print_mark(struct seq_file *m, struct slow_work *work)
57} 57}
58 58
59/* 59/*
60 * Describe a slow work item for /proc 60 * Describe a slow work item for debugfs
61 */ 61 */
62static int slow_work_runqueue_show(struct seq_file *m, void *v) 62static int slow_work_runqueue_show(struct seq_file *m, void *v)
63{ 63{
@@ -211,7 +211,7 @@ static const struct seq_operations slow_work_runqueue_ops = {
211}; 211};
212 212
213/* 213/*
214 * open "/proc/slow_work_rq" to list queue contents 214 * open "/sys/kernel/debug/slow_work/runqueue" to list queue contents
215 */ 215 */
216static int slow_work_runqueue_open(struct inode *inode, struct file *file) 216static int slow_work_runqueue_open(struct inode *inode, struct file *file)
217{ 217{
diff --git a/kernel/slow-work.c b/kernel/slow-work.c
index da94f3c101af..00889bd3c590 100644
--- a/kernel/slow-work.c
+++ b/kernel/slow-work.c
@@ -16,7 +16,7 @@
16#include <linux/kthread.h> 16#include <linux/kthread.h>
17#include <linux/freezer.h> 17#include <linux/freezer.h>
18#include <linux/wait.h> 18#include <linux/wait.h>
19#include <linux/proc_fs.h> 19#include <linux/debugfs.h>
20#include "slow-work.h" 20#include "slow-work.h"
21 21
22static void slow_work_cull_timeout(unsigned long); 22static void slow_work_cull_timeout(unsigned long);
@@ -109,12 +109,36 @@ static struct module *slow_work_unreg_module;
109static struct slow_work *slow_work_unreg_work_item; 109static struct slow_work *slow_work_unreg_work_item;
110static DECLARE_WAIT_QUEUE_HEAD(slow_work_unreg_wq); 110static DECLARE_WAIT_QUEUE_HEAD(slow_work_unreg_wq);
111static DEFINE_MUTEX(slow_work_unreg_sync_lock); 111static DEFINE_MUTEX(slow_work_unreg_sync_lock);
112
113static void slow_work_set_thread_processing(int id, struct slow_work *work)
114{
115 if (work)
116 slow_work_thread_processing[id] = work->owner;
117}
118static void slow_work_done_thread_processing(int id, struct slow_work *work)
119{
120 struct module *module = slow_work_thread_processing[id];
121
122 slow_work_thread_processing[id] = NULL;
123 smp_mb();
124 if (slow_work_unreg_work_item == work ||
125 slow_work_unreg_module == module)
126 wake_up_all(&slow_work_unreg_wq);
127}
128static void slow_work_clear_thread_processing(int id)
129{
130 slow_work_thread_processing[id] = NULL;
131}
132#else
133static void slow_work_set_thread_processing(int id, struct slow_work *work) {}
134static void slow_work_done_thread_processing(int id, struct slow_work *work) {}
135static void slow_work_clear_thread_processing(int id) {}
112#endif 136#endif
113 137
114/* 138/*
115 * Data for tracking currently executing items for indication through /proc 139 * Data for tracking currently executing items for indication through /proc
116 */ 140 */
117#ifdef CONFIG_SLOW_WORK_PROC 141#ifdef CONFIG_SLOW_WORK_DEBUG
118struct slow_work *slow_work_execs[SLOW_WORK_THREAD_LIMIT]; 142struct slow_work *slow_work_execs[SLOW_WORK_THREAD_LIMIT];
119pid_t slow_work_pids[SLOW_WORK_THREAD_LIMIT]; 143pid_t slow_work_pids[SLOW_WORK_THREAD_LIMIT];
120DEFINE_RWLOCK(slow_work_execs_lock); 144DEFINE_RWLOCK(slow_work_execs_lock);
@@ -197,9 +221,6 @@ static unsigned slow_work_calc_vsmax(void)
197 */ 221 */
198static noinline bool slow_work_execute(int id) 222static noinline bool slow_work_execute(int id)
199{ 223{
200#ifdef CONFIG_MODULES
201 struct module *module;
202#endif
203 struct slow_work *work = NULL; 224 struct slow_work *work = NULL;
204 unsigned vsmax; 225 unsigned vsmax;
205 bool very_slow; 226 bool very_slow;
@@ -236,10 +257,7 @@ static noinline bool slow_work_execute(int id)
236 very_slow = false; /* avoid the compiler warning */ 257 very_slow = false; /* avoid the compiler warning */
237 } 258 }
238 259
239#ifdef CONFIG_MODULES 260 slow_work_set_thread_processing(id, work);
240 if (work)
241 slow_work_thread_processing[id] = work->owner;
242#endif
243 if (work) { 261 if (work) {
244 slow_work_mark_time(work); 262 slow_work_mark_time(work);
245 slow_work_begin_exec(id, work); 263 slow_work_begin_exec(id, work);
@@ -287,15 +305,7 @@ static noinline bool slow_work_execute(int id)
287 305
288 /* sort out the race between module unloading and put_ref() */ 306 /* sort out the race between module unloading and put_ref() */
289 slow_work_put_ref(work); 307 slow_work_put_ref(work);
290 308 slow_work_done_thread_processing(id, work);
291#ifdef CONFIG_MODULES
292 module = slow_work_thread_processing[id];
293 slow_work_thread_processing[id] = NULL;
294 smp_mb();
295 if (slow_work_unreg_work_item == work ||
296 slow_work_unreg_module == module)
297 wake_up_all(&slow_work_unreg_wq);
298#endif
299 309
300 return true; 310 return true;
301 311
@@ -310,7 +320,7 @@ auto_requeue:
310 else 320 else
311 list_add_tail(&work->link, &slow_work_queue); 321 list_add_tail(&work->link, &slow_work_queue);
312 spin_unlock_irq(&slow_work_queue_lock); 322 spin_unlock_irq(&slow_work_queue_lock);
313 slow_work_thread_processing[id] = NULL; 323 slow_work_clear_thread_processing(id);
314 return true; 324 return true;
315} 325}
316 326
@@ -813,7 +823,7 @@ static void slow_work_new_thread_execute(struct slow_work *work)
813static const struct slow_work_ops slow_work_new_thread_ops = { 823static const struct slow_work_ops slow_work_new_thread_ops = {
814 .owner = THIS_MODULE, 824 .owner = THIS_MODULE,
815 .execute = slow_work_new_thread_execute, 825 .execute = slow_work_new_thread_execute,
816#ifdef CONFIG_SLOW_WORK_PROC 826#ifdef CONFIG_SLOW_WORK_DEBUG
817 .desc = slow_work_new_thread_desc, 827 .desc = slow_work_new_thread_desc,
818#endif 828#endif
819}; 829};
@@ -943,6 +953,7 @@ EXPORT_SYMBOL(slow_work_register_user);
943 */ 953 */
944static void slow_work_wait_for_items(struct module *module) 954static void slow_work_wait_for_items(struct module *module)
945{ 955{
956#ifdef CONFIG_MODULES
946 DECLARE_WAITQUEUE(myself, current); 957 DECLARE_WAITQUEUE(myself, current);
947 struct slow_work *work; 958 struct slow_work *work;
948 int loop; 959 int loop;
@@ -989,6 +1000,7 @@ static void slow_work_wait_for_items(struct module *module)
989 1000
990 remove_wait_queue(&slow_work_unreg_wq, &myself); 1001 remove_wait_queue(&slow_work_unreg_wq, &myself);
991 mutex_unlock(&slow_work_unreg_sync_lock); 1002 mutex_unlock(&slow_work_unreg_sync_lock);
1003#endif /* CONFIG_MODULES */
992} 1004}
993 1005
994/** 1006/**
@@ -1043,9 +1055,15 @@ static int __init init_slow_work(void)
1043 if (slow_work_max_max_threads < nr_cpus * 2) 1055 if (slow_work_max_max_threads < nr_cpus * 2)
1044 slow_work_max_max_threads = nr_cpus * 2; 1056 slow_work_max_max_threads = nr_cpus * 2;
1045#endif 1057#endif
1046#ifdef CONFIG_SLOW_WORK_PROC 1058#ifdef CONFIG_SLOW_WORK_DEBUG
1047 proc_create("slow_work_rq", S_IFREG | 0400, NULL, 1059 {
1048 &slow_work_runqueue_fops); 1060 struct dentry *dbdir;
1061
1062 dbdir = debugfs_create_dir("slow_work", NULL);
1063 if (dbdir && !IS_ERR(dbdir))
1064 debugfs_create_file("runqueue", S_IFREG | 0400, dbdir,
1065 NULL, &slow_work_runqueue_fops);
1066 }
1049#endif 1067#endif
1050 return 0; 1068 return 0;
1051} 1069}
diff --git a/kernel/slow-work.h b/kernel/slow-work.h
index 3c2f007f3ad6..321f3c59d732 100644
--- a/kernel/slow-work.h
+++ b/kernel/slow-work.h
@@ -19,7 +19,7 @@
19/* 19/*
20 * slow-work.c 20 * slow-work.c
21 */ 21 */
22#ifdef CONFIG_SLOW_WORK_PROC 22#ifdef CONFIG_SLOW_WORK_DEBUG
23extern struct slow_work *slow_work_execs[]; 23extern struct slow_work *slow_work_execs[];
24extern pid_t slow_work_pids[]; 24extern pid_t slow_work_pids[];
25extern rwlock_t slow_work_execs_lock; 25extern rwlock_t slow_work_execs_lock;
@@ -30,9 +30,9 @@ extern struct list_head vslow_work_queue;
30extern spinlock_t slow_work_queue_lock; 30extern spinlock_t slow_work_queue_lock;
31 31
32/* 32/*
33 * slow-work-proc.c 33 * slow-work-debugfs.c
34 */ 34 */
35#ifdef CONFIG_SLOW_WORK_PROC 35#ifdef CONFIG_SLOW_WORK_DEBUG
36extern const struct file_operations slow_work_runqueue_fops; 36extern const struct file_operations slow_work_runqueue_fops;
37 37
38extern void slow_work_new_thread_desc(struct slow_work *, struct seq_file *); 38extern void slow_work_new_thread_desc(struct slow_work *, struct seq_file *);