aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/boot/compressed/Makefile6
-rw-r--r--arch/arm/boot/compressed/decompress.c45
-rw-r--r--arch/arm/boot/compressed/misc.c109
-rw-r--r--arch/arm/boot/compressed/vmlinux.lds.in8
-rw-r--r--arch/arm/include/asm/dma.h6
-rw-r--r--arch/arm/include/asm/system.h2
-rw-r--r--arch/arm/include/asm/tlb.h13
-rw-r--r--arch/arm/kernel/dma.c2
-rw-r--r--arch/arm/kernel/entry-common.S3
-rw-r--r--arch/arm/kernel/process.c6
-rw-r--r--arch/arm/kernel/signal.c8
-rw-r--r--arch/arm/kernel/smp.c6
-rw-r--r--arch/arm/kernel/time.c12
-rw-r--r--arch/arm/kernel/traps.c20
-rw-r--r--arch/arm/mach-at91/at91rm9200_time.c2
-rw-r--r--arch/arm/mach-at91/at91sam926x_time.c6
-rw-r--r--arch/arm/mach-at91/gpio.c8
-rw-r--r--arch/arm/mach-bcmring/dma.c6
-rw-r--r--arch/arm/mach-footbridge/include/mach/hardware.h2
-rw-r--r--arch/arm/mach-footbridge/netwinder-hw.c14
-rw-r--r--arch/arm/mach-footbridge/netwinder-leds.c10
-rw-r--r--arch/arm/mach-integrator/core.c6
-rw-r--r--arch/arm/mach-integrator/pci_v3.c14
-rw-r--r--arch/arm/mach-ixp2000/core.c2
-rw-r--r--arch/arm/mach-ixp4xx/common-pci.c22
-rw-r--r--arch/arm/mach-msm/proc_comm.c1
-rw-r--r--arch/arm/mach-sa1100/badge4.c11
-rw-r--r--arch/arm/mach-shark/leds.c6
-rw-r--r--arch/arm/mm/cache-l2x0.c30
-rw-r--r--arch/arm/mm/context.c6
-rw-r--r--arch/arm/mm/copypage-v4mc.c6
-rw-r--r--arch/arm/mm/copypage-v6.c10
-rw-r--r--arch/arm/mm/copypage-xscale.c6
-rw-r--r--arch/arm/mm/fault.c2
-rw-r--r--arch/arm/mm/mmu.c2
-rw-r--r--arch/arm/oprofile/common.c4
-rw-r--r--arch/arm/oprofile/op_model_xscale.c3
-rw-r--r--arch/arm/plat-omap/clock.c3
38 files changed, 206 insertions, 222 deletions
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index 2d4d88ba73bf..97c89e7de7d3 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -5,7 +5,7 @@
5# 5#
6 6
7HEAD = head.o 7HEAD = head.o
8OBJS = misc.o 8OBJS = misc.o decompress.o
9FONTC = $(srctree)/drivers/video/console/font_acorn_8x8.c 9FONTC = $(srctree)/drivers/video/console/font_acorn_8x8.c
10 10
11# 11#
@@ -106,10 +106,6 @@ lib1funcs = $(obj)/lib1funcs.o
106$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE 106$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE
107 $(call cmd,shipped) 107 $(call cmd,shipped)
108 108
109# Don't allow any static data in misc.o, which
110# would otherwise mess up our GOT table
111CFLAGS_misc.o := -Dstatic=
112
113$(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.$(suffix_y).o \ 109$(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.$(suffix_y).o \
114 $(addprefix $(obj)/, $(OBJS)) $(lib1funcs) FORCE 110 $(addprefix $(obj)/, $(OBJS)) $(lib1funcs) FORCE
115 $(call if_changed,ld) 111 $(call if_changed,ld)
diff --git a/arch/arm/boot/compressed/decompress.c b/arch/arm/boot/compressed/decompress.c
new file mode 100644
index 000000000000..0da382f33157
--- /dev/null
+++ b/arch/arm/boot/compressed/decompress.c
@@ -0,0 +1,45 @@
1#define _LINUX_STRING_H_
2
3#include <linux/compiler.h> /* for inline */
4#include <linux/types.h> /* for size_t */
5#include <linux/stddef.h> /* for NULL */
6#include <linux/linkage.h>
7#include <asm/string.h>
8
9extern unsigned long free_mem_ptr;
10extern unsigned long free_mem_end_ptr;
11extern void error(char *);
12
13#define STATIC static
14
15#define ARCH_HAS_DECOMP_WDOG
16
17/* Diagnostic functions */
18#ifdef DEBUG
19# define Assert(cond,msg) {if(!(cond)) error(msg);}
20# define Trace(x) fprintf x
21# define Tracev(x) {if (verbose) fprintf x ;}
22# define Tracevv(x) {if (verbose>1) fprintf x ;}
23# define Tracec(c,x) {if (verbose && (c)) fprintf x ;}
24# define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;}
25#else
26# define Assert(cond,msg)
27# define Trace(x)
28# define Tracev(x)
29# define Tracevv(x)
30# define Tracec(c,x)
31# define Tracecv(c,x)
32#endif
33
34#ifdef CONFIG_KERNEL_GZIP
35#include "../../../../lib/decompress_inflate.c"
36#endif
37
38#ifdef CONFIG_KERNEL_LZO
39#include "../../../../lib/decompress_unlzo.c"
40#endif
41
42void do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x))
43{
44 decompress(input, len, NULL, NULL, output, NULL, error);
45}
diff --git a/arch/arm/boot/compressed/misc.c b/arch/arm/boot/compressed/misc.c
index 56a0d116d271..d32bc71c1f78 100644
--- a/arch/arm/boot/compressed/misc.c
+++ b/arch/arm/boot/compressed/misc.c
@@ -23,8 +23,8 @@ unsigned int __machine_arch_type;
23#include <linux/compiler.h> /* for inline */ 23#include <linux/compiler.h> /* for inline */
24#include <linux/types.h> /* for size_t */ 24#include <linux/types.h> /* for size_t */
25#include <linux/stddef.h> /* for NULL */ 25#include <linux/stddef.h> /* for NULL */
26#include <asm/string.h>
27#include <linux/linkage.h> 26#include <linux/linkage.h>
27#include <asm/string.h>
28 28
29#include <asm/unaligned.h> 29#include <asm/unaligned.h>
30 30
@@ -117,57 +117,7 @@ static void putstr(const char *ptr)
117 117
118#endif 118#endif
119 119
120#define __ptr_t void * 120void *memcpy(void *__dest, __const void *__src, size_t __n)
121
122#define memzero(s,n) __memzero(s,n)
123
124/*
125 * Optimised C version of memzero for the ARM.
126 */
127void __memzero (__ptr_t s, size_t n)
128{
129 union { void *vp; unsigned long *ulp; unsigned char *ucp; } u;
130 int i;
131
132 u.vp = s;
133
134 for (i = n >> 5; i > 0; i--) {
135 *u.ulp++ = 0;
136 *u.ulp++ = 0;
137 *u.ulp++ = 0;
138 *u.ulp++ = 0;
139 *u.ulp++ = 0;
140 *u.ulp++ = 0;
141 *u.ulp++ = 0;
142 *u.ulp++ = 0;
143 }
144
145 if (n & 1 << 4) {
146 *u.ulp++ = 0;
147 *u.ulp++ = 0;
148 *u.ulp++ = 0;
149 *u.ulp++ = 0;
150 }
151
152 if (n & 1 << 3) {
153 *u.ulp++ = 0;
154 *u.ulp++ = 0;
155 }
156
157 if (n & 1 << 2)
158 *u.ulp++ = 0;
159
160 if (n & 1 << 1) {
161 *u.ucp++ = 0;
162 *u.ucp++ = 0;
163 }
164
165 if (n & 1)
166 *u.ucp++ = 0;
167}
168
169static inline __ptr_t memcpy(__ptr_t __dest, __const __ptr_t __src,
170 size_t __n)
171{ 121{
172 int i = 0; 122 int i = 0;
173 unsigned char *d = (unsigned char *)__dest, *s = (unsigned char *)__src; 123 unsigned char *d = (unsigned char *)__dest, *s = (unsigned char *)__src;
@@ -204,59 +154,20 @@ static inline __ptr_t memcpy(__ptr_t __dest, __const __ptr_t __src,
204/* 154/*
205 * gzip delarations 155 * gzip delarations
206 */ 156 */
207#define STATIC static
208
209/* Diagnostic functions */
210#ifdef DEBUG
211# define Assert(cond,msg) {if(!(cond)) error(msg);}
212# define Trace(x) fprintf x
213# define Tracev(x) {if (verbose) fprintf x ;}
214# define Tracevv(x) {if (verbose>1) fprintf x ;}
215# define Tracec(c,x) {if (verbose && (c)) fprintf x ;}
216# define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;}
217#else
218# define Assert(cond,msg)
219# define Trace(x)
220# define Tracev(x)
221# define Tracevv(x)
222# define Tracec(c,x)
223# define Tracecv(c,x)
224#endif
225
226static void error(char *m);
227
228extern char input_data[]; 157extern char input_data[];
229extern char input_data_end[]; 158extern char input_data_end[];
230 159
231static unsigned char *output_data; 160unsigned char *output_data;
232static unsigned long output_ptr; 161unsigned long output_ptr;
233
234static void error(char *m);
235 162
236static void putstr(const char *); 163unsigned long free_mem_ptr;
237 164unsigned long free_mem_end_ptr;
238static unsigned long free_mem_ptr;
239static unsigned long free_mem_end_ptr;
240
241#ifdef STANDALONE_DEBUG
242#define NO_INFLATE_MALLOC
243#endif
244
245#define ARCH_HAS_DECOMP_WDOG
246
247#ifdef CONFIG_KERNEL_GZIP
248#include "../../../../lib/decompress_inflate.c"
249#endif
250
251#ifdef CONFIG_KERNEL_LZO
252#include "../../../../lib/decompress_unlzo.c"
253#endif
254 165
255#ifndef arch_error 166#ifndef arch_error
256#define arch_error(x) 167#define arch_error(x)
257#endif 168#endif
258 169
259static void error(char *x) 170void error(char *x)
260{ 171{
261 arch_error(x); 172 arch_error(x);
262 173
@@ -272,6 +183,8 @@ asmlinkage void __div0(void)
272 error("Attempting division by 0!"); 183 error("Attempting division by 0!");
273} 184}
274 185
186extern void do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x));
187
275#ifndef STANDALONE_DEBUG 188#ifndef STANDALONE_DEBUG
276 189
277unsigned long 190unsigned long
@@ -292,8 +205,8 @@ decompress_kernel(unsigned long output_start, unsigned long free_mem_ptr_p,
292 output_ptr = get_unaligned_le32(tmp); 205 output_ptr = get_unaligned_le32(tmp);
293 206
294 putstr("Uncompressing Linux..."); 207 putstr("Uncompressing Linux...");
295 decompress(input_data, input_data_end - input_data, 208 do_decompress(input_data, input_data_end - input_data,
296 NULL, NULL, output_data, NULL, error); 209 output_data, error);
297 putstr(" done, booting the kernel.\n"); 210 putstr(" done, booting the kernel.\n");
298 return output_ptr; 211 return output_ptr;
299} 212}
diff --git a/arch/arm/boot/compressed/vmlinux.lds.in b/arch/arm/boot/compressed/vmlinux.lds.in
index cbed030b55cf..d08168941bd6 100644
--- a/arch/arm/boot/compressed/vmlinux.lds.in
+++ b/arch/arm/boot/compressed/vmlinux.lds.in
@@ -14,6 +14,13 @@ SECTIONS
14 /DISCARD/ : { 14 /DISCARD/ : {
15 *(.ARM.exidx*) 15 *(.ARM.exidx*)
16 *(.ARM.extab*) 16 *(.ARM.extab*)
17 /*
18 * Discard any r/w data - this produces a link error if we have any,
19 * which is required for PIC decompression. Local data generates
20 * GOTOFF relocations, which prevents it being relocated independently
21 * of the text/got segments.
22 */
23 *(.data)
17 } 24 }
18 25
19 . = TEXT_START; 26 . = TEXT_START;
@@ -43,7 +50,6 @@ SECTIONS
43 .got : { *(.got) } 50 .got : { *(.got) }
44 _got_end = .; 51 _got_end = .;
45 .got.plt : { *(.got.plt) } 52 .got.plt : { *(.got.plt) }
46 .data : { *(.data) }
47 _edata = .; 53 _edata = .;
48 54
49 . = BSS_START; 55 . = BSS_START;
diff --git a/arch/arm/include/asm/dma.h b/arch/arm/include/asm/dma.h
index ca51143f97f1..8ff660247900 100644
--- a/arch/arm/include/asm/dma.h
+++ b/arch/arm/include/asm/dma.h
@@ -31,18 +31,18 @@
31#define DMA_MODE_CASCADE 0xc0 31#define DMA_MODE_CASCADE 0xc0
32#define DMA_AUTOINIT 0x10 32#define DMA_AUTOINIT 0x10
33 33
34extern spinlock_t dma_spin_lock; 34extern raw_spinlock_t dma_spin_lock;
35 35
36static inline unsigned long claim_dma_lock(void) 36static inline unsigned long claim_dma_lock(void)
37{ 37{
38 unsigned long flags; 38 unsigned long flags;
39 spin_lock_irqsave(&dma_spin_lock, flags); 39 raw_spin_lock_irqsave(&dma_spin_lock, flags);
40 return flags; 40 return flags;
41} 41}
42 42
43static inline void release_dma_lock(unsigned long flags) 43static inline void release_dma_lock(unsigned long flags)
44{ 44{
45 spin_unlock_irqrestore(&dma_spin_lock, flags); 45 raw_spin_unlock_irqrestore(&dma_spin_lock, flags);
46} 46}
47 47
48/* Clear the 'DMA Pointer Flip Flop'. 48/* Clear the 'DMA Pointer Flip Flop'.
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
index 058e7e90881d..d8fd711e91ba 100644
--- a/arch/arm/include/asm/system.h
+++ b/arch/arm/include/asm/system.h
@@ -60,6 +60,8 @@
60#include <linux/linkage.h> 60#include <linux/linkage.h>
61#include <linux/irqflags.h> 61#include <linux/irqflags.h>
62 62
63#include <asm/memory.h>
64
63#define __exception __attribute__((section(".exception.text"))) 65#define __exception __attribute__((section(".exception.text")))
64 66
65struct thread_info; 67struct thread_info;
diff --git a/arch/arm/include/asm/tlb.h b/arch/arm/include/asm/tlb.h
index f41a6f57cd12..dd667f26cc01 100644
--- a/arch/arm/include/asm/tlb.h
+++ b/arch/arm/include/asm/tlb.h
@@ -40,17 +40,12 @@ struct mmu_gather {
40 unsigned long range_end; 40 unsigned long range_end;
41}; 41};
42 42
43DECLARE_PER_CPU(struct mmu_gather, mmu_gathers); 43static inline void
44 44tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm,
45static inline struct mmu_gather * 45 unsigned int full_mm_flush)
46tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush)
47{ 46{
48 struct mmu_gather *tlb = &get_cpu_var(mmu_gathers);
49
50 tlb->mm = mm; 47 tlb->mm = mm;
51 tlb->fullmm = full_mm_flush; 48 tlb->fullmm = full_mm_flush;
52
53 return tlb;
54} 49}
55 50
56static inline void 51static inline void
@@ -61,8 +56,6 @@ tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
61 56
62 /* keep the page table cache within bounds */ 57 /* keep the page table cache within bounds */
63 check_pgt_cache(); 58 check_pgt_cache();
64
65 put_cpu_var(mmu_gathers);
66} 59}
67 60
68/* 61/*
diff --git a/arch/arm/kernel/dma.c b/arch/arm/kernel/dma.c
index 7d5b9fb01e71..0b5ad04c586a 100644
--- a/arch/arm/kernel/dma.c
+++ b/arch/arm/kernel/dma.c
@@ -21,7 +21,7 @@
21 21
22#include <asm/mach/dma.h> 22#include <asm/mach/dma.h>
23 23
24DEFINE_SPINLOCK(dma_spin_lock); 24DEFINE_RAW_SPINLOCK(dma_spin_lock);
25EXPORT_SYMBOL(dma_spin_lock); 25EXPORT_SYMBOL(dma_spin_lock);
26 26
27static dma_t *dma_chan[MAX_DMA_CHANNELS]; 27static dma_t *dma_chan[MAX_DMA_CHANNELS];
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
index 2c1db77d7848..1d2a386e42e5 100644
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@ -52,7 +52,8 @@ work_pending:
52 b ret_slow_syscall @ Check work again 52 b ret_slow_syscall @ Check work again
53 53
54work_resched: 54work_resched:
55 bl schedule 55 bl __schedule
56
56/* 57/*
57 * "slow" syscall return path. "why" tells us if this was a real syscall. 58 * "slow" syscall return path. "why" tells us if this was a real syscall.
58 */ 59 */
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index ba2adefa53f7..2bec4a9b5fdd 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -174,9 +174,11 @@ void cpu_idle(void)
174 } 174 }
175 leds_event(led_idle_end); 175 leds_event(led_idle_end);
176 tick_nohz_restart_sched_tick(); 176 tick_nohz_restart_sched_tick();
177 preempt_enable_no_resched(); 177 local_irq_disable();
178 schedule(); 178 __preempt_enable_no_resched();
179 __schedule();
179 preempt_disable(); 180 preempt_disable();
181 local_irq_enable();
180 } 182 }
181} 183}
182 184
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
index e7714f367eb8..469f223de82b 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -607,6 +607,14 @@ static void do_signal(struct pt_regs *regs, int syscall)
607 siginfo_t info; 607 siginfo_t info;
608 int signr; 608 int signr;
609 609
610#ifdef CONFIG_PREEMPT_RT
611 /*
612 * Fully-preemptible kernel does not need interrupts disabled:
613 */
614 local_irq_enable();
615 preempt_check_resched();
616#endif
617
610 /* 618 /*
611 * We want the common case to go fast, which 619 * We want the common case to go fast, which
612 * is why we may in certain cases get here from 620 * is why we may in certain cases get here from
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index 57162af53dc9..9c67108e9ade 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -452,17 +452,17 @@ void __cpuinit percpu_timer_setup(void)
452 local_timer_setup(evt); 452 local_timer_setup(evt);
453} 453}
454 454
455static DEFINE_SPINLOCK(stop_lock); 455static DEFINE_RAW_SPINLOCK(stop_lock);
456 456
457/* 457/*
458 * ipi_cpu_stop - handle IPI from smp_send_stop() 458 * ipi_cpu_stop - handle IPI from smp_send_stop()
459 */ 459 */
460static void ipi_cpu_stop(unsigned int cpu) 460static void ipi_cpu_stop(unsigned int cpu)
461{ 461{
462 spin_lock(&stop_lock); 462 raw_spin_lock(&stop_lock);
463 printk(KERN_CRIT "CPU%u: stopping\n", cpu); 463 printk(KERN_CRIT "CPU%u: stopping\n", cpu);
464 dump_stack(); 464 dump_stack();
465 spin_unlock(&stop_lock); 465 raw_spin_unlock(&stop_lock);
466 466
467 set_cpu_online(cpu, false); 467 set_cpu_online(cpu, false);
468 468
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c
index d38cdf2c8276..3654ecfc68e4 100644
--- a/arch/arm/kernel/time.c
+++ b/arch/arm/kernel/time.c
@@ -245,11 +245,11 @@ void do_gettimeofday(struct timeval *tv)
245 unsigned long usec, sec; 245 unsigned long usec, sec;
246 246
247 do { 247 do {
248 seq = read_seqbegin_irqsave(&xtime_lock, flags); 248 seq = read_raw_seqbegin_irqsave(&xtime_lock, flags);
249 usec = system_timer->offset(); 249 usec = system_timer->offset();
250 sec = xtime.tv_sec; 250 sec = xtime.tv_sec;
251 usec += xtime.tv_nsec / 1000; 251 usec += xtime.tv_nsec / 1000;
252 } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); 252 } while (read_raw_seqretry_irqrestore(&xtime_lock, seq, flags));
253 253
254 /* usec may have gone up a lot: be safe */ 254 /* usec may have gone up a lot: be safe */
255 while (usec >= 1000000) { 255 while (usec >= 1000000) {
@@ -271,7 +271,7 @@ int do_settimeofday(struct timespec *tv)
271 if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC) 271 if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC)
272 return -EINVAL; 272 return -EINVAL;
273 273
274 write_seqlock_irq(&xtime_lock); 274 write_raw_seqlock_irq(&xtime_lock);
275 /* 275 /*
276 * This is revolting. We need to set "xtime" correctly. However, the 276 * This is revolting. We need to set "xtime" correctly. However, the
277 * value in this location is the value at the most recent update of 277 * value in this location is the value at the most recent update of
@@ -287,7 +287,7 @@ int do_settimeofday(struct timespec *tv)
287 set_normalized_timespec(&wall_to_monotonic, wtm_sec, wtm_nsec); 287 set_normalized_timespec(&wall_to_monotonic, wtm_sec, wtm_nsec);
288 288
289 ntp_clear(); 289 ntp_clear();
290 write_sequnlock_irq(&xtime_lock); 290 write_raw_sequnlock_irq(&xtime_lock);
291 clock_was_set(); 291 clock_was_set();
292 return 0; 292 return 0;
293} 293}
@@ -337,9 +337,9 @@ void timer_tick(void)
337 profile_tick(CPU_PROFILING); 337 profile_tick(CPU_PROFILING);
338 do_leds(); 338 do_leds();
339 do_set_rtc(); 339 do_set_rtc();
340 write_seqlock(&xtime_lock); 340 write_raw_seqlock(&xtime_lock);
341 do_timer(1); 341 do_timer(1);
342 write_sequnlock(&xtime_lock); 342 write_raw_sequnlock(&xtime_lock);
343#ifndef CONFIG_SMP 343#ifndef CONFIG_SMP
344 update_process_times(user_mode(get_irq_regs())); 344 update_process_times(user_mode(get_irq_regs()));
345#endif 345#endif
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 3f361a783f43..00ebadc05dfd 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -245,7 +245,7 @@ static void __die(const char *str, int err, struct thread_info *thread, struct p
245 } 245 }
246} 246}
247 247
248DEFINE_SPINLOCK(die_lock); 248DEFINE_RAW_SPINLOCK(die_lock);
249 249
250/* 250/*
251 * This function is protected against re-entrancy. 251 * This function is protected against re-entrancy.
@@ -256,13 +256,13 @@ NORET_TYPE void die(const char *str, struct pt_regs *regs, int err)
256 256
257 oops_enter(); 257 oops_enter();
258 258
259 spin_lock_irq(&die_lock); 259 raw_spin_lock_irq(&die_lock);
260 console_verbose(); 260 console_verbose();
261 bust_spinlocks(1); 261 bust_spinlocks(1);
262 __die(str, err, thread, regs); 262 __die(str, err, thread, regs);
263 bust_spinlocks(0); 263 bust_spinlocks(0);
264 add_taint(TAINT_DIE); 264 add_taint(TAINT_DIE);
265 spin_unlock_irq(&die_lock); 265 raw_spin_unlock_irq(&die_lock);
266 oops_exit(); 266 oops_exit();
267 267
268 if (in_interrupt()) 268 if (in_interrupt())
@@ -288,24 +288,24 @@ void arm_notify_die(const char *str, struct pt_regs *regs,
288} 288}
289 289
290static LIST_HEAD(undef_hook); 290static LIST_HEAD(undef_hook);
291static DEFINE_SPINLOCK(undef_lock); 291static DEFINE_RAW_SPINLOCK(undef_lock);
292 292
293void register_undef_hook(struct undef_hook *hook) 293void register_undef_hook(struct undef_hook *hook)
294{ 294{
295 unsigned long flags; 295 unsigned long flags;
296 296
297 spin_lock_irqsave(&undef_lock, flags); 297 raw_spin_lock_irqsave(&undef_lock, flags);
298 list_add(&hook->node, &undef_hook); 298 list_add(&hook->node, &undef_hook);
299 spin_unlock_irqrestore(&undef_lock, flags); 299 raw_spin_unlock_irqrestore(&undef_lock, flags);
300} 300}
301 301
302void unregister_undef_hook(struct undef_hook *hook) 302void unregister_undef_hook(struct undef_hook *hook)
303{ 303{
304 unsigned long flags; 304 unsigned long flags;
305 305
306 spin_lock_irqsave(&undef_lock, flags); 306 raw_spin_lock_irqsave(&undef_lock, flags);
307 list_del(&hook->node); 307 list_del(&hook->node);
308 spin_unlock_irqrestore(&undef_lock, flags); 308 raw_spin_unlock_irqrestore(&undef_lock, flags);
309} 309}
310 310
311static int call_undef_hook(struct pt_regs *regs, unsigned int instr) 311static int call_undef_hook(struct pt_regs *regs, unsigned int instr)
@@ -314,12 +314,12 @@ static int call_undef_hook(struct pt_regs *regs, unsigned int instr)
314 unsigned long flags; 314 unsigned long flags;
315 int (*fn)(struct pt_regs *regs, unsigned int instr) = NULL; 315 int (*fn)(struct pt_regs *regs, unsigned int instr) = NULL;
316 316
317 spin_lock_irqsave(&undef_lock, flags); 317 raw_spin_lock_irqsave(&undef_lock, flags);
318 list_for_each_entry(hook, &undef_hook, node) 318 list_for_each_entry(hook, &undef_hook, node)
319 if ((instr & hook->instr_mask) == hook->instr_val && 319 if ((instr & hook->instr_mask) == hook->instr_val &&
320 (regs->ARM_cpsr & hook->cpsr_mask) == hook->cpsr_val) 320 (regs->ARM_cpsr & hook->cpsr_mask) == hook->cpsr_val)
321 fn = hook->fn; 321 fn = hook->fn;
322 spin_unlock_irqrestore(&undef_lock, flags); 322 raw_spin_unlock_irqrestore(&undef_lock, flags);
323 323
324 return fn ? fn(regs, instr) : 1; 324 return fn ? fn(regs, instr) : 1;
325} 325}
diff --git a/arch/arm/mach-at91/at91rm9200_time.c b/arch/arm/mach-at91/at91rm9200_time.c
index 309f3511aa20..9ebf6c744444 100644
--- a/arch/arm/mach-at91/at91rm9200_time.c
+++ b/arch/arm/mach-at91/at91rm9200_time.c
@@ -109,6 +109,7 @@ clkevt32k_mode(enum clock_event_mode mode, struct clock_event_device *dev)
109 last_crtr = read_CRTR(); 109 last_crtr = read_CRTR();
110 switch (mode) { 110 switch (mode) {
111 case CLOCK_EVT_MODE_PERIODIC: 111 case CLOCK_EVT_MODE_PERIODIC:
112 setup_irq(AT91_ID_SYS, &at91rm9200_timer_irq);
112 /* PIT for periodic irqs; fixed rate of 1/HZ */ 113 /* PIT for periodic irqs; fixed rate of 1/HZ */
113 irqmask = AT91_ST_PITS; 114 irqmask = AT91_ST_PITS;
114 at91_sys_write(AT91_ST_PIMR, LATCH); 115 at91_sys_write(AT91_ST_PIMR, LATCH);
@@ -122,6 +123,7 @@ clkevt32k_mode(enum clock_event_mode mode, struct clock_event_device *dev)
122 break; 123 break;
123 case CLOCK_EVT_MODE_SHUTDOWN: 124 case CLOCK_EVT_MODE_SHUTDOWN:
124 case CLOCK_EVT_MODE_UNUSED: 125 case CLOCK_EVT_MODE_UNUSED:
126 remove_irq(AT91_ID_SYS, &at91rm9200_timer_irq);
125 case CLOCK_EVT_MODE_RESUME: 127 case CLOCK_EVT_MODE_RESUME:
126 irqmask = 0; 128 irqmask = 0;
127 break; 129 break;
diff --git a/arch/arm/mach-at91/at91sam926x_time.c b/arch/arm/mach-at91/at91sam926x_time.c
index 4bd56aee4370..6936e392c058 100644
--- a/arch/arm/mach-at91/at91sam926x_time.c
+++ b/arch/arm/mach-at91/at91sam926x_time.c
@@ -55,7 +55,7 @@ static struct clocksource pit_clk = {
55 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 55 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
56}; 56};
57 57
58 58static struct irqaction at91sam926x_pit_irq;
59/* 59/*
60 * Clockevent device: interrupts every 1/HZ (== pit_cycles * MCK/16) 60 * Clockevent device: interrupts every 1/HZ (== pit_cycles * MCK/16)
61 */ 61 */
@@ -66,6 +66,9 @@ pit_clkevt_mode(enum clock_event_mode mode, struct clock_event_device *dev)
66 66
67 switch (mode) { 67 switch (mode) {
68 case CLOCK_EVT_MODE_PERIODIC: 68 case CLOCK_EVT_MODE_PERIODIC:
69 /* Set up irq handler */
70 setup_irq(AT91_ID_SYS, &at91sam926x_pit_irq);
71
69 /* update clocksource counter, then enable the IRQ */ 72 /* update clocksource counter, then enable the IRQ */
70 raw_local_irq_save(flags); 73 raw_local_irq_save(flags);
71 pit_cnt += pit_cycle * PIT_PICNT(at91_sys_read(AT91_PIT_PIVR)); 74 pit_cnt += pit_cycle * PIT_PICNT(at91_sys_read(AT91_PIT_PIVR));
@@ -80,6 +83,7 @@ pit_clkevt_mode(enum clock_event_mode mode, struct clock_event_device *dev)
80 case CLOCK_EVT_MODE_UNUSED: 83 case CLOCK_EVT_MODE_UNUSED:
81 /* disable irq, leaving the clocksource active */ 84 /* disable irq, leaving the clocksource active */
82 at91_sys_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN); 85 at91_sys_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN);
86 remove_irq(AT91_ID_SYS, &at91sam926x_pit_irq);
83 break; 87 break;
84 case CLOCK_EVT_MODE_RESUME: 88 case CLOCK_EVT_MODE_RESUME:
85 break; 89 break;
diff --git a/arch/arm/mach-at91/gpio.c b/arch/arm/mach-at91/gpio.c
index ae4772e744ac..d959979c5bd1 100644
--- a/arch/arm/mach-at91/gpio.c
+++ b/arch/arm/mach-at91/gpio.c
@@ -373,12 +373,18 @@ static int gpio_irq_type(unsigned pin, unsigned type)
373 } 373 }
374} 374}
375 375
376static void gpio_irq_ack_noop(unsigned int irq)
377{
378 /* Dummy function. */
379}
380
376static struct irq_chip gpio_irqchip = { 381static struct irq_chip gpio_irqchip = {
377 .name = "GPIO", 382 .name = "GPIO",
378 .mask = gpio_irq_mask, 383 .mask = gpio_irq_mask,
379 .unmask = gpio_irq_unmask, 384 .unmask = gpio_irq_unmask,
380 .set_type = gpio_irq_type, 385 .set_type = gpio_irq_type,
381 .set_wake = gpio_irq_set_wake, 386 .set_wake = gpio_irq_set_wake,
387 .ack = gpio_irq_ack_noop,
382}; 388};
383 389
384static void gpio_irq_handler(unsigned irq, struct irq_desc *desc) 390static void gpio_irq_handler(unsigned irq, struct irq_desc *desc)
@@ -525,7 +531,7 @@ void __init at91_gpio_irq_setup(void)
525 * shorter, and the AIC handles interrupts sanely. 531 * shorter, and the AIC handles interrupts sanely.
526 */ 532 */
527 set_irq_chip(pin, &gpio_irqchip); 533 set_irq_chip(pin, &gpio_irqchip);
528 set_irq_handler(pin, handle_simple_irq); 534 set_irq_handler(pin, handle_edge_irq);
529 set_irq_flags(pin, IRQF_VALID); 535 set_irq_flags(pin, IRQF_VALID);
530 } 536 }
531 537
diff --git a/arch/arm/mach-bcmring/dma.c b/arch/arm/mach-bcmring/dma.c
index 7b20fccb9d4e..744edb08409f 100644
--- a/arch/arm/mach-bcmring/dma.c
+++ b/arch/arm/mach-bcmring/dma.c
@@ -690,7 +690,7 @@ int dma_init(void)
690 690
691 memset(&gDMA, 0, sizeof(gDMA)); 691 memset(&gDMA, 0, sizeof(gDMA));
692 692
693 init_MUTEX_LOCKED(&gDMA.lock); 693 sema_init(&gDMA.lock, 0);
694 init_waitqueue_head(&gDMA.freeChannelQ); 694 init_waitqueue_head(&gDMA.freeChannelQ);
695 695
696 /* Initialize the Hardware */ 696 /* Initialize the Hardware */
@@ -1573,7 +1573,7 @@ int dma_init_mem_map(DMA_MemMap_t *memMap)
1573{ 1573{
1574 memset(memMap, 0, sizeof(*memMap)); 1574 memset(memMap, 0, sizeof(*memMap));
1575 1575
1576 init_MUTEX(&memMap->lock); 1576 sema_init(&memMap->lock, 1);
1577 1577
1578 return 0; 1578 return 0;
1579} 1579}
@@ -2225,6 +2225,8 @@ int dma_unmap(DMA_MemMap_t *memMap, /* Stores state information about the map */
2225 DMA_Region_t *region; 2225 DMA_Region_t *region;
2226 DMA_Segment_t *segment; 2226 DMA_Segment_t *segment;
2227 2227
2228 down(&memMap->lock);
2229
2228 for (regionIdx = 0; regionIdx < memMap->numRegionsUsed; regionIdx++) { 2230 for (regionIdx = 0; regionIdx < memMap->numRegionsUsed; regionIdx++) {
2229 region = &memMap->region[regionIdx]; 2231 region = &memMap->region[regionIdx];
2230 2232
diff --git a/arch/arm/mach-footbridge/include/mach/hardware.h b/arch/arm/mach-footbridge/include/mach/hardware.h
index 51dd902043ad..eee37b69191c 100644
--- a/arch/arm/mach-footbridge/include/mach/hardware.h
+++ b/arch/arm/mach-footbridge/include/mach/hardware.h
@@ -86,7 +86,7 @@
86#define CPLD_FLASH_WR_ENABLE 1 86#define CPLD_FLASH_WR_ENABLE 1
87 87
88#ifndef __ASSEMBLY__ 88#ifndef __ASSEMBLY__
89extern spinlock_t nw_gpio_lock; 89extern raw_spinlock_t nw_gpio_lock;
90extern void nw_gpio_modify_op(unsigned int mask, unsigned int set); 90extern void nw_gpio_modify_op(unsigned int mask, unsigned int set);
91extern void nw_gpio_modify_io(unsigned int mask, unsigned int in); 91extern void nw_gpio_modify_io(unsigned int mask, unsigned int in);
92extern unsigned int nw_gpio_read(void); 92extern unsigned int nw_gpio_read(void);
diff --git a/arch/arm/mach-footbridge/netwinder-hw.c b/arch/arm/mach-footbridge/netwinder-hw.c
index ac7ffa6fc413..c903dad09219 100644
--- a/arch/arm/mach-footbridge/netwinder-hw.c
+++ b/arch/arm/mach-footbridge/netwinder-hw.c
@@ -68,7 +68,7 @@ static inline void wb977_ww(int reg, int val)
68/* 68/*
69 * This is a lock for accessing ports GP1_IO_BASE and GP2_IO_BASE 69 * This is a lock for accessing ports GP1_IO_BASE and GP2_IO_BASE
70 */ 70 */
71DEFINE_SPINLOCK(nw_gpio_lock); 71DEFINE_RAW_SPINLOCK(nw_gpio_lock);
72EXPORT_SYMBOL(nw_gpio_lock); 72EXPORT_SYMBOL(nw_gpio_lock);
73 73
74static unsigned int current_gpio_op; 74static unsigned int current_gpio_op;
@@ -327,9 +327,9 @@ static inline void wb977_init_gpio(void)
327 /* 327 /*
328 * Set Group1/Group2 outputs 328 * Set Group1/Group2 outputs
329 */ 329 */
330 spin_lock_irqsave(&nw_gpio_lock, flags); 330 raw_spin_lock_irqsave(&nw_gpio_lock, flags);
331 nw_gpio_modify_op(-1, GPIO_RED_LED | GPIO_FAN); 331 nw_gpio_modify_op(-1, GPIO_RED_LED | GPIO_FAN);
332 spin_unlock_irqrestore(&nw_gpio_lock, flags); 332 raw_spin_unlock_irqrestore(&nw_gpio_lock, flags);
333} 333}
334 334
335/* 335/*
@@ -390,9 +390,9 @@ static void __init cpld_init(void)
390{ 390{
391 unsigned long flags; 391 unsigned long flags;
392 392
393 spin_lock_irqsave(&nw_gpio_lock, flags); 393 raw_spin_lock_irqsave(&nw_gpio_lock, flags);
394 nw_cpld_modify(-1, CPLD_UNMUTE | CPLD_7111_DISABLE); 394 nw_cpld_modify(-1, CPLD_UNMUTE | CPLD_7111_DISABLE);
395 spin_unlock_irqrestore(&nw_gpio_lock, flags); 395 raw_spin_unlock_irqrestore(&nw_gpio_lock, flags);
396} 396}
397 397
398static unsigned char rwa_unlock[] __initdata = 398static unsigned char rwa_unlock[] __initdata =
@@ -616,9 +616,9 @@ static int __init nw_hw_init(void)
616 cpld_init(); 616 cpld_init();
617 rwa010_init(); 617 rwa010_init();
618 618
619 spin_lock_irqsave(&nw_gpio_lock, flags); 619 raw_spin_lock_irqsave(&nw_gpio_lock, flags);
620 nw_gpio_modify_op(GPIO_RED_LED|GPIO_GREEN_LED, DEFAULT_LEDS); 620 nw_gpio_modify_op(GPIO_RED_LED|GPIO_GREEN_LED, DEFAULT_LEDS);
621 spin_unlock_irqrestore(&nw_gpio_lock, flags); 621 raw_spin_unlock_irqrestore(&nw_gpio_lock, flags);
622 } 622 }
623 return 0; 623 return 0;
624} 624}
diff --git a/arch/arm/mach-footbridge/netwinder-leds.c b/arch/arm/mach-footbridge/netwinder-leds.c
index 00269fe0be8a..e57102e871fc 100644
--- a/arch/arm/mach-footbridge/netwinder-leds.c
+++ b/arch/arm/mach-footbridge/netwinder-leds.c
@@ -31,13 +31,13 @@
31static char led_state; 31static char led_state;
32static char hw_led_state; 32static char hw_led_state;
33 33
34static DEFINE_SPINLOCK(leds_lock); 34static DEFINE_RAW_SPINLOCK(leds_lock);
35 35
36static void netwinder_leds_event(led_event_t evt) 36static void netwinder_leds_event(led_event_t evt)
37{ 37{
38 unsigned long flags; 38 unsigned long flags;
39 39
40 spin_lock_irqsave(&leds_lock, flags); 40 raw_spin_lock_irqsave(&leds_lock, flags);
41 41
42 switch (evt) { 42 switch (evt) {
43 case led_start: 43 case led_start:
@@ -117,12 +117,12 @@ static void netwinder_leds_event(led_event_t evt)
117 break; 117 break;
118 } 118 }
119 119
120 spin_unlock_irqrestore(&leds_lock, flags); 120 raw_spin_unlock_irqrestore(&leds_lock, flags);
121 121
122 if (led_state & LED_STATE_ENABLED) { 122 if (led_state & LED_STATE_ENABLED) {
123 spin_lock_irqsave(&nw_gpio_lock, flags); 123 raw_spin_lock_irqsave(&nw_gpio_lock, flags);
124 nw_gpio_modify_op(GPIO_RED_LED | GPIO_GREEN_LED, hw_led_state); 124 nw_gpio_modify_op(GPIO_RED_LED | GPIO_GREEN_LED, hw_led_state);
125 spin_unlock_irqrestore(&nw_gpio_lock, flags); 125 raw_spin_unlock_irqrestore(&nw_gpio_lock, flags);
126 } 126 }
127} 127}
128 128
diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c
index a0f60e55da6a..15c94cd0c712 100644
--- a/arch/arm/mach-integrator/core.c
+++ b/arch/arm/mach-integrator/core.c
@@ -199,7 +199,7 @@ static struct amba_pl010_data integrator_uart_data = {
199 199
200#define CM_CTRL IO_ADDRESS(INTEGRATOR_HDR_BASE) + INTEGRATOR_HDR_CTRL_OFFSET 200#define CM_CTRL IO_ADDRESS(INTEGRATOR_HDR_BASE) + INTEGRATOR_HDR_CTRL_OFFSET
201 201
202static DEFINE_SPINLOCK(cm_lock); 202static DEFINE_RAW_SPINLOCK(cm_lock);
203 203
204/** 204/**
205 * cm_control - update the CM_CTRL register. 205 * cm_control - update the CM_CTRL register.
@@ -211,10 +211,10 @@ void cm_control(u32 mask, u32 set)
211 unsigned long flags; 211 unsigned long flags;
212 u32 val; 212 u32 val;
213 213
214 spin_lock_irqsave(&cm_lock, flags); 214 raw_spin_lock_irqsave(&cm_lock, flags);
215 val = readl(CM_CTRL) & ~mask; 215 val = readl(CM_CTRL) & ~mask;
216 writel(val | set, CM_CTRL); 216 writel(val | set, CM_CTRL);
217 spin_unlock_irqrestore(&cm_lock, flags); 217 raw_spin_unlock_irqrestore(&cm_lock, flags);
218} 218}
219 219
220EXPORT_SYMBOL(cm_control); 220EXPORT_SYMBOL(cm_control);
diff --git a/arch/arm/mach-integrator/pci_v3.c b/arch/arm/mach-integrator/pci_v3.c
index 148d25fc636f..f7fe21438cfd 100644
--- a/arch/arm/mach-integrator/pci_v3.c
+++ b/arch/arm/mach-integrator/pci_v3.c
@@ -163,7 +163,7 @@
163 * 7:2 register number 163 * 7:2 register number
164 * 164 *
165 */ 165 */
166static DEFINE_SPINLOCK(v3_lock); 166static DEFINE_RAW_SPINLOCK(v3_lock);
167 167
168#define PCI_BUS_NONMEM_START 0x00000000 168#define PCI_BUS_NONMEM_START 0x00000000
169#define PCI_BUS_NONMEM_SIZE SZ_256M 169#define PCI_BUS_NONMEM_SIZE SZ_256M
@@ -284,7 +284,7 @@ static int v3_read_config(struct pci_bus *bus, unsigned int devfn, int where,
284 unsigned long flags; 284 unsigned long flags;
285 u32 v; 285 u32 v;
286 286
287 spin_lock_irqsave(&v3_lock, flags); 287 raw_spin_lock_irqsave(&v3_lock, flags);
288 addr = v3_open_config_window(bus, devfn, where); 288 addr = v3_open_config_window(bus, devfn, where);
289 289
290 switch (size) { 290 switch (size) {
@@ -302,7 +302,7 @@ static int v3_read_config(struct pci_bus *bus, unsigned int devfn, int where,
302 } 302 }
303 303
304 v3_close_config_window(); 304 v3_close_config_window();
305 spin_unlock_irqrestore(&v3_lock, flags); 305 raw_spin_unlock_irqrestore(&v3_lock, flags);
306 306
307 *val = v; 307 *val = v;
308 return PCIBIOS_SUCCESSFUL; 308 return PCIBIOS_SUCCESSFUL;
@@ -314,7 +314,7 @@ static int v3_write_config(struct pci_bus *bus, unsigned int devfn, int where,
314 unsigned long addr; 314 unsigned long addr;
315 unsigned long flags; 315 unsigned long flags;
316 316
317 spin_lock_irqsave(&v3_lock, flags); 317 raw_spin_lock_irqsave(&v3_lock, flags);
318 addr = v3_open_config_window(bus, devfn, where); 318 addr = v3_open_config_window(bus, devfn, where);
319 319
320 switch (size) { 320 switch (size) {
@@ -335,7 +335,7 @@ static int v3_write_config(struct pci_bus *bus, unsigned int devfn, int where,
335 } 335 }
336 336
337 v3_close_config_window(); 337 v3_close_config_window();
338 spin_unlock_irqrestore(&v3_lock, flags); 338 raw_spin_unlock_irqrestore(&v3_lock, flags);
339 339
340 return PCIBIOS_SUCCESSFUL; 340 return PCIBIOS_SUCCESSFUL;
341} 341}
@@ -510,7 +510,7 @@ void __init pci_v3_preinit(void)
510 hook_fault_code(8, v3_pci_fault, SIGBUS, "external abort on non-linefetch"); 510 hook_fault_code(8, v3_pci_fault, SIGBUS, "external abort on non-linefetch");
511 hook_fault_code(10, v3_pci_fault, SIGBUS, "external abort on non-linefetch"); 511 hook_fault_code(10, v3_pci_fault, SIGBUS, "external abort on non-linefetch");
512 512
513 spin_lock_irqsave(&v3_lock, flags); 513 raw_spin_lock_irqsave(&v3_lock, flags);
514 514
515 /* 515 /*
516 * Unlock V3 registers, but only if they were previously locked. 516 * Unlock V3 registers, but only if they were previously locked.
@@ -583,7 +583,7 @@ void __init pci_v3_preinit(void)
583 printk(KERN_ERR "PCI: unable to grab PCI error " 583 printk(KERN_ERR "PCI: unable to grab PCI error "
584 "interrupt: %d\n", ret); 584 "interrupt: %d\n", ret);
585 585
586 spin_unlock_irqrestore(&v3_lock, flags); 586 raw_spin_unlock_irqrestore(&v3_lock, flags);
587} 587}
588 588
589void __init pci_v3_postinit(void) 589void __init pci_v3_postinit(void)
diff --git a/arch/arm/mach-ixp2000/core.c b/arch/arm/mach-ixp2000/core.c
index babb22597163..e24e3d05397f 100644
--- a/arch/arm/mach-ixp2000/core.c
+++ b/arch/arm/mach-ixp2000/core.c
@@ -197,7 +197,7 @@ unsigned long ixp2000_gettimeoffset (void)
197 return offset / ticks_per_usec; 197 return offset / ticks_per_usec;
198} 198}
199 199
200static int ixp2000_timer_interrupt(int irq, void *dev_id) 200static irqreturn_t ixp2000_timer_interrupt(int irq, void *dev_id)
201{ 201{
202 /* clear timer 1 */ 202 /* clear timer 1 */
203 ixp2000_reg_wrb(IXP2000_T1_CLR, 1); 203 ixp2000_reg_wrb(IXP2000_T1_CLR, 1);
diff --git a/arch/arm/mach-ixp4xx/common-pci.c b/arch/arm/mach-ixp4xx/common-pci.c
index c4a01594c761..fefbf10258ae 100644
--- a/arch/arm/mach-ixp4xx/common-pci.c
+++ b/arch/arm/mach-ixp4xx/common-pci.c
@@ -54,7 +54,7 @@ unsigned long ixp4xx_pci_reg_base = 0;
54 * these transactions are atomic or we will end up 54 * these transactions are atomic or we will end up
55 * with corrupt data on the bus or in a driver. 55 * with corrupt data on the bus or in a driver.
56 */ 56 */
57static DEFINE_SPINLOCK(ixp4xx_pci_lock); 57static DEFINE_RAW_SPINLOCK(ixp4xx_pci_lock);
58 58
59/* 59/*
60 * Read from PCI config space 60 * Read from PCI config space
@@ -62,10 +62,10 @@ static DEFINE_SPINLOCK(ixp4xx_pci_lock);
62static void crp_read(u32 ad_cbe, u32 *data) 62static void crp_read(u32 ad_cbe, u32 *data)
63{ 63{
64 unsigned long flags; 64 unsigned long flags;
65 spin_lock_irqsave(&ixp4xx_pci_lock, flags); 65 raw_spin_lock_irqsave(&ixp4xx_pci_lock, flags);
66 *PCI_CRP_AD_CBE = ad_cbe; 66 *PCI_CRP_AD_CBE = ad_cbe;
67 *data = *PCI_CRP_RDATA; 67 *data = *PCI_CRP_RDATA;
68 spin_unlock_irqrestore(&ixp4xx_pci_lock, flags); 68 raw_spin_unlock_irqrestore(&ixp4xx_pci_lock, flags);
69} 69}
70 70
71/* 71/*
@@ -74,10 +74,10 @@ static void crp_read(u32 ad_cbe, u32 *data)
74static void crp_write(u32 ad_cbe, u32 data) 74static void crp_write(u32 ad_cbe, u32 data)
75{ 75{
76 unsigned long flags; 76 unsigned long flags;
77 spin_lock_irqsave(&ixp4xx_pci_lock, flags); 77 raw_spin_lock_irqsave(&ixp4xx_pci_lock, flags);
78 *PCI_CRP_AD_CBE = CRP_AD_CBE_WRITE | ad_cbe; 78 *PCI_CRP_AD_CBE = CRP_AD_CBE_WRITE | ad_cbe;
79 *PCI_CRP_WDATA = data; 79 *PCI_CRP_WDATA = data;
80 spin_unlock_irqrestore(&ixp4xx_pci_lock, flags); 80 raw_spin_unlock_irqrestore(&ixp4xx_pci_lock, flags);
81} 81}
82 82
83static inline int check_master_abort(void) 83static inline int check_master_abort(void)
@@ -101,7 +101,7 @@ int ixp4xx_pci_read_errata(u32 addr, u32 cmd, u32* data)
101 int retval = 0; 101 int retval = 0;
102 int i; 102 int i;
103 103
104 spin_lock_irqsave(&ixp4xx_pci_lock, flags); 104 raw_spin_lock_irqsave(&ixp4xx_pci_lock, flags);
105 105
106 *PCI_NP_AD = addr; 106 *PCI_NP_AD = addr;
107 107
@@ -118,7 +118,7 @@ int ixp4xx_pci_read_errata(u32 addr, u32 cmd, u32* data)
118 if(check_master_abort()) 118 if(check_master_abort())
119 retval = 1; 119 retval = 1;
120 120
121 spin_unlock_irqrestore(&ixp4xx_pci_lock, flags); 121 raw_spin_unlock_irqrestore(&ixp4xx_pci_lock, flags);
122 return retval; 122 return retval;
123} 123}
124 124
@@ -127,7 +127,7 @@ int ixp4xx_pci_read_no_errata(u32 addr, u32 cmd, u32* data)
127 unsigned long flags; 127 unsigned long flags;
128 int retval = 0; 128 int retval = 0;
129 129
130 spin_lock_irqsave(&ixp4xx_pci_lock, flags); 130 raw_spin_lock_irqsave(&ixp4xx_pci_lock, flags);
131 131
132 *PCI_NP_AD = addr; 132 *PCI_NP_AD = addr;
133 133
@@ -140,7 +140,7 @@ int ixp4xx_pci_read_no_errata(u32 addr, u32 cmd, u32* data)
140 if(check_master_abort()) 140 if(check_master_abort())
141 retval = 1; 141 retval = 1;
142 142
143 spin_unlock_irqrestore(&ixp4xx_pci_lock, flags); 143 raw_spin_unlock_irqrestore(&ixp4xx_pci_lock, flags);
144 return retval; 144 return retval;
145} 145}
146 146
@@ -149,7 +149,7 @@ int ixp4xx_pci_write(u32 addr, u32 cmd, u32 data)
149 unsigned long flags; 149 unsigned long flags;
150 int retval = 0; 150 int retval = 0;
151 151
152 spin_lock_irqsave(&ixp4xx_pci_lock, flags); 152 raw_spin_lock_irqsave(&ixp4xx_pci_lock, flags);
153 153
154 *PCI_NP_AD = addr; 154 *PCI_NP_AD = addr;
155 155
@@ -162,7 +162,7 @@ int ixp4xx_pci_write(u32 addr, u32 cmd, u32 data)
162 if(check_master_abort()) 162 if(check_master_abort())
163 retval = 1; 163 retval = 1;
164 164
165 spin_unlock_irqrestore(&ixp4xx_pci_lock, flags); 165 raw_spin_unlock_irqrestore(&ixp4xx_pci_lock, flags);
166 return retval; 166 return retval;
167} 167}
168 168
diff --git a/arch/arm/mach-msm/proc_comm.c b/arch/arm/mach-msm/proc_comm.c
index 915ee704ed3c..e825c36d3ea6 100644
--- a/arch/arm/mach-msm/proc_comm.c
+++ b/arch/arm/mach-msm/proc_comm.c
@@ -14,6 +14,7 @@
14 * 14 *
15 */ 15 */
16 16
17#include <linux/cache.h>
17#include <linux/delay.h> 18#include <linux/delay.h>
18#include <linux/errno.h> 19#include <linux/errno.h>
19#include <linux/io.h> 20#include <linux/io.h>
diff --git a/arch/arm/mach-sa1100/badge4.c b/arch/arm/mach-sa1100/badge4.c
index 051ec0f0023c..fd8ceef1ea14 100644
--- a/arch/arm/mach-sa1100/badge4.c
+++ b/arch/arm/mach-sa1100/badge4.c
@@ -240,15 +240,22 @@ void badge4_set_5V(unsigned subsystem, int on)
240 /* detect on->off and off->on transitions */ 240 /* detect on->off and off->on transitions */
241 if ((!old_5V_bitmap) && (badge4_5V_bitmap)) { 241 if ((!old_5V_bitmap) && (badge4_5V_bitmap)) {
242 /* was off, now on */ 242 /* was off, now on */
243 printk(KERN_INFO "%s: enabling 5V supply rail\n", __func__);
244 GPSR = BADGE4_GPIO_PCMEN5V; 243 GPSR = BADGE4_GPIO_PCMEN5V;
245 } else if ((old_5V_bitmap) && (!badge4_5V_bitmap)) { 244 } else if ((old_5V_bitmap) && (!badge4_5V_bitmap)) {
246 /* was on, now off */ 245 /* was on, now off */
247 printk(KERN_INFO "%s: disabling 5V supply rail\n", __func__);
248 GPCR = BADGE4_GPIO_PCMEN5V; 246 GPCR = BADGE4_GPIO_PCMEN5V;
249 } 247 }
250 248
251 local_irq_restore(flags); 249 local_irq_restore(flags);
250
251 /* detect on->off and off->on transitions */
252 if ((!old_5V_bitmap) && (badge4_5V_bitmap)) {
253 /* was off, now on */
254 printk(KERN_INFO "%s: enabling 5V supply rail\n", __FUNCTION__);
255 } else if ((old_5V_bitmap) && (!badge4_5V_bitmap)) {
256 /* was on, now off */
257 printk(KERN_INFO "%s: disabling 5V supply rail\n", __FUNCTION__);
258 }
252} 259}
253EXPORT_SYMBOL(badge4_set_5V); 260EXPORT_SYMBOL(badge4_set_5V);
254 261
diff --git a/arch/arm/mach-shark/leds.c b/arch/arm/mach-shark/leds.c
index c9e32de4adf9..ccd49189bbd0 100644
--- a/arch/arm/mach-shark/leds.c
+++ b/arch/arm/mach-shark/leds.c
@@ -36,7 +36,7 @@ static char led_state;
36static short hw_led_state; 36static short hw_led_state;
37static short saved_state; 37static short saved_state;
38 38
39static DEFINE_SPINLOCK(leds_lock); 39static DEFINE_RAW_SPINLOCK(leds_lock);
40 40
41short sequoia_read(int addr) { 41short sequoia_read(int addr) {
42 outw(addr,0x24); 42 outw(addr,0x24);
@@ -52,7 +52,7 @@ static void sequoia_leds_event(led_event_t evt)
52{ 52{
53 unsigned long flags; 53 unsigned long flags;
54 54
55 spin_lock_irqsave(&leds_lock, flags); 55 raw_spin_lock_irqsave(&leds_lock, flags);
56 56
57 hw_led_state = sequoia_read(0x09); 57 hw_led_state = sequoia_read(0x09);
58 58
@@ -144,7 +144,7 @@ static void sequoia_leds_event(led_event_t evt)
144 if (led_state & LED_STATE_ENABLED) 144 if (led_state & LED_STATE_ENABLED)
145 sequoia_write(hw_led_state,0x09); 145 sequoia_write(hw_led_state,0x09);
146 146
147 spin_unlock_irqrestore(&leds_lock, flags); 147 raw_spin_unlock_irqrestore(&leds_lock, flags);
148} 148}
149 149
150static int __init leds_init(void) 150static int __init leds_init(void)
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index cb8fc6573b1b..e912ff2f4194 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -26,7 +26,7 @@
26#define CACHE_LINE_SIZE 32 26#define CACHE_LINE_SIZE 32
27 27
28static void __iomem *l2x0_base; 28static void __iomem *l2x0_base;
29static DEFINE_SPINLOCK(l2x0_lock); 29static DEFINE_RAW_SPINLOCK(l2x0_lock);
30 30
31static inline void cache_wait(void __iomem *reg, unsigned long mask) 31static inline void cache_wait(void __iomem *reg, unsigned long mask)
32{ 32{
@@ -47,11 +47,11 @@ static inline void l2x0_inv_all(void)
47 unsigned long flags; 47 unsigned long flags;
48 48
49 /* invalidate all ways */ 49 /* invalidate all ways */
50 spin_lock_irqsave(&l2x0_lock, flags); 50 raw_spin_lock_irqsave(&l2x0_lock, flags);
51 writel(0xff, l2x0_base + L2X0_INV_WAY); 51 writel(0xff, l2x0_base + L2X0_INV_WAY);
52 cache_wait(l2x0_base + L2X0_INV_WAY, 0xff); 52 cache_wait(l2x0_base + L2X0_INV_WAY, 0xff);
53 cache_sync(); 53 cache_sync();
54 spin_unlock_irqrestore(&l2x0_lock, flags); 54 raw_spin_unlock_irqrestore(&l2x0_lock, flags);
55} 55}
56 56
57static void l2x0_inv_range(unsigned long start, unsigned long end) 57static void l2x0_inv_range(unsigned long start, unsigned long end)
@@ -59,7 +59,7 @@ static void l2x0_inv_range(unsigned long start, unsigned long end)
59 void __iomem *base = l2x0_base; 59 void __iomem *base = l2x0_base;
60 unsigned long flags; 60 unsigned long flags;
61 61
62 spin_lock_irqsave(&l2x0_lock, flags); 62 raw_spin_lock_irqsave(&l2x0_lock, flags);
63 if (start & (CACHE_LINE_SIZE - 1)) { 63 if (start & (CACHE_LINE_SIZE - 1)) {
64 start &= ~(CACHE_LINE_SIZE - 1); 64 start &= ~(CACHE_LINE_SIZE - 1);
65 cache_wait(base + L2X0_CLEAN_INV_LINE_PA, 1); 65 cache_wait(base + L2X0_CLEAN_INV_LINE_PA, 1);
@@ -83,13 +83,13 @@ static void l2x0_inv_range(unsigned long start, unsigned long end)
83 } 83 }
84 84
85 if (blk_end < end) { 85 if (blk_end < end) {
86 spin_unlock_irqrestore(&l2x0_lock, flags); 86 raw_spin_unlock_irqrestore(&l2x0_lock, flags);
87 spin_lock_irqsave(&l2x0_lock, flags); 87 raw_spin_lock_irqsave(&l2x0_lock, flags);
88 } 88 }
89 } 89 }
90 cache_wait(base + L2X0_INV_LINE_PA, 1); 90 cache_wait(base + L2X0_INV_LINE_PA, 1);
91 cache_sync(); 91 cache_sync();
92 spin_unlock_irqrestore(&l2x0_lock, flags); 92 raw_spin_unlock_irqrestore(&l2x0_lock, flags);
93} 93}
94 94
95static void l2x0_clean_range(unsigned long start, unsigned long end) 95static void l2x0_clean_range(unsigned long start, unsigned long end)
@@ -97,7 +97,7 @@ static void l2x0_clean_range(unsigned long start, unsigned long end)
97 void __iomem *base = l2x0_base; 97 void __iomem *base = l2x0_base;
98 unsigned long flags; 98 unsigned long flags;
99 99
100 spin_lock_irqsave(&l2x0_lock, flags); 100 raw_spin_lock_irqsave(&l2x0_lock, flags);
101 start &= ~(CACHE_LINE_SIZE - 1); 101 start &= ~(CACHE_LINE_SIZE - 1);
102 while (start < end) { 102 while (start < end) {
103 unsigned long blk_end = start + min(end - start, 4096UL); 103 unsigned long blk_end = start + min(end - start, 4096UL);
@@ -109,13 +109,13 @@ static void l2x0_clean_range(unsigned long start, unsigned long end)
109 } 109 }
110 110
111 if (blk_end < end) { 111 if (blk_end < end) {
112 spin_unlock_irqrestore(&l2x0_lock, flags); 112 raw_spin_unlock_irqrestore(&l2x0_lock, flags);
113 spin_lock_irqsave(&l2x0_lock, flags); 113 raw_spin_lock_irqsave(&l2x0_lock, flags);
114 } 114 }
115 } 115 }
116 cache_wait(base + L2X0_CLEAN_LINE_PA, 1); 116 cache_wait(base + L2X0_CLEAN_LINE_PA, 1);
117 cache_sync(); 117 cache_sync();
118 spin_unlock_irqrestore(&l2x0_lock, flags); 118 raw_spin_unlock_irqrestore(&l2x0_lock, flags);
119} 119}
120 120
121static void l2x0_flush_range(unsigned long start, unsigned long end) 121static void l2x0_flush_range(unsigned long start, unsigned long end)
@@ -123,7 +123,7 @@ static void l2x0_flush_range(unsigned long start, unsigned long end)
123 void __iomem *base = l2x0_base; 123 void __iomem *base = l2x0_base;
124 unsigned long flags; 124 unsigned long flags;
125 125
126 spin_lock_irqsave(&l2x0_lock, flags); 126 raw_spin_lock_irqsave(&l2x0_lock, flags);
127 start &= ~(CACHE_LINE_SIZE - 1); 127 start &= ~(CACHE_LINE_SIZE - 1);
128 while (start < end) { 128 while (start < end) {
129 unsigned long blk_end = start + min(end - start, 4096UL); 129 unsigned long blk_end = start + min(end - start, 4096UL);
@@ -135,13 +135,13 @@ static void l2x0_flush_range(unsigned long start, unsigned long end)
135 } 135 }
136 136
137 if (blk_end < end) { 137 if (blk_end < end) {
138 spin_unlock_irqrestore(&l2x0_lock, flags); 138 raw_spin_unlock_irqrestore(&l2x0_lock, flags);
139 spin_lock_irqsave(&l2x0_lock, flags); 139 raw_spin_lock_irqsave(&l2x0_lock, flags);
140 } 140 }
141 } 141 }
142 cache_wait(base + L2X0_CLEAN_INV_LINE_PA, 1); 142 cache_wait(base + L2X0_CLEAN_INV_LINE_PA, 1);
143 cache_sync(); 143 cache_sync();
144 spin_unlock_irqrestore(&l2x0_lock, flags); 144 raw_spin_unlock_irqrestore(&l2x0_lock, flags);
145} 145}
146 146
147void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask) 147void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask)
diff --git a/arch/arm/mm/context.c b/arch/arm/mm/context.c
index a9e22e31eaa1..ec7b776599a3 100644
--- a/arch/arm/mm/context.c
+++ b/arch/arm/mm/context.c
@@ -14,7 +14,7 @@
14#include <asm/mmu_context.h> 14#include <asm/mmu_context.h>
15#include <asm/tlbflush.h> 15#include <asm/tlbflush.h>
16 16
17static DEFINE_SPINLOCK(cpu_asid_lock); 17static DEFINE_RAW_SPINLOCK(cpu_asid_lock);
18unsigned int cpu_last_asid = ASID_FIRST_VERSION; 18unsigned int cpu_last_asid = ASID_FIRST_VERSION;
19 19
20/* 20/*
@@ -32,7 +32,7 @@ void __new_context(struct mm_struct *mm)
32{ 32{
33 unsigned int asid; 33 unsigned int asid;
34 34
35 spin_lock(&cpu_asid_lock); 35 raw_spin_lock(&cpu_asid_lock);
36 asid = ++cpu_last_asid; 36 asid = ++cpu_last_asid;
37 if (asid == 0) 37 if (asid == 0)
38 asid = cpu_last_asid = ASID_FIRST_VERSION; 38 asid = cpu_last_asid = ASID_FIRST_VERSION;
@@ -54,7 +54,7 @@ void __new_context(struct mm_struct *mm)
54 dsb(); 54 dsb();
55 } 55 }
56 } 56 }
57 spin_unlock(&cpu_asid_lock); 57 raw_spin_unlock(&cpu_asid_lock);
58 58
59 cpumask_copy(mm_cpumask(mm), cpumask_of(smp_processor_id())); 59 cpumask_copy(mm_cpumask(mm), cpumask_of(smp_processor_id()));
60 mm->context.id = asid; 60 mm->context.id = asid;
diff --git a/arch/arm/mm/copypage-v4mc.c b/arch/arm/mm/copypage-v4mc.c
index 7370a7142b04..9691c0261301 100644
--- a/arch/arm/mm/copypage-v4mc.c
+++ b/arch/arm/mm/copypage-v4mc.c
@@ -30,7 +30,7 @@
30#define minicache_pgprot __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | \ 30#define minicache_pgprot __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | \
31 L_PTE_MT_MINICACHE) 31 L_PTE_MT_MINICACHE)
32 32
33static DEFINE_SPINLOCK(minicache_lock); 33static DEFINE_RAW_SPINLOCK(minicache_lock);
34 34
35/* 35/*
36 * ARMv4 mini-dcache optimised copy_user_highpage 36 * ARMv4 mini-dcache optimised copy_user_highpage
@@ -76,14 +76,14 @@ void v4_mc_copy_user_highpage(struct page *to, struct page *from,
76 if (test_and_clear_bit(PG_dcache_dirty, &from->flags)) 76 if (test_and_clear_bit(PG_dcache_dirty, &from->flags))
77 __flush_dcache_page(page_mapping(from), from); 77 __flush_dcache_page(page_mapping(from), from);
78 78
79 spin_lock(&minicache_lock); 79 raw_spin_lock(&minicache_lock);
80 80
81 set_pte_ext(TOP_PTE(0xffff8000), pfn_pte(page_to_pfn(from), minicache_pgprot), 0); 81 set_pte_ext(TOP_PTE(0xffff8000), pfn_pte(page_to_pfn(from), minicache_pgprot), 0);
82 flush_tlb_kernel_page(0xffff8000); 82 flush_tlb_kernel_page(0xffff8000);
83 83
84 mc_copy_user_page((void *)0xffff8000, kto); 84 mc_copy_user_page((void *)0xffff8000, kto);
85 85
86 spin_unlock(&minicache_lock); 86 raw_spin_unlock(&minicache_lock);
87 87
88 kunmap_atomic(kto, KM_USER1); 88 kunmap_atomic(kto, KM_USER1);
89} 89}
diff --git a/arch/arm/mm/copypage-v6.c b/arch/arm/mm/copypage-v6.c
index 0fa1319273de..8000e55035e2 100644
--- a/arch/arm/mm/copypage-v6.c
+++ b/arch/arm/mm/copypage-v6.c
@@ -27,7 +27,7 @@
27#define from_address (0xffff8000) 27#define from_address (0xffff8000)
28#define to_address (0xffffc000) 28#define to_address (0xffffc000)
29 29
30static DEFINE_SPINLOCK(v6_lock); 30static DEFINE_RAW_SPINLOCK(v6_lock);
31 31
32/* 32/*
33 * Copy the user page. No aliasing to deal with so we can just 33 * Copy the user page. No aliasing to deal with so we can just
@@ -96,7 +96,7 @@ static void v6_copy_user_highpage_aliasing(struct page *to,
96 * Now copy the page using the same cache colour as the 96 * Now copy the page using the same cache colour as the
97 * pages ultimate destination. 97 * pages ultimate destination.
98 */ 98 */
99 spin_lock(&v6_lock); 99 raw_spin_lock(&v6_lock);
100 100
101 set_pte_ext(TOP_PTE(from_address) + offset, pfn_pte(page_to_pfn(from), PAGE_KERNEL), 0); 101 set_pte_ext(TOP_PTE(from_address) + offset, pfn_pte(page_to_pfn(from), PAGE_KERNEL), 0);
102 set_pte_ext(TOP_PTE(to_address) + offset, pfn_pte(page_to_pfn(to), PAGE_KERNEL), 0); 102 set_pte_ext(TOP_PTE(to_address) + offset, pfn_pte(page_to_pfn(to), PAGE_KERNEL), 0);
@@ -109,7 +109,7 @@ static void v6_copy_user_highpage_aliasing(struct page *to,
109 109
110 copy_page((void *)kto, (void *)kfrom); 110 copy_page((void *)kto, (void *)kfrom);
111 111
112 spin_unlock(&v6_lock); 112 raw_spin_unlock(&v6_lock);
113} 113}
114 114
115/* 115/*
@@ -129,13 +129,13 @@ static void v6_clear_user_highpage_aliasing(struct page *page, unsigned long vad
129 * Now clear the page using the same cache colour as 129 * Now clear the page using the same cache colour as
130 * the pages ultimate destination. 130 * the pages ultimate destination.
131 */ 131 */
132 spin_lock(&v6_lock); 132 raw_spin_lock(&v6_lock);
133 133
134 set_pte_ext(TOP_PTE(to_address) + offset, pfn_pte(page_to_pfn(page), PAGE_KERNEL), 0); 134 set_pte_ext(TOP_PTE(to_address) + offset, pfn_pte(page_to_pfn(page), PAGE_KERNEL), 0);
135 flush_tlb_kernel_page(to); 135 flush_tlb_kernel_page(to);
136 clear_page((void *)to); 136 clear_page((void *)to);
137 137
138 spin_unlock(&v6_lock); 138 raw_spin_unlock(&v6_lock);
139} 139}
140 140
141struct cpu_user_fns v6_user_fns __initdata = { 141struct cpu_user_fns v6_user_fns __initdata = {
diff --git a/arch/arm/mm/copypage-xscale.c b/arch/arm/mm/copypage-xscale.c
index 76824d3e966a..eddffc3c8fc6 100644
--- a/arch/arm/mm/copypage-xscale.c
+++ b/arch/arm/mm/copypage-xscale.c
@@ -32,7 +32,7 @@
32#define minicache_pgprot __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | \ 32#define minicache_pgprot __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | \
33 L_PTE_MT_MINICACHE) 33 L_PTE_MT_MINICACHE)
34 34
35static DEFINE_SPINLOCK(minicache_lock); 35static DEFINE_RAW_SPINLOCK(minicache_lock);
36 36
37/* 37/*
38 * XScale mini-dcache optimised copy_user_highpage 38 * XScale mini-dcache optimised copy_user_highpage
@@ -98,14 +98,14 @@ void xscale_mc_copy_user_highpage(struct page *to, struct page *from,
98 if (test_and_clear_bit(PG_dcache_dirty, &from->flags)) 98 if (test_and_clear_bit(PG_dcache_dirty, &from->flags))
99 __flush_dcache_page(page_mapping(from), from); 99 __flush_dcache_page(page_mapping(from), from);
100 100
101 spin_lock(&minicache_lock); 101 raw_spin_lock(&minicache_lock);
102 102
103 set_pte_ext(TOP_PTE(COPYPAGE_MINICACHE), pfn_pte(page_to_pfn(from), minicache_pgprot), 0); 103 set_pte_ext(TOP_PTE(COPYPAGE_MINICACHE), pfn_pte(page_to_pfn(from), minicache_pgprot), 0);
104 flush_tlb_kernel_page(COPYPAGE_MINICACHE); 104 flush_tlb_kernel_page(COPYPAGE_MINICACHE);
105 105
106 mc_copy_user_page((void *)COPYPAGE_MINICACHE, kto); 106 mc_copy_user_page((void *)COPYPAGE_MINICACHE, kto);
107 107
108 spin_unlock(&minicache_lock); 108 raw_spin_unlock(&minicache_lock);
109 109
110 kunmap_atomic(kto, KM_USER1); 110 kunmap_atomic(kto, KM_USER1);
111} 111}
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
index 10e06801afb3..7aa9b88bd1a1 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
@@ -273,7 +273,7 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
273 * If we're in an interrupt or have no user 273 * If we're in an interrupt or have no user
274 * context, we must not take the fault.. 274 * context, we must not take the fault..
275 */ 275 */
276 if (in_atomic() || !mm) 276 if (in_atomic() || !mm || current->pagefault_disabled)
277 goto no_context; 277 goto no_context;
278 278
279 /* 279 /*
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 761ffede6a23..627426d219a1 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -30,8 +30,6 @@
30 30
31#include "mm.h" 31#include "mm.h"
32 32
33DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
34
35/* 33/*
36 * empty_zero_page is a special page that is used for 34 * empty_zero_page is a special page that is used for
37 * zero-initialized data and COW. 35 * zero-initialized data and COW.
diff --git a/arch/arm/oprofile/common.c b/arch/arm/oprofile/common.c
index 3fcd752d6146..54a182b61d72 100644
--- a/arch/arm/oprofile/common.c
+++ b/arch/arm/oprofile/common.c
@@ -48,9 +48,9 @@ static int op_arm_setup(void)
48{ 48{
49 int ret; 49 int ret;
50 50
51 spin_lock(&oprofilefs_lock); 51 raw_spin_lock(&oprofilefs_lock);
52 ret = op_arm_model->setup_ctrs(); 52 ret = op_arm_model->setup_ctrs();
53 spin_unlock(&oprofilefs_lock); 53 raw_spin_unlock(&oprofilefs_lock);
54 return ret; 54 return ret;
55} 55}
56 56
diff --git a/arch/arm/oprofile/op_model_xscale.c b/arch/arm/oprofile/op_model_xscale.c
index 724ab9ce2526..cbe91ee7f6e0 100644
--- a/arch/arm/oprofile/op_model_xscale.c
+++ b/arch/arm/oprofile/op_model_xscale.c
@@ -381,8 +381,9 @@ static int xscale_pmu_start(void)
381{ 381{
382 int ret; 382 int ret;
383 u32 pmnc = read_pmnc(); 383 u32 pmnc = read_pmnc();
384 unsigned long irq_flags = IRQF_DISABLED | IRQF_NODELAY;
384 385
385 ret = request_irq(XSCALE_PMU_IRQ, xscale_pmu_interrupt, IRQF_DISABLED, 386 ret = request_irq(XSCALE_PMU_IRQ, xscale_pmu_interrupt, irq_flags,
386 "XScale PMU", (void *)results); 387 "XScale PMU", (void *)results);
387 388
388 if (ret < 0) { 389 if (ret < 0) {
diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c
index 4becbdd1935c..50f299b75f8f 100644
--- a/arch/arm/plat-omap/clock.c
+++ b/arch/arm/plat-omap/clock.c
@@ -78,15 +78,12 @@ EXPORT_SYMBOL(clk_disable);
78 78
79unsigned long clk_get_rate(struct clk *clk) 79unsigned long clk_get_rate(struct clk *clk)
80{ 80{
81 unsigned long flags;
82 unsigned long ret = 0; 81 unsigned long ret = 0;
83 82
84 if (clk == NULL || IS_ERR(clk)) 83 if (clk == NULL || IS_ERR(clk))
85 return 0; 84 return 0;
86 85
87 spin_lock_irqsave(&clockfw_lock, flags);
88 ret = clk->rate; 86 ret = clk->rate;
89 spin_unlock_irqrestore(&clockfw_lock, flags);
90 87
91 return ret; 88 return ret;
92} 89}