aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/kernel/process.c10
-rw-r--r--arch/arm/Kconfig10
-rw-r--r--arch/arm/boot/compressed/misc.c6
-rw-r--r--arch/arm/common/scoop.c6
-rw-r--r--arch/arm/kernel/armksyms.c4
-rw-r--r--arch/arm/kernel/entry-armv.S7
-rw-r--r--arch/arm/kernel/irq.c3
-rw-r--r--arch/arm/kernel/process.c20
-rw-r--r--arch/arm/kernel/smp.c47
-rw-r--r--arch/arm/lib/bitops.h4
-rw-r--r--arch/arm/mach-omap1/leds-h2p2-debug.c1
-rw-r--r--arch/arm/mach-pxa/corgi.c48
-rw-r--r--arch/arm/mach-pxa/poodle.c32
-rw-r--r--arch/arm/mach-pxa/spitz.c95
-rw-r--r--arch/arm/mach-pxa/time.c8
-rw-r--r--arch/arm/mach-pxa/tosa.c152
-rw-r--r--arch/arm/mach-realview/Makefile2
-rw-r--r--arch/arm/mach-realview/core.c5
-rw-r--r--arch/arm/mach-realview/hotplug.c138
-rw-r--r--arch/arm/mach-realview/localtimer.c130
-rw-r--r--arch/arm/mach-realview/platsmp.c15
-rw-r--r--arch/arm/mach-s3c2410/Kconfig8
-rw-r--r--arch/arm/mach-s3c2410/mach-anubis.c51
-rw-r--r--arch/arm/mach-s3c2410/mach-bast.c73
-rw-r--r--arch/arm/mach-s3c2410/mach-rx3715.c13
-rw-r--r--arch/arm/mach-s3c2410/mach-smdk2440.c23
-rw-r--r--arch/arm/mach-s3c2410/mach-vr1000.c56
-rw-r--r--arch/arm/mach-sa1100/time.c8
-rw-r--r--arch/arm/plat-omap/ocpi.c1
-rw-r--r--arch/arm26/kernel/process.c12
-rw-r--r--arch/cris/arch-v10/drivers/pcf8563.c1
-rw-r--r--arch/cris/arch-v10/kernel/fasttimer.c1
-rw-r--r--arch/cris/arch-v32/drivers/nandflash.c1
-rw-r--r--arch/cris/arch-v32/drivers/pcf8563.c1
-rw-r--r--arch/cris/arch-v32/kernel/smp.c1
-rw-r--r--arch/cris/kernel/process.c2
-rw-r--r--arch/frv/kernel/process.c6
-rw-r--r--arch/h8300/kernel/process.c28
-rw-r--r--arch/i386/kernel/apm.c20
-rw-r--r--arch/i386/kernel/process.c68
-rw-r--r--arch/i386/kernel/setup.c2
-rw-r--r--arch/i386/kernel/smpboot.c1
-rw-r--r--arch/ia64/ia32/ia32_ioctl.c4
-rw-r--r--arch/ia64/kernel/mca_drv.c3
-rw-r--r--arch/ia64/kernel/process.c34
-rw-r--r--arch/ia64/kernel/smpboot.c1
-rw-r--r--arch/ia64/sn/pci/pcibr/pcibr_provider.c4
-rw-r--r--arch/ia64/sn/pci/pcibr/pcibr_reg.c2
-rw-r--r--arch/m32r/kernel/process.c2
-rw-r--r--arch/m32r/kernel/smpboot.c1
-rw-r--r--arch/m68k/kernel/process.c2
-rw-r--r--arch/mips/au1000/common/setup.c11
-rw-r--r--arch/mips/configs/ddb5476_defconfig1
-rw-r--r--arch/mips/configs/jmr3927_defconfig1
-rw-r--r--arch/mips/configs/ocelot_3_defconfig1
-rw-r--r--arch/mips/configs/pnx8550-v2pci_defconfig1
-rw-r--r--arch/mips/configs/rbhma4500_defconfig1
-rw-r--r--arch/mips/kernel/ioctl32.c4
-rw-r--r--arch/mips/kernel/process.c2
-rw-r--r--arch/mips/kernel/smp.c4
-rw-r--r--arch/mips/tx4938/toshiba_rbtx4938/irq.c1
-rw-r--r--arch/parisc/kernel/asm-offsets.c1
-rw-r--r--arch/parisc/kernel/process.c4
-rw-r--r--arch/parisc/kernel/smp.c1
-rw-r--r--arch/powerpc/kernel/smp.c1
-rw-r--r--arch/powerpc/kernel/traps.c4
-rw-r--r--arch/powerpc/kernel/vio.c27
-rw-r--r--arch/powerpc/platforms/iseries/setup.c14
-rw-r--r--arch/powerpc/platforms/pseries/setup.c16
-rw-r--r--arch/ppc/configs/mpc834x_sys_defconfig431
-rw-r--r--arch/ppc/kernel/idle.c25
-rw-r--r--arch/ppc/kernel/smp.c1
-rw-r--r--arch/ppc/platforms/83xx/mpc834x_sys.c23
-rw-r--r--arch/ppc/platforms/85xx/stx_gp3.h1
-rw-r--r--arch/ppc/syslib/Makefile2
-rw-r--r--arch/ppc/syslib/mpc83xx_devices.c12
-rw-r--r--arch/ppc/syslib/mpc83xx_sys.c24
-rw-r--r--arch/ppc/syslib/prom.c1
-rw-r--r--arch/ppc/syslib/prom_init.c1
-rw-r--r--arch/ppc64/kernel/idle.c15
-rw-r--r--arch/s390/appldata/appldata_base.c7
-rw-r--r--arch/s390/kernel/debug.c12
-rw-r--r--arch/s390/kernel/process.c24
-rw-r--r--arch/s390/kernel/smp.c1
-rw-r--r--arch/s390/mm/fault.c2
-rw-r--r--arch/sh/kernel/process.c14
-rw-r--r--arch/sh/kernel/smp.c5
-rw-r--r--arch/sh64/kernel/process.c16
-rw-r--r--arch/sparc/kernel/cpu.c4
-rw-r--r--arch/sparc/kernel/pcic.c2
-rw-r--r--arch/sparc/kernel/process.c35
-rw-r--r--arch/sparc/mm/fault.c2
-rw-r--r--arch/sparc64/kernel/cpu.c4
-rw-r--r--arch/sparc64/kernel/ioctl32.c6
-rw-r--r--arch/sparc64/kernel/process.c24
-rw-r--r--arch/sparc64/kernel/sbus.c2
-rw-r--r--arch/sparc64/kernel/smp.c16
-rw-r--r--arch/sparc64/mm/fault.c4
-rw-r--r--arch/um/drivers/net_kern.c38
-rw-r--r--arch/v850/kernel/process.c16
-rw-r--r--arch/x86_64/ia32/ia32_ioctl.c6
-rw-r--r--arch/x86_64/kernel/process.c69
-rw-r--r--arch/x86_64/kernel/smpboot.c1
-rw-r--r--arch/xtensa/kernel/process.c3
-rw-r--r--arch/xtensa/platform-iss/network.c33
105 files changed, 1533 insertions, 617 deletions
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c
index eb20c3afff58..a8682612abc0 100644
--- a/arch/alpha/kernel/process.c
+++ b/arch/alpha/kernel/process.c
@@ -43,21 +43,17 @@
43#include "proto.h" 43#include "proto.h"
44#include "pci_impl.h" 44#include "pci_impl.h"
45 45
46void default_idle(void)
47{
48 barrier();
49}
50
51void 46void
52cpu_idle(void) 47cpu_idle(void)
53{ 48{
49 set_thread_flag(TIF_POLLING_NRFLAG);
50
54 while (1) { 51 while (1) {
55 void (*idle)(void) = default_idle;
56 /* FIXME -- EV6 and LCA45 know how to power down 52 /* FIXME -- EV6 and LCA45 know how to power down
57 the CPU. */ 53 the CPU. */
58 54
59 while (!need_resched()) 55 while (!need_resched())
60 idle(); 56 cpu_relax();
61 schedule(); 57 schedule();
62 } 58 }
63} 59}
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 91d5ef3397be..ec77721507cb 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -356,6 +356,16 @@ config HOTPLUG_CPU
356 Say Y here to experiment with turning CPUs off and on. CPUs 356 Say Y here to experiment with turning CPUs off and on. CPUs
357 can be controlled through /sys/devices/system/cpu. 357 can be controlled through /sys/devices/system/cpu.
358 358
359config LOCAL_TIMERS
360 bool "Use local timer interrupts"
361 depends on SMP && REALVIEW_MPCORE
362 default y
363 help
364 Enable support for local timers on SMP platforms, rather then the
365 legacy IPI broadcast method. Local timers allows the system
366 accounting to be spread across the timer interval, preventing a
367 "thundering herd" at every timer tick.
368
359config PREEMPT 369config PREEMPT
360 bool "Preemptible Kernel (EXPERIMENTAL)" 370 bool "Preemptible Kernel (EXPERIMENTAL)"
361 depends on EXPERIMENTAL 371 depends on EXPERIMENTAL
diff --git a/arch/arm/boot/compressed/misc.c b/arch/arm/boot/compressed/misc.c
index 50f13eec6cd7..5ab94584baee 100644
--- a/arch/arm/boot/compressed/misc.c
+++ b/arch/arm/boot/compressed/misc.c
@@ -283,8 +283,14 @@ void flush_window(void)
283 putstr("."); 283 putstr(".");
284} 284}
285 285
286#ifndef arch_error
287#define arch_error(x)
288#endif
289
286static void error(char *x) 290static void error(char *x)
287{ 291{
292 arch_error(x);
293
288 putstr("\n\n"); 294 putstr("\n\n");
289 putstr(x); 295 putstr(x);
290 putstr("\n\n -- System halted"); 296 putstr("\n\n -- System halted");
diff --git a/arch/arm/common/scoop.c b/arch/arm/common/scoop.c
index bb4eff614413..c7fdf390cef9 100644
--- a/arch/arm/common/scoop.c
+++ b/arch/arm/common/scoop.c
@@ -19,12 +19,6 @@
19 19
20#define SCOOP_REG(d,adr) (*(volatile unsigned short*)(d +(adr))) 20#define SCOOP_REG(d,adr) (*(volatile unsigned short*)(d +(adr)))
21 21
22/* PCMCIA to Scoop linkage structures for pxa2xx_sharpsl.c
23 There is no easy way to link multiple scoop devices into one
24 single entity for the pxa2xx_pcmcia device */
25int scoop_num;
26struct scoop_pcmcia_dev *scoop_devs;
27
28struct scoop_dev { 22struct scoop_dev {
29 void *base; 23 void *base;
30 spinlock_t scoop_lock; 24 spinlock_t scoop_lock;
diff --git a/arch/arm/kernel/armksyms.c b/arch/arm/kernel/armksyms.c
index 7b17a87a3311..7a3261f0bf79 100644
--- a/arch/arm/kernel/armksyms.c
+++ b/arch/arm/kernel/armksyms.c
@@ -9,6 +9,7 @@
9 */ 9 */
10#include <linux/module.h> 10#include <linux/module.h>
11#include <linux/string.h> 11#include <linux/string.h>
12#include <linux/cryptohash.h>
12#include <linux/delay.h> 13#include <linux/delay.h>
13#include <linux/in6.h> 14#include <linux/in6.h>
14#include <linux/syscalls.h> 15#include <linux/syscalls.h>
@@ -126,6 +127,9 @@ EXPORT_SYMBOL(__put_user_2);
126EXPORT_SYMBOL(__put_user_4); 127EXPORT_SYMBOL(__put_user_4);
127EXPORT_SYMBOL(__put_user_8); 128EXPORT_SYMBOL(__put_user_8);
128 129
130 /* crypto hash */
131EXPORT_SYMBOL(sha_transform);
132
129 /* gcc lib functions */ 133 /* gcc lib functions */
130EXPORT_SYMBOL(__ashldi3); 134EXPORT_SYMBOL(__ashldi3);
131EXPORT_SYMBOL(__ashrdi3); 135EXPORT_SYMBOL(__ashrdi3);
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index a511ec5b11a3..d9fb819bf7cc 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -47,6 +47,13 @@
47 movne r0, sp 47 movne r0, sp
48 adrne lr, 1b 48 adrne lr, 1b
49 bne do_IPI 49 bne do_IPI
50
51#ifdef CONFIG_LOCAL_TIMERS
52 test_for_ltirq r0, r6, r5, lr
53 movne r0, sp
54 adrne lr, 1b
55 bne do_local_timer
56#endif
50#endif 57#endif
51 58
52 .endm 59 .endm
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index 9def4404e1f2..d7099dbbb879 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -264,6 +264,7 @@ unlock:
264#endif 264#endif
265#ifdef CONFIG_SMP 265#ifdef CONFIG_SMP
266 show_ipi_list(p); 266 show_ipi_list(p);
267 show_local_irqs(p);
267#endif 268#endif
268 seq_printf(p, "Err: %10lu\n", irq_err_count); 269 seq_printf(p, "Err: %10lu\n", irq_err_count);
269 } 270 }
@@ -995,7 +996,7 @@ void __init init_irq_proc(void)
995 struct proc_dir_entry *dir; 996 struct proc_dir_entry *dir;
996 int irq; 997 int irq;
997 998
998 dir = proc_mkdir("irq", 0); 999 dir = proc_mkdir("irq", NULL);
999 if (!dir) 1000 if (!dir)
1000 return; 1001 return;
1001 1002
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index ba298277becd..30494aab829a 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -86,12 +86,16 @@ EXPORT_SYMBOL(pm_power_off);
86 */ 86 */
87void default_idle(void) 87void default_idle(void)
88{ 88{
89 local_irq_disable(); 89 if (hlt_counter)
90 if (!need_resched() && !hlt_counter) { 90 cpu_relax();
91 timer_dyn_reprogram(); 91 else {
92 arch_idle(); 92 local_irq_disable();
93 if (!need_resched()) {
94 timer_dyn_reprogram();
95 arch_idle();
96 }
97 local_irq_enable();
93 } 98 }
94 local_irq_enable();
95} 99}
96 100
97/* 101/*
@@ -116,13 +120,13 @@ void cpu_idle(void)
116 120
117 if (!idle) 121 if (!idle)
118 idle = default_idle; 122 idle = default_idle;
119 preempt_disable();
120 leds_event(led_idle_start); 123 leds_event(led_idle_start);
121 while (!need_resched()) 124 while (!need_resched())
122 idle(); 125 idle();
123 leds_event(led_idle_end); 126 leds_event(led_idle_end);
124 preempt_enable(); 127 preempt_enable_no_resched();
125 schedule(); 128 schedule();
129 preempt_disable();
126 } 130 }
127} 131}
128 132
@@ -355,7 +359,7 @@ copy_thread(int nr, unsigned long clone_flags, unsigned long stack_start,
355 struct thread_info *thread = p->thread_info; 359 struct thread_info *thread = p->thread_info;
356 struct pt_regs *childregs; 360 struct pt_regs *childregs;
357 361
358 childregs = ((struct pt_regs *)((unsigned long)thread + THREAD_START_SP)) - 1; 362 childregs = (void *)thread + THREAD_START_SP - sizeof(*regs);
359 *childregs = *regs; 363 *childregs = *regs;
360 childregs->ARM_r0 = 0; 364 childregs->ARM_r0 = 0;
361 childregs->ARM_sp = stack_start; 365 childregs->ARM_sp = stack_start;
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index edb5a406922f..e55ea952f7aa 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -142,7 +142,7 @@ int __cpuinit __cpu_up(unsigned int cpu)
142 ret = -EIO; 142 ret = -EIO;
143 } 143 }
144 144
145 secondary_data.stack = 0; 145 secondary_data.stack = NULL;
146 secondary_data.pgdir = 0; 146 secondary_data.pgdir = 0;
147 147
148 *pmd_offset(pgd, PHYS_OFFSET) = __pmd(0); 148 *pmd_offset(pgd, PHYS_OFFSET) = __pmd(0);
@@ -185,6 +185,11 @@ int __cpuexit __cpu_disable(void)
185 migrate_irqs(); 185 migrate_irqs();
186 186
187 /* 187 /*
188 * Stop the local timer for this CPU.
189 */
190 local_timer_stop(cpu);
191
192 /*
188 * Flush user cache and TLB mappings, and then remove this CPU 193 * Flush user cache and TLB mappings, and then remove this CPU
189 * from the vm mask set of all processes. 194 * from the vm mask set of all processes.
190 */ 195 */
@@ -251,7 +256,9 @@ void __cpuexit cpu_die(void)
251asmlinkage void __cpuinit secondary_start_kernel(void) 256asmlinkage void __cpuinit secondary_start_kernel(void)
252{ 257{
253 struct mm_struct *mm = &init_mm; 258 struct mm_struct *mm = &init_mm;
254 unsigned int cpu = smp_processor_id(); 259 unsigned int cpu;
260
261 cpu = smp_processor_id();
255 262
256 printk("CPU%u: Booted secondary processor\n", cpu); 263 printk("CPU%u: Booted secondary processor\n", cpu);
257 264
@@ -268,6 +275,7 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
268 local_flush_tlb_all(); 275 local_flush_tlb_all();
269 276
270 cpu_init(); 277 cpu_init();
278 preempt_disable();
271 279
272 /* 280 /*
273 * Give the platform a chance to do its own initialisation. 281 * Give the platform a chance to do its own initialisation.
@@ -290,6 +298,11 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
290 cpu_set(cpu, cpu_online_map); 298 cpu_set(cpu, cpu_online_map);
291 299
292 /* 300 /*
301 * Setup local timer for this CPU.
302 */
303 local_timer_setup(cpu);
304
305 /*
293 * OK, it's off to the idle thread for us 306 * OK, it's off to the idle thread for us
294 */ 307 */
295 cpu_idle(); 308 cpu_idle();
@@ -359,8 +372,8 @@ static void send_ipi_message(cpumask_t callmap, enum ipi_msg_type msg)
359 * You must not call this function with disabled interrupts, from a 372 * You must not call this function with disabled interrupts, from a
360 * hardware interrupt handler, nor from a bottom half handler. 373 * hardware interrupt handler, nor from a bottom half handler.
361 */ 374 */
362int smp_call_function_on_cpu(void (*func)(void *info), void *info, int retry, 375static int smp_call_function_on_cpu(void (*func)(void *info), void *info,
363 int wait, cpumask_t callmap) 376 int retry, int wait, cpumask_t callmap)
364{ 377{
365 struct smp_call_struct data; 378 struct smp_call_struct data;
366 unsigned long timeout; 379 unsigned long timeout;
@@ -454,6 +467,18 @@ void show_ipi_list(struct seq_file *p)
454 seq_putc(p, '\n'); 467 seq_putc(p, '\n');
455} 468}
456 469
470void show_local_irqs(struct seq_file *p)
471{
472 unsigned int cpu;
473
474 seq_printf(p, "LOC: ");
475
476 for_each_present_cpu(cpu)
477 seq_printf(p, "%10u ", irq_stat[cpu].local_timer_irqs);
478
479 seq_putc(p, '\n');
480}
481
457static void ipi_timer(struct pt_regs *regs) 482static void ipi_timer(struct pt_regs *regs)
458{ 483{
459 int user = user_mode(regs); 484 int user = user_mode(regs);
@@ -464,6 +489,18 @@ static void ipi_timer(struct pt_regs *regs)
464 irq_exit(); 489 irq_exit();
465} 490}
466 491
492#ifdef CONFIG_LOCAL_TIMERS
493asmlinkage void do_local_timer(struct pt_regs *regs)
494{
495 int cpu = smp_processor_id();
496
497 if (local_timer_ack()) {
498 irq_stat[cpu].local_timer_irqs++;
499 ipi_timer(regs);
500 }
501}
502#endif
503
467/* 504/*
468 * ipi_call_function - handle IPI from smp_call_function() 505 * ipi_call_function - handle IPI from smp_call_function()
469 * 506 *
@@ -515,7 +552,7 @@ static void ipi_cpu_stop(unsigned int cpu)
515 * 552 *
516 * Bit 0 - Inter-processor function call 553 * Bit 0 - Inter-processor function call
517 */ 554 */
518void do_IPI(struct pt_regs *regs) 555asmlinkage void do_IPI(struct pt_regs *regs)
519{ 556{
520 unsigned int cpu = smp_processor_id(); 557 unsigned int cpu = smp_processor_id();
521 struct ipi_data *ipi = &per_cpu(ipi_data, cpu); 558 struct ipi_data *ipi = &per_cpu(ipi_data, cpu);
diff --git a/arch/arm/lib/bitops.h b/arch/arm/lib/bitops.h
index f35d91fbe117..b8c14e936697 100644
--- a/arch/arm/lib/bitops.h
+++ b/arch/arm/lib/bitops.h
@@ -34,7 +34,7 @@
34 and r2, r0, #7 34 and r2, r0, #7
35 mov r3, #1 35 mov r3, #1
36 mov r3, r3, lsl r2 36 mov r3, r3, lsl r2
37 save_and_disable_irqs ip, r2 37 save_and_disable_irqs ip
38 ldrb r2, [r1, r0, lsr #3] 38 ldrb r2, [r1, r0, lsr #3]
39 \instr r2, r2, r3 39 \instr r2, r2, r3
40 strb r2, [r1, r0, lsr #3] 40 strb r2, [r1, r0, lsr #3]
@@ -54,7 +54,7 @@
54 add r1, r1, r0, lsr #3 54 add r1, r1, r0, lsr #3
55 and r3, r0, #7 55 and r3, r0, #7
56 mov r0, #1 56 mov r0, #1
57 save_and_disable_irqs ip, r2 57 save_and_disable_irqs ip
58 ldrb r2, [r1] 58 ldrb r2, [r1]
59 tst r2, r0, lsl r3 59 tst r2, r0, lsl r3
60 \instr r2, r2, r0, lsl r3 60 \instr r2, r2, r0, lsl r3
diff --git a/arch/arm/mach-omap1/leds-h2p2-debug.c b/arch/arm/mach-omap1/leds-h2p2-debug.c
index be283cda63dd..399010c14036 100644
--- a/arch/arm/mach-omap1/leds-h2p2-debug.c
+++ b/arch/arm/mach-omap1/leds-h2p2-debug.c
@@ -13,7 +13,6 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/kernel_stat.h> 14#include <linux/kernel_stat.h>
15#include <linux/sched.h> 15#include <linux/sched.h>
16#include <linux/version.h>
17 16
18#include <asm/io.h> 17#include <asm/io.h>
19#include <asm/hardware.h> 18#include <asm/hardware.h>
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c
index eb5f6d744a4a..100fb31b5156 100644
--- a/arch/arm/mach-pxa/corgi.c
+++ b/arch/arm/mach-pxa/corgi.c
@@ -62,6 +62,37 @@ static struct scoop_config corgi_scoop_setup = {
62 .io_out = CORGI_SCOOP_IO_OUT, 62 .io_out = CORGI_SCOOP_IO_OUT,
63}; 63};
64 64
65struct platform_device corgiscoop_device = {
66 .name = "sharp-scoop",
67 .id = -1,
68 .dev = {
69 .platform_data = &corgi_scoop_setup,
70 },
71 .num_resources = ARRAY_SIZE(corgi_scoop_resources),
72 .resource = corgi_scoop_resources,
73};
74
75static void corgi_pcmcia_init(void)
76{
77 /* Setup default state of GPIO outputs
78 before we enable them as outputs. */
79 GPSR(GPIO48_nPOE) = GPIO_bit(GPIO48_nPOE) |
80 GPIO_bit(GPIO49_nPWE) | GPIO_bit(GPIO50_nPIOR) |
81 GPIO_bit(GPIO51_nPIOW) | GPIO_bit(GPIO52_nPCE_1) |
82 GPIO_bit(GPIO53_nPCE_2);
83
84 pxa_gpio_mode(GPIO48_nPOE_MD);
85 pxa_gpio_mode(GPIO49_nPWE_MD);
86 pxa_gpio_mode(GPIO50_nPIOR_MD);
87 pxa_gpio_mode(GPIO51_nPIOW_MD);
88 pxa_gpio_mode(GPIO55_nPREG_MD);
89 pxa_gpio_mode(GPIO56_nPWAIT_MD);
90 pxa_gpio_mode(GPIO57_nIOIS16_MD);
91 pxa_gpio_mode(GPIO52_nPCE_1_MD);
92 pxa_gpio_mode(GPIO53_nPCE_2_MD);
93 pxa_gpio_mode(GPIO54_pSKTSEL_MD);
94}
95
65static struct scoop_pcmcia_dev corgi_pcmcia_scoop[] = { 96static struct scoop_pcmcia_dev corgi_pcmcia_scoop[] = {
66{ 97{
67 .dev = &corgiscoop_device.dev, 98 .dev = &corgiscoop_device.dev,
@@ -71,16 +102,14 @@ static struct scoop_pcmcia_dev corgi_pcmcia_scoop[] = {
71}, 102},
72}; 103};
73 104
74struct platform_device corgiscoop_device = { 105static struct scoop_pcmcia_config corgi_pcmcia_config = {
75 .name = "sharp-scoop", 106 .devs = &corgi_pcmcia_scoop[0],
76 .id = -1, 107 .num_devs = 1,
77 .dev = { 108 .pcmcia_init = corgi_pcmcia_init,
78 .platform_data = &corgi_scoop_setup,
79 },
80 .num_resources = ARRAY_SIZE(corgi_scoop_resources),
81 .resource = corgi_scoop_resources,
82}; 109};
83 110
111EXPORT_SYMBOL(corgiscoop_device);
112
84 113
85/* 114/*
86 * Corgi SSP Device 115 * Corgi SSP Device
@@ -294,8 +323,7 @@ static void __init corgi_init(void)
294 pxa_set_mci_info(&corgi_mci_platform_data); 323 pxa_set_mci_info(&corgi_mci_platform_data);
295 pxa_set_ficp_info(&corgi_ficp_platform_data); 324 pxa_set_ficp_info(&corgi_ficp_platform_data);
296 325
297 scoop_num = 1; 326 platform_scoop_config = &corgi_pcmcia_config;
298 scoop_devs = &corgi_pcmcia_scoop[0];
299 327
300 platform_add_devices(devices, ARRAY_SIZE(devices)); 328 platform_add_devices(devices, ARRAY_SIZE(devices));
301} 329}
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
index ad6a13f95a62..eef3de26ad37 100644
--- a/arch/arm/mach-pxa/poodle.c
+++ b/arch/arm/mach-pxa/poodle.c
@@ -65,6 +65,27 @@ struct platform_device poodle_scoop_device = {
65 .resource = poodle_scoop_resources, 65 .resource = poodle_scoop_resources,
66}; 66};
67 67
68static void poodle_pcmcia_init(void)
69{
70 /* Setup default state of GPIO outputs
71 before we enable them as outputs. */
72 GPSR(GPIO48_nPOE) = GPIO_bit(GPIO48_nPOE) |
73 GPIO_bit(GPIO49_nPWE) | GPIO_bit(GPIO50_nPIOR) |
74 GPIO_bit(GPIO51_nPIOW) | GPIO_bit(GPIO52_nPCE_1) |
75 GPIO_bit(GPIO53_nPCE_2);
76
77 pxa_gpio_mode(GPIO48_nPOE_MD);
78 pxa_gpio_mode(GPIO49_nPWE_MD);
79 pxa_gpio_mode(GPIO50_nPIOR_MD);
80 pxa_gpio_mode(GPIO51_nPIOW_MD);
81 pxa_gpio_mode(GPIO55_nPREG_MD);
82 pxa_gpio_mode(GPIO56_nPWAIT_MD);
83 pxa_gpio_mode(GPIO57_nIOIS16_MD);
84 pxa_gpio_mode(GPIO52_nPCE_1_MD);
85 pxa_gpio_mode(GPIO53_nPCE_2_MD);
86 pxa_gpio_mode(GPIO54_pSKTSEL_MD);
87}
88
68static struct scoop_pcmcia_dev poodle_pcmcia_scoop[] = { 89static struct scoop_pcmcia_dev poodle_pcmcia_scoop[] = {
69{ 90{
70 .dev = &poodle_scoop_device.dev, 91 .dev = &poodle_scoop_device.dev,
@@ -74,6 +95,14 @@ static struct scoop_pcmcia_dev poodle_pcmcia_scoop[] = {
74}, 95},
75}; 96};
76 97
98static struct scoop_pcmcia_config poodle_pcmcia_config = {
99 .devs = &poodle_pcmcia_scoop[0],
100 .num_devs = 1,
101 .pcmcia_init = poodle_pcmcia_init,
102};
103
104EXPORT_SYMBOL(poodle_scoop_device);
105
77 106
78/* LoCoMo device */ 107/* LoCoMo device */
79static struct resource locomo_resources[] = { 108static struct resource locomo_resources[] = {
@@ -268,8 +297,7 @@ static void __init poodle_init(void)
268 pxa_set_mci_info(&poodle_mci_platform_data); 297 pxa_set_mci_info(&poodle_mci_platform_data);
269 pxa_set_ficp_info(&poodle_ficp_platform_data); 298 pxa_set_ficp_info(&poodle_ficp_platform_data);
270 299
271 scoop_num = 1; 300 platform_scoop_config = &poodle_pcmcia_config;
272 scoop_devs = &poodle_pcmcia_scoop[0];
273 301
274 ret = platform_add_devices(devices, ARRAY_SIZE(devices)); 302 ret = platform_add_devices(devices, ARRAY_SIZE(devices));
275 if (ret) { 303 if (ret) {
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index 6c6878cd2207..4e9a699ee428 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -104,6 +104,66 @@ struct platform_device spitzscoop2_device = {
104 .resource = spitz_scoop2_resources, 104 .resource = spitz_scoop2_resources,
105}; 105};
106 106
107#define SPITZ_PWR_SD 0x01
108#define SPITZ_PWR_CF 0x02
109
110/* Power control is shared with between one of the CF slots and SD */
111static void spitz_card_pwr_ctrl(int device, unsigned short new_cpr)
112{
113 unsigned short cpr = read_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR);
114
115 if (new_cpr & 0x0007) {
116 set_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_CF_POWER);
117 if (!(cpr & 0x0002) && !(cpr & 0x0004))
118 mdelay(5);
119 if (device == SPITZ_PWR_CF)
120 cpr |= 0x0002;
121 if (device == SPITZ_PWR_SD)
122 cpr |= 0x0004;
123 write_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR, cpr | new_cpr);
124 } else {
125 if (device == SPITZ_PWR_CF)
126 cpr &= ~0x0002;
127 if (device == SPITZ_PWR_SD)
128 cpr &= ~0x0004;
129 write_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR, cpr | new_cpr);
130 if (!(cpr & 0x0002) && !(cpr & 0x0004)) {
131 mdelay(1);
132 reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_CF_POWER);
133 }
134 }
135}
136
137static void spitz_pcmcia_init(void)
138{
139 /* Setup default state of GPIO outputs
140 before we enable them as outputs. */
141 GPSR(GPIO48_nPOE) = GPIO_bit(GPIO48_nPOE) |
142 GPIO_bit(GPIO49_nPWE) | GPIO_bit(GPIO50_nPIOR) |
143 GPIO_bit(GPIO51_nPIOW) | GPIO_bit(GPIO54_nPCE_2);
144 GPSR(GPIO85_nPCE_1) = GPIO_bit(GPIO85_nPCE_1);
145
146 pxa_gpio_mode(GPIO48_nPOE_MD);
147 pxa_gpio_mode(GPIO49_nPWE_MD);
148 pxa_gpio_mode(GPIO50_nPIOR_MD);
149 pxa_gpio_mode(GPIO51_nPIOW_MD);
150 pxa_gpio_mode(GPIO55_nPREG_MD);
151 pxa_gpio_mode(GPIO56_nPWAIT_MD);
152 pxa_gpio_mode(GPIO57_nIOIS16_MD);
153 pxa_gpio_mode(GPIO85_nPCE_1_MD);
154 pxa_gpio_mode(GPIO54_nPCE_2_MD);
155 pxa_gpio_mode(GPIO104_pSKTSEL_MD);
156}
157
158static void spitz_pcmcia_pwr(struct device *scoop, unsigned short cpr, int nr)
159{
160 /* Only need to override behaviour for slot 0 */
161 if (nr == 0)
162 spitz_card_pwr_ctrl(SPITZ_PWR_CF, cpr);
163 else
164 write_scoop_reg(scoop, SCOOP_CPR, cpr);
165}
166
107static struct scoop_pcmcia_dev spitz_pcmcia_scoop[] = { 167static struct scoop_pcmcia_dev spitz_pcmcia_scoop[] = {
108{ 168{
109 .dev = &spitzscoop_device.dev, 169 .dev = &spitzscoop_device.dev,
@@ -117,6 +177,16 @@ static struct scoop_pcmcia_dev spitz_pcmcia_scoop[] = {
117}, 177},
118}; 178};
119 179
180static struct scoop_pcmcia_config spitz_pcmcia_config = {
181 .devs = &spitz_pcmcia_scoop[0],
182 .num_devs = 2,
183 .pcmcia_init = spitz_pcmcia_init,
184 .power_ctrl = spitz_pcmcia_pwr,
185};
186
187EXPORT_SYMBOL(spitzscoop_device);
188EXPORT_SYMBOL(spitzscoop2_device);
189
120 190
121/* 191/*
122 * Spitz SSP Device 192 * Spitz SSP Device
@@ -235,27 +305,14 @@ static int spitz_mci_init(struct device *dev, irqreturn_t (*spitz_detect_int)(in
235 return 0; 305 return 0;
236} 306}
237 307
238/* Power control is shared with one of the CF slots so we have a mess */
239static void spitz_mci_setpower(struct device *dev, unsigned int vdd) 308static void spitz_mci_setpower(struct device *dev, unsigned int vdd)
240{ 309{
241 struct pxamci_platform_data* p_d = dev->platform_data; 310 struct pxamci_platform_data* p_d = dev->platform_data;
242 311
243 unsigned short cpr = read_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR); 312 if (( 1 << vdd) & p_d->ocr_mask)
244 313 spitz_card_pwr_ctrl(SPITZ_PWR_SD, 0x0004);
245 if (( 1 << vdd) & p_d->ocr_mask) { 314 else
246 /* printk(KERN_DEBUG "%s: on\n", __FUNCTION__); */ 315 spitz_card_pwr_ctrl(SPITZ_PWR_SD, 0x0000);
247 set_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_CF_POWER);
248 mdelay(2);
249 write_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR, cpr | 0x04);
250 } else {
251 /* printk(KERN_DEBUG "%s: off\n", __FUNCTION__); */
252 write_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR, cpr & ~0x04);
253
254 if (!(cpr | 0x02)) {
255 mdelay(1);
256 reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_CF_POWER);
257 }
258 }
259} 316}
260 317
261static int spitz_mci_get_ro(struct device *dev) 318static int spitz_mci_get_ro(struct device *dev)
@@ -351,8 +408,8 @@ static void __init common_init(void)
351 408
352static void __init spitz_init(void) 409static void __init spitz_init(void)
353{ 410{
354 scoop_num = 2; 411 platform_scoop_config = &spitz_pcmcia_config;
355 scoop_devs = &spitz_pcmcia_scoop[0]; 412
356 spitz_bl_machinfo.set_bl_intensity = spitz_bl_set_intensity; 413 spitz_bl_machinfo.set_bl_intensity = spitz_bl_set_intensity;
357 414
358 common_init(); 415 common_init();
diff --git a/arch/arm/mach-pxa/time.c b/arch/arm/mach-pxa/time.c
index 7dad3f1465e0..b9b2057349eb 100644
--- a/arch/arm/mach-pxa/time.c
+++ b/arch/arm/mach-pxa/time.c
@@ -132,11 +132,13 @@ static void __init pxa_timer_init(void)
132 tv.tv_sec = pxa_get_rtc_time(); 132 tv.tv_sec = pxa_get_rtc_time();
133 do_settimeofday(&tv); 133 do_settimeofday(&tv);
134 134
135 OSMR0 = 0; /* set initial match at 0 */ 135 OIER = 0; /* disable any timer interrupts */
136 OSCR = LATCH*2; /* push OSCR out of the way */
137 OSMR0 = LATCH; /* set initial match */
136 OSSR = 0xf; /* clear status on all timers */ 138 OSSR = 0xf; /* clear status on all timers */
137 setup_irq(IRQ_OST0, &pxa_timer_irq); 139 setup_irq(IRQ_OST0, &pxa_timer_irq);
138 OIER |= OIER_E0; /* enable match on timer 0 to cause interrupts */ 140 OIER = OIER_E0; /* enable match on timer 0 to cause interrupts */
139 OSCR = 0; /* initialize free-running timer, force first match */ 141 OSCR = 0; /* initialize free-running timer */
140} 142}
141 143
142#ifdef CONFIG_NO_IDLE_HZ 144#ifdef CONFIG_NO_IDLE_HZ
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c
index 400609f8b6a8..c312054dfb88 100644
--- a/arch/arm/mach-pxa/tosa.c
+++ b/arch/arm/mach-pxa/tosa.c
@@ -98,6 +98,9 @@ struct platform_device tosascoop_jc_device = {
98 .resource = tosa_scoop_jc_resources, 98 .resource = tosa_scoop_jc_resources,
99}; 99};
100 100
101/*
102 * PCMCIA
103 */
101static struct scoop_pcmcia_dev tosa_pcmcia_scoop[] = { 104static struct scoop_pcmcia_dev tosa_pcmcia_scoop[] = {
102{ 105{
103 .dev = &tosascoop_device.dev, 106 .dev = &tosascoop_device.dev,
@@ -111,16 +114,155 @@ static struct scoop_pcmcia_dev tosa_pcmcia_scoop[] = {
111}, 114},
112}; 115};
113 116
117static void tosa_pcmcia_init(void)
118{
119 /* Setup default state of GPIO outputs
120 before we enable them as outputs. */
121 GPSR(GPIO48_nPOE) = GPIO_bit(GPIO48_nPOE) |
122 GPIO_bit(GPIO49_nPWE) | GPIO_bit(GPIO50_nPIOR) |
123 GPIO_bit(GPIO51_nPIOW) | GPIO_bit(GPIO52_nPCE_1) |
124 GPIO_bit(GPIO53_nPCE_2);
125
126 pxa_gpio_mode(GPIO48_nPOE_MD);
127 pxa_gpio_mode(GPIO49_nPWE_MD);
128 pxa_gpio_mode(GPIO50_nPIOR_MD);
129 pxa_gpio_mode(GPIO51_nPIOW_MD);
130 pxa_gpio_mode(GPIO55_nPREG_MD);
131 pxa_gpio_mode(GPIO56_nPWAIT_MD);
132 pxa_gpio_mode(GPIO57_nIOIS16_MD);
133 pxa_gpio_mode(GPIO52_nPCE_1_MD);
134 pxa_gpio_mode(GPIO53_nPCE_2_MD);
135 pxa_gpio_mode(GPIO54_pSKTSEL_MD);
136}
137
138static struct scoop_pcmcia_config tosa_pcmcia_config = {
139 .devs = &tosa_pcmcia_scoop[0],
140 .num_devs = 2,
141 .pcmcia_init = tosa_pcmcia_init,
142};
143
144/*
145 * USB Device Controller
146 */
147static void tosa_udc_command(int cmd)
148{
149 switch(cmd) {
150 case PXA2XX_UDC_CMD_CONNECT:
151 set_scoop_gpio(&tosascoop_jc_device.dev,TOSA_SCOOP_JC_USB_PULLUP);
152 break;
153 case PXA2XX_UDC_CMD_DISCONNECT:
154 reset_scoop_gpio(&tosascoop_jc_device.dev,TOSA_SCOOP_JC_USB_PULLUP);
155 break;
156 }
157}
158
159static int tosa_udc_is_connected(void)
160{
161 return ((GPLR(TOSA_GPIO_USB_IN) & GPIO_bit(TOSA_GPIO_USB_IN)) == 0);
162}
163
164
165static struct pxa2xx_udc_mach_info udc_info __initdata = {
166 .udc_command = tosa_udc_command,
167 .udc_is_connected = tosa_udc_is_connected,
168};
169
170/*
171 * MMC/SD Device
172 */
173static struct pxamci_platform_data tosa_mci_platform_data;
174
175static int tosa_mci_init(struct device *dev, irqreturn_t (*tosa_detect_int)(int, void *, struct pt_regs *), void *data)
176{
177 int err;
178
179 /* setup GPIO for PXA25x MMC controller */
180 pxa_gpio_mode(GPIO6_MMCCLK_MD);
181 pxa_gpio_mode(GPIO8_MMCCS0_MD);
182 pxa_gpio_mode(TOSA_GPIO_nSD_DETECT | GPIO_IN);
183
184 tosa_mci_platform_data.detect_delay = msecs_to_jiffies(250);
185
186 err = request_irq(TOSA_IRQ_GPIO_nSD_DETECT, tosa_detect_int, SA_INTERRUPT,
187 "MMC/SD card detect", data);
188 if (err) {
189 printk(KERN_ERR "tosa_mci_init: MMC/SD: can't request MMC card detect IRQ\n");
190 return -1;
191 }
192
193 set_irq_type(TOSA_IRQ_GPIO_nSD_DETECT, IRQT_BOTHEDGE);
194
195 return 0;
196}
197
198static void tosa_mci_setpower(struct device *dev, unsigned int vdd)
199{
200 struct pxamci_platform_data* p_d = dev->platform_data;
201
202 if (( 1 << vdd) & p_d->ocr_mask) {
203 set_scoop_gpio(&tosascoop_device.dev,TOSA_SCOOP_PWR_ON);
204 } else {
205 reset_scoop_gpio(&tosascoop_device.dev,TOSA_SCOOP_PWR_ON);
206 }
207}
208
209static int tosa_mci_get_ro(struct device *dev)
210{
211 return (read_scoop_reg(&tosascoop_device.dev, SCOOP_GPWR)&TOSA_SCOOP_SD_WP);
212}
213
214static void tosa_mci_exit(struct device *dev, void *data)
215{
216 free_irq(TOSA_IRQ_GPIO_nSD_DETECT, data);
217}
218
219static struct pxamci_platform_data tosa_mci_platform_data = {
220 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
221 .init = tosa_mci_init,
222 .get_ro = tosa_mci_get_ro,
223 .setpower = tosa_mci_setpower,
224 .exit = tosa_mci_exit,
225};
226
227/*
228 * Irda
229 */
230static void tosa_irda_transceiver_mode(struct device *dev, int mode)
231{
232 if (mode & IR_OFF) {
233 reset_scoop_gpio(&tosascoop_device.dev,TOSA_SCOOP_IR_POWERDWN);
234 pxa_gpio_mode(GPIO47_STTXD|GPIO_DFLT_LOW);
235 pxa_gpio_mode(GPIO47_STTXD|GPIO_OUT);
236 } else {
237 pxa_gpio_mode(GPIO47_STTXD_MD);
238 set_scoop_gpio(&tosascoop_device.dev,TOSA_SCOOP_IR_POWERDWN);
239 }
240}
241
242static struct pxaficp_platform_data tosa_ficp_platform_data = {
243 .transceiver_cap = IR_SIRMODE | IR_OFF,
244 .transceiver_mode = tosa_irda_transceiver_mode,
245};
246
247/*
248 * Tosa Keyboard
249 */
250static struct platform_device tosakbd_device = {
251 .name = "tosa-keyboard",
252 .id = -1,
253};
114 254
115static struct platform_device *devices[] __initdata = { 255static struct platform_device *devices[] __initdata = {
116 &tosascoop_device, 256 &tosascoop_device,
117 &tosascoop_jc_device, 257 &tosascoop_jc_device,
258 &tosakbd_device,
118}; 259};
119 260
120static void __init tosa_init(void) 261static void __init tosa_init(void)
121{ 262{
122 pxa_gpio_mode(TOSA_GPIO_ON_RESET | GPIO_IN); 263 pxa_gpio_mode(TOSA_GPIO_ON_RESET | GPIO_IN);
123 pxa_gpio_mode(TOSA_GPIO_TC6393_INT | GPIO_IN); 264 pxa_gpio_mode(TOSA_GPIO_TC6393_INT | GPIO_IN);
265 pxa_gpio_mode(TOSA_GPIO_USB_IN | GPIO_IN);
124 266
125 /* setup sleep mode values */ 267 /* setup sleep mode values */
126 PWER = 0x00000002; 268 PWER = 0x00000002;
@@ -131,13 +273,15 @@ static void __init tosa_init(void)
131 PGSR2 = 0x00014000; 273 PGSR2 = 0x00014000;
132 PCFR |= PCFR_OPDE; 274 PCFR |= PCFR_OPDE;
133 275
134 // enable batt_fault 276 /* enable batt_fault */
135 PMCR = 0x01; 277 PMCR = 0x01;
136 278
137 platform_add_devices(devices, ARRAY_SIZE(devices)); 279 pxa_set_mci_info(&tosa_mci_platform_data);
280 pxa_set_udc_info(&udc_info);
281 pxa_set_ficp_info(&tosa_ficp_platform_data);
282 platform_scoop_config = &tosa_pcmcia_config;
138 283
139 scoop_num = 2; 284 platform_add_devices(devices, ARRAY_SIZE(devices));
140 scoop_devs = &tosa_pcmcia_scoop[0];
141} 285}
142 286
143static void __init fixup_tosa(struct machine_desc *desc, 287static void __init fixup_tosa(struct machine_desc *desc,
diff --git a/arch/arm/mach-realview/Makefile b/arch/arm/mach-realview/Makefile
index 011a85c10627..36e76ba937fc 100644
--- a/arch/arm/mach-realview/Makefile
+++ b/arch/arm/mach-realview/Makefile
@@ -5,3 +5,5 @@
5obj-y := core.o clock.o 5obj-y := core.o clock.o
6obj-$(CONFIG_MACH_REALVIEW_EB) += realview_eb.o 6obj-$(CONFIG_MACH_REALVIEW_EB) += realview_eb.o
7obj-$(CONFIG_SMP) += platsmp.o headsmp.o 7obj-$(CONFIG_SMP) += platsmp.o headsmp.o
8obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
9obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index 482eb512ebe8..e2c6fa23d3cd 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -550,6 +550,11 @@ static irqreturn_t realview_timer_interrupt(int irq, void *dev_id, struct pt_reg
550 550
551 timer_tick(regs); 551 timer_tick(regs);
552 552
553#if defined(CONFIG_SMP) && !defined(CONFIG_LOCAL_TIMERS)
554 smp_send_timer();
555 update_process_times(user_mode(regs));
556#endif
557
553 write_sequnlock(&xtime_lock); 558 write_sequnlock(&xtime_lock);
554 559
555 return IRQ_HANDLED; 560 return IRQ_HANDLED;
diff --git a/arch/arm/mach-realview/hotplug.c b/arch/arm/mach-realview/hotplug.c
new file mode 100644
index 000000000000..09748cbcd10e
--- /dev/null
+++ b/arch/arm/mach-realview/hotplug.c
@@ -0,0 +1,138 @@
1/*
2 * linux/arch/arm/mach-realview/hotplug.c
3 *
4 * Copyright (C) 2002 ARM Ltd.
5 * All Rights Reserved
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#include <linux/kernel.h>
12#include <linux/errno.h>
13#include <linux/smp.h>
14#include <linux/completion.h>
15
16extern volatile int pen_release;
17
18static DECLARE_COMPLETION(cpu_killed);
19
20static inline void cpu_enter_lowpower(void)
21{
22 unsigned int v;
23
24 asm volatile( "mcr p15, 0, %1, c7, c14, 0\n"
25 " mcr p15, 0, %1, c7, c5, 0\n"
26 " mcr p15, 0, %1, c7, c10, 4\n"
27 /*
28 * Turn off coherency
29 */
30 " mrc p15, 0, %0, c1, c0, 1\n"
31 " bic %0, %0, #0x20\n"
32 " mcr p15, 0, %0, c1, c0, 1\n"
33 " mrc p15, 0, %0, c1, c0, 0\n"
34 " bic %0, %0, #0x04\n"
35 " mcr p15, 0, %0, c1, c0, 0\n"
36 : "=&r" (v)
37 : "r" (0)
38 : "cc");
39}
40
41static inline void cpu_leave_lowpower(void)
42{
43 unsigned int v;
44
45 asm volatile( "mrc p15, 0, %0, c1, c0, 0\n"
46 " orr %0, %0, #0x04\n"
47 " mcr p15, 0, %0, c1, c0, 0\n"
48 " mrc p15, 0, %0, c1, c0, 1\n"
49 " orr %0, %0, #0x20\n"
50 " mcr p15, 0, %0, c1, c0, 1\n"
51 : "=&r" (v)
52 :
53 : "cc");
54}
55
56static inline void platform_do_lowpower(unsigned int cpu)
57{
58 /*
59 * there is no power-control hardware on this platform, so all
60 * we can do is put the core into WFI; this is safe as the calling
61 * code will have already disabled interrupts
62 */
63 for (;;) {
64 /*
65 * here's the WFI
66 */
67 asm(".word 0xe320f003\n"
68 :
69 :
70 : "memory", "cc");
71
72 if (pen_release == cpu) {
73 /*
74 * OK, proper wakeup, we're done
75 */
76 break;
77 }
78
79 /*
80 * getting here, means that we have come out of WFI without
81 * having been woken up - this shouldn't happen
82 *
83 * The trouble is, letting people know about this is not really
84 * possible, since we are currently running incoherently, and
85 * therefore cannot safely call printk() or anything else
86 */
87#ifdef DEBUG
88 printk("CPU%u: spurious wakeup call\n", cpu);
89#endif
90 }
91}
92
93int platform_cpu_kill(unsigned int cpu)
94{
95 return wait_for_completion_timeout(&cpu_killed, 5000);
96}
97
98/*
99 * platform-specific code to shutdown a CPU
100 *
101 * Called with IRQs disabled
102 */
103void platform_cpu_die(unsigned int cpu)
104{
105#ifdef DEBUG
106 unsigned int this_cpu = hard_smp_processor_id();
107
108 if (cpu != this_cpu) {
109 printk(KERN_CRIT "Eek! platform_cpu_die running on %u, should be %u\n",
110 this_cpu, cpu);
111 BUG();
112 }
113#endif
114
115 printk(KERN_NOTICE "CPU%u: shutdown\n", cpu);
116 complete(&cpu_killed);
117
118 /*
119 * we're ready for shutdown now, so do it
120 */
121 cpu_enter_lowpower();
122 platform_do_lowpower(cpu);
123
124 /*
125 * bring this CPU back into the world of cache
126 * coherency, and then restore interrupts
127 */
128 cpu_leave_lowpower();
129}
130
131int mach_cpu_disable(unsigned int cpu)
132{
133 /*
134 * we don't allow CPU 0 to be shutdown (it is still too special
135 * e.g. clock tick interrupts)
136 */
137 return cpu == 0 ? -EPERM : 0;
138}
diff --git a/arch/arm/mach-realview/localtimer.c b/arch/arm/mach-realview/localtimer.c
new file mode 100644
index 000000000000..5e917e37d095
--- /dev/null
+++ b/arch/arm/mach-realview/localtimer.c
@@ -0,0 +1,130 @@
1/*
2 * linux/arch/arm/mach-realview/localtimer.c
3 *
4 * Copyright (C) 2002 ARM Ltd.
5 * All Rights Reserved
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#include <linux/init.h>
12#include <linux/kernel.h>
13#include <linux/delay.h>
14#include <linux/device.h>
15#include <linux/smp.h>
16
17#include <asm/mach/time.h>
18#include <asm/hardware/arm_twd.h>
19#include <asm/hardware/gic.h>
20#include <asm/hardware.h>
21#include <asm/io.h>
22#include <asm/irq.h>
23
24#include "core.h"
25
26#define TWD_BASE(cpu) (__io_address(REALVIEW_TWD_BASE) + \
27 ((cpu) * REALVIEW_TWD_SIZE))
28
29static unsigned long mpcore_timer_rate;
30
31/*
32 * local_timer_ack: checks for a local timer interrupt.
33 *
34 * If a local timer interrupt has occured, acknowledge and return 1.
35 * Otherwise, return 0.
36 */
37int local_timer_ack(void)
38{
39 void __iomem *base = TWD_BASE(smp_processor_id());
40
41 if (__raw_readl(base + TWD_TIMER_INTSTAT)) {
42 __raw_writel(1, base + TWD_TIMER_INTSTAT);
43 return 1;
44 }
45
46 return 0;
47}
48
49void __cpuinit local_timer_setup(unsigned int cpu)
50{
51 void __iomem *base = TWD_BASE(cpu);
52 unsigned int load, offset;
53 u64 waitjiffies;
54 unsigned int count;
55
56 /*
57 * If this is the first time round, we need to work out how fast
58 * the timer ticks
59 */
60 if (mpcore_timer_rate == 0) {
61 printk("Calibrating local timer... ");
62
63 /* Wait for a tick to start */
64 waitjiffies = get_jiffies_64() + 1;
65
66 while (get_jiffies_64() < waitjiffies)
67 udelay(10);
68
69 /* OK, now the tick has started, let's get the timer going */
70 waitjiffies += 5;
71
72 /* enable, no interrupt or reload */
73 __raw_writel(0x1, base + TWD_TIMER_CONTROL);
74
75 /* maximum value */
76 __raw_writel(0xFFFFFFFFU, base + TWD_TIMER_COUNTER);
77
78 while (get_jiffies_64() < waitjiffies)
79 udelay(10);
80
81 count = __raw_readl(base + TWD_TIMER_COUNTER);
82
83 mpcore_timer_rate = (0xFFFFFFFFU - count) * (HZ / 5);
84
85 printk("%lu.%02luMHz.\n", mpcore_timer_rate / 1000000,
86 (mpcore_timer_rate / 100000) % 100);
87 }
88
89 load = mpcore_timer_rate / HZ;
90
91 __raw_writel(load, base + TWD_TIMER_LOAD);
92 __raw_writel(0x7, base + TWD_TIMER_CONTROL);
93
94 /*
95 * Now maneuver our local tick into the right part of the jiffy.
96 * Start by working out where within the tick our local timer
97 * interrupt should go.
98 */
99 offset = ((mpcore_timer_rate / HZ) / (NR_CPUS + 1)) * (cpu + 1);
100
101 /*
102 * gettimeoffset() will return a number of us since the last tick.
103 * Convert this number of us to a local timer tick count.
104 * Be careful of integer overflow whilst keeping maximum precision.
105 *
106 * with HZ=100 and 1MHz (fpga) ~ 1GHz processor:
107 * load = 1 ~ 10,000
108 * mpcore_timer_rate/10000 = 100 ~ 100,000
109 *
110 * so the multiply value will be less than 10^9 always.
111 */
112 load = (system_timer->offset() * (mpcore_timer_rate / 10000)) / 100;
113
114 /* Add on our offset to get the load value */
115 load = (load + offset) % (mpcore_timer_rate / HZ);
116
117 __raw_writel(load, base + TWD_TIMER_COUNTER);
118
119 /* Make sure our local interrupt controller has this enabled */
120 __raw_writel(1 << IRQ_LOCALTIMER,
121 __io_address(REALVIEW_GIC_DIST_BASE) + GIC_DIST_ENABLE_SET);
122}
123
124/*
125 * take a local timer down
126 */
127void __cpuexit local_timer_stop(unsigned int cpu)
128{
129 __raw_writel(0, TWD_BASE(cpu) + TWD_TIMER_CONTROL);
130}
diff --git a/arch/arm/mach-realview/platsmp.c b/arch/arm/mach-realview/platsmp.c
index 9844644d0fb5..0c7d4ac9a7b3 100644
--- a/arch/arm/mach-realview/platsmp.c
+++ b/arch/arm/mach-realview/platsmp.c
@@ -32,7 +32,7 @@ static unsigned int __init get_core_count(void)
32{ 32{
33 unsigned int ncores; 33 unsigned int ncores;
34 34
35 ncores = __raw_readl(IO_ADDRESS(REALVIEW_MPCORE_SCU_BASE) + SCU_CONFIG); 35 ncores = __raw_readl(__io_address(REALVIEW_MPCORE_SCU_BASE) + SCU_CONFIG);
36 36
37 return (ncores & 0x03) + 1; 37 return (ncores & 0x03) + 1;
38} 38}
@@ -133,12 +133,12 @@ static void __init poke_milo(void)
133#if 1 133#if 1
134#define REALVIEW_SYS_FLAGSS_OFFSET 0x30 134#define REALVIEW_SYS_FLAGSS_OFFSET 0x30
135 __raw_writel(virt_to_phys(realview_secondary_startup), 135 __raw_writel(virt_to_phys(realview_secondary_startup),
136 (IO_ADDRESS(REALVIEW_SYS_BASE) + 136 __io_address(REALVIEW_SYS_BASE) +
137 REALVIEW_SYS_FLAGSS_OFFSET)); 137 REALVIEW_SYS_FLAGSS_OFFSET);
138#define REALVIEW_SYS_FLAGSC_OFFSET 0x34 138#define REALVIEW_SYS_FLAGSC_OFFSET 0x34
139 __raw_writel(3, 139 __raw_writel(3,
140 (IO_ADDRESS(REALVIEW_SYS_BASE) + 140 __io_address(REALVIEW_SYS_BASE) +
141 REALVIEW_SYS_FLAGSC_OFFSET)); 141 REALVIEW_SYS_FLAGSC_OFFSET);
142#endif 142#endif
143 143
144 mb(); 144 mb();
@@ -175,6 +175,11 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
175 max_cpus = ncores; 175 max_cpus = ncores;
176 176
177 /* 177 /*
178 * Enable the local timer for primary CPU
179 */
180 local_timer_setup(cpu);
181
182 /*
178 * Initialise the possible/present maps. 183 * Initialise the possible/present maps.
179 * cpu_possible_map describes the set of CPUs which may be present 184 * cpu_possible_map describes the set of CPUs which may be present
180 * cpu_present_map describes the set of CPUs populated 185 * cpu_present_map describes the set of CPUs populated
diff --git a/arch/arm/mach-s3c2410/Kconfig b/arch/arm/mach-s3c2410/Kconfig
index c796bcdd6158..0b9d7ca49ec1 100644
--- a/arch/arm/mach-s3c2410/Kconfig
+++ b/arch/arm/mach-s3c2410/Kconfig
@@ -121,6 +121,14 @@ config S3C2410_BOOT_WATCHDOG
121 system resets depends on the value of PCLK. The timeout on an 121 system resets depends on the value of PCLK. The timeout on an
122 200MHz s3c2410 should be about 30 seconds. 122 200MHz s3c2410 should be about 30 seconds.
123 123
124config S3C2410_BOOT_ERROR_RESET
125 bool "S3C2410 Reboot on decompression error"
126 depends on ARCH_S3C2410
127 help
128 Say y here to use the watchdog to reset the system if the
129 kernel decompressor detects an error during decompression.
130
131
124comment "S3C2410 Setup" 132comment "S3C2410 Setup"
125 133
126config S3C2410_DMA 134config S3C2410_DMA
diff --git a/arch/arm/mach-s3c2410/mach-anubis.c b/arch/arm/mach-s3c2410/mach-anubis.c
index 8390b685c2b6..0f81fc0c2f7f 100644
--- a/arch/arm/mach-s3c2410/mach-anubis.c
+++ b/arch/arm/mach-s3c2410/mach-anubis.c
@@ -56,8 +56,16 @@
56static struct map_desc anubis_iodesc[] __initdata = { 56static struct map_desc anubis_iodesc[] __initdata = {
57 /* ISA IO areas */ 57 /* ISA IO areas */
58 58
59 { (u32)S3C24XX_VA_ISA_BYTE, 0x0, SZ_16M, MT_DEVICE }, 59 {
60 { (u32)S3C24XX_VA_ISA_WORD, 0x0, SZ_16M, MT_DEVICE }, 60 .virtual = (u32)S3C24XX_VA_ISA_BYTE,
61 .pfn = __phys_to_pfn(0x0),
62 .length = SZ_4M,
63 .type = MT_DEVICE
64 }, {
65 .virtual = (u32)S3C24XX_VA_ISA_WORD,
66 .pfn = __phys_to_pfn(0x0),
67 .length = SZ_4M, MT_DEVICE
68 },
61 69
62 /* we could possibly compress the next set down into a set of smaller tables 70 /* we could possibly compress the next set down into a set of smaller tables
63 * pagetables, but that would mean using an L2 section, and it still means 71 * pagetables, but that would mean using an L2 section, and it still means
@@ -66,16 +74,41 @@ static struct map_desc anubis_iodesc[] __initdata = {
66 74
67 /* CPLD control registers */ 75 /* CPLD control registers */
68 76
69 { (u32)ANUBIS_VA_CTRL1, ANUBIS_PA_CTRL1, SZ_4K, MT_DEVICE }, 77 {
70 { (u32)ANUBIS_VA_CTRL2, ANUBIS_PA_CTRL2, SZ_4K, MT_DEVICE }, 78 .virtual = (u32)ANUBIS_VA_CTRL1,
79 .pfn = __phys_to_pfn(ANUBIS_PA_CTRL1),
80 .length = SZ_4K,
81 .type = MT_DEVICE
82 }, {
83 .virtual = (u32)ANUBIS_VA_CTRL2,
84 .pfn = __phys_to_pfn(ANUBIS_PA_CTRL2),
85 .length = SZ_4K,
86 .type =MT_DEVICE
87 },
71 88
72 /* IDE drives */ 89 /* IDE drives */
73 90
74 { (u32)ANUBIS_IDEPRI, S3C2410_CS3, SZ_1M, MT_DEVICE }, 91 {
75 { (u32)ANUBIS_IDEPRIAUX, S3C2410_CS3+(1<<26), SZ_1M, MT_DEVICE }, 92 .virtual = (u32)ANUBIS_IDEPRI,
76 93 .pfn = __phys_to_pfn(S3C2410_CS3),
77 { (u32)ANUBIS_IDESEC, S3C2410_CS4, SZ_1M, MT_DEVICE }, 94 .length = SZ_1M,
78 { (u32)ANUBIS_IDESECAUX, S3C2410_CS4+(1<<26), SZ_1M, MT_DEVICE }, 95 .type = MT_DEVICE
96 }, {
97 .virtual = (u32)ANUBIS_IDEPRIAUX,
98 .pfn = __phys_to_pfn(S3C2410_CS3+(1<<26)),
99 .length = SZ_1M,
100 .type = MT_DEVICE
101 }, {
102 .virtual = (u32)ANUBIS_IDESEC,
103 .pfn = __phys_to_pfn(S3C2410_CS4),
104 .length = SZ_1M,
105 .type = MT_DEVICE
106 }, {
107 .virtual = (u32)ANUBIS_IDESECAUX,
108 .pfn = __phys_to_pfn(S3C2410_CS4+(1<<26)),
109 .length = SZ_1M,
110 .type = MT_DEVICE
111 },
79}; 112};
80 113
81#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK 114#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
diff --git a/arch/arm/mach-s3c2410/mach-bast.c b/arch/arm/mach-s3c2410/mach-bast.c
index 0b71c896bbd1..1be2567a7486 100644
--- a/arch/arm/mach-s3c2410/mach-bast.c
+++ b/arch/arm/mach-s3c2410/mach-bast.c
@@ -89,32 +89,63 @@
89 89
90/* macros to modify the physical addresses for io space */ 90/* macros to modify the physical addresses for io space */
91 91
92#define PA_CS2(item) ((item) + S3C2410_CS2) 92#define PA_CS2(item) (__phys_to_pfn((item) + S3C2410_CS2))
93#define PA_CS3(item) ((item) + S3C2410_CS3) 93#define PA_CS3(item) (__phys_to_pfn((item) + S3C2410_CS3))
94#define PA_CS4(item) ((item) + S3C2410_CS4) 94#define PA_CS4(item) (__phys_to_pfn((item) + S3C2410_CS4))
95#define PA_CS5(item) ((item) + S3C2410_CS5) 95#define PA_CS5(item) (__phys_to_pfn((item) + S3C2410_CS5))
96 96
97static struct map_desc bast_iodesc[] __initdata = { 97static struct map_desc bast_iodesc[] __initdata = {
98 /* ISA IO areas */ 98 /* ISA IO areas */
99 99 {
100 { (u32)S3C24XX_VA_ISA_BYTE, PA_CS2(BAST_PA_ISAIO), SZ_16M, MT_DEVICE }, 100 .virtual = (u32)S3C24XX_VA_ISA_BYTE,
101 { (u32)S3C24XX_VA_ISA_WORD, PA_CS3(BAST_PA_ISAIO), SZ_16M, MT_DEVICE }, 101 .pfn = PA_CS2(BAST_PA_ISAIO),
102 102 .length = SZ_16M,
103 /* we could possibly compress the next set down into a set of smaller tables 103 .type = MT_DEVICE,
104 * pagetables, but that would mean using an L2 section, and it still means 104 }, {
105 * we cannot actually feed the same register to an LDR due to 16K spacing 105 .virtual = (u32)S3C24XX_VA_ISA_WORD,
106 */ 106 .pfn = PA_CS3(BAST_PA_ISAIO),
107 107 .length = SZ_16M,
108 .type = MT_DEVICE,
109 },
108 /* bast CPLD control registers, and external interrupt controls */ 110 /* bast CPLD control registers, and external interrupt controls */
109 { (u32)BAST_VA_CTRL1, BAST_PA_CTRL1, SZ_1M, MT_DEVICE }, 111 {
110 { (u32)BAST_VA_CTRL2, BAST_PA_CTRL2, SZ_1M, MT_DEVICE }, 112 .virtual = (u32)BAST_VA_CTRL1,
111 { (u32)BAST_VA_CTRL3, BAST_PA_CTRL3, SZ_1M, MT_DEVICE }, 113 .pfn = __phys_to_pfn(BAST_PA_CTRL1),
112 { (u32)BAST_VA_CTRL4, BAST_PA_CTRL4, SZ_1M, MT_DEVICE }, 114 .length = SZ_1M,
113 115 .type = MT_DEVICE,
116 }, {
117 .virtual = (u32)BAST_VA_CTRL2,
118 .pfn = __phys_to_pfn(BAST_PA_CTRL2),
119 .length = SZ_1M,
120 .type = MT_DEVICE,
121 }, {
122 .virtual = (u32)BAST_VA_CTRL3,
123 .pfn = __phys_to_pfn(BAST_PA_CTRL3),
124 .length = SZ_1M,
125 .type = MT_DEVICE,
126 }, {
127 .virtual = (u32)BAST_VA_CTRL4,
128 .pfn = __phys_to_pfn(BAST_PA_CTRL4),
129 .length = SZ_1M,
130 .type = MT_DEVICE,
131 },
114 /* PC104 IRQ mux */ 132 /* PC104 IRQ mux */
115 { (u32)BAST_VA_PC104_IRQREQ, BAST_PA_PC104_IRQREQ, SZ_1M, MT_DEVICE }, 133 {
116 { (u32)BAST_VA_PC104_IRQRAW, BAST_PA_PC104_IRQRAW, SZ_1M, MT_DEVICE }, 134 .virtual = (u32)BAST_VA_PC104_IRQREQ,
117 { (u32)BAST_VA_PC104_IRQMASK, BAST_PA_PC104_IRQMASK, SZ_1M, MT_DEVICE }, 135 .pfn = __phys_to_pfn(BAST_PA_PC104_IRQREQ),
136 .length = SZ_1M,
137 .type = MT_DEVICE,
138 }, {
139 .virtual = (u32)BAST_VA_PC104_IRQRAW,
140 .pfn = __phys_to_pfn(BAST_PA_PC104_IRQRAW),
141 .length = SZ_1M,
142 .type = MT_DEVICE,
143 }, {
144 .virtual = (u32)BAST_VA_PC104_IRQMASK,
145 .pfn = __phys_to_pfn(BAST_PA_PC104_IRQMASK),
146 .length = SZ_1M,
147 .type = MT_DEVICE,
148 },
118 149
119 /* peripheral space... one for each of fast/slow/byte/16bit */ 150 /* peripheral space... one for each of fast/slow/byte/16bit */
120 /* note, ide is only decoded in word space, even though some registers 151 /* note, ide is only decoded in word space, even though some registers
diff --git a/arch/arm/mach-s3c2410/mach-rx3715.c b/arch/arm/mach-s3c2410/mach-rx3715.c
index 24d69019a843..f8d86d1e16b6 100644
--- a/arch/arm/mach-s3c2410/mach-rx3715.c
+++ b/arch/arm/mach-s3c2410/mach-rx3715.c
@@ -56,8 +56,17 @@
56static struct map_desc rx3715_iodesc[] __initdata = { 56static struct map_desc rx3715_iodesc[] __initdata = {
57 /* dump ISA space somewhere unused */ 57 /* dump ISA space somewhere unused */
58 58
59 { (u32)S3C24XX_VA_ISA_WORD, S3C2410_CS3, SZ_16M, MT_DEVICE }, 59 {
60 { (u32)S3C24XX_VA_ISA_BYTE, S3C2410_CS3, SZ_16M, MT_DEVICE }, 60 .virtual = (u32)S3C24XX_VA_ISA_WORD,
61 .pfn = __phys_to_pfn(S3C2410_CS3),
62 .length = SZ_1M,
63 .type = MT_DEVICE,
64 }, {
65 .virtual = (u32)S3C24XX_VA_ISA_BYTE,
66 .pfn = __phys_to_pfn(S3C2410_CS3),
67 .length = SZ_1M,
68 .type = MT_DEVICE,
69 },
61}; 70};
62 71
63 72
diff --git a/arch/arm/mach-s3c2410/mach-smdk2440.c b/arch/arm/mach-s3c2410/mach-smdk2440.c
index d666c621ad06..4e31118533e6 100644
--- a/arch/arm/mach-s3c2410/mach-smdk2440.c
+++ b/arch/arm/mach-s3c2410/mach-smdk2440.c
@@ -58,8 +58,27 @@
58static struct map_desc smdk2440_iodesc[] __initdata = { 58static struct map_desc smdk2440_iodesc[] __initdata = {
59 /* ISA IO Space map (memory space selected by A24) */ 59 /* ISA IO Space map (memory space selected by A24) */
60 60
61 { (u32)S3C24XX_VA_ISA_WORD, S3C2410_CS2, SZ_16M, MT_DEVICE }, 61 {
62 { (u32)S3C24XX_VA_ISA_BYTE, S3C2410_CS2, SZ_16M, MT_DEVICE }, 62 .virtual = (u32)S3C24XX_VA_ISA_WORD,
63 .pfn = __phys_to_pfn(S3C2410_CS2),
64 .length = 0x10000,
65 .type = MT_DEVICE,
66 }, {
67 .virtual = (u32)S3C24XX_VA_ISA_WORD + 0x10000,
68 .pfn = __phys_to_pfn(S3C2410_CS2 + (1<<24)),
69 .length = SZ_4M,
70 .type = MT_DEVICE,
71 }, {
72 .virtual = (u32)S3C24XX_VA_ISA_BYTE,
73 .pfn = __phys_to_pfn(S3C2410_CS2),
74 .length = 0x10000,
75 .type = MT_DEVICE,
76 }, {
77 .virtual = (u32)S3C24XX_VA_ISA_BYTE + 0x10000,
78 .pfn = __phys_to_pfn(S3C2410_CS2 + (1<<24)),
79 .length = SZ_4M,
80 .type = MT_DEVICE,
81 }
63}; 82};
64 83
65#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK 84#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
diff --git a/arch/arm/mach-s3c2410/mach-vr1000.c b/arch/arm/mach-s3c2410/mach-vr1000.c
index 46b259673c18..ae7e099bf6c8 100644
--- a/arch/arm/mach-s3c2410/mach-vr1000.c
+++ b/arch/arm/mach-s3c2410/mach-vr1000.c
@@ -74,27 +74,47 @@
74 74
75/* macros to modify the physical addresses for io space */ 75/* macros to modify the physical addresses for io space */
76 76
77#define PA_CS2(item) ((item) + S3C2410_CS2) 77#define PA_CS2(item) (__phys_to_pfn((item) + S3C2410_CS2))
78#define PA_CS3(item) ((item) + S3C2410_CS3) 78#define PA_CS3(item) (__phys_to_pfn((item) + S3C2410_CS3))
79#define PA_CS4(item) ((item) + S3C2410_CS4) 79#define PA_CS4(item) (__phys_to_pfn((item) + S3C2410_CS4))
80#define PA_CS5(item) ((item) + S3C2410_CS5) 80#define PA_CS5(item) (__phys_to_pfn((item) + S3C2410_CS5))
81 81
82static struct map_desc vr1000_iodesc[] __initdata = { 82static struct map_desc vr1000_iodesc[] __initdata = {
83 /* ISA IO areas */ 83 /* ISA IO areas */
84 84 {
85 { (u32)S3C24XX_VA_ISA_BYTE, PA_CS2(BAST_PA_ISAIO), SZ_16M, MT_DEVICE }, 85 .virtual = (u32)S3C24XX_VA_ISA_BYTE,
86 { (u32)S3C24XX_VA_ISA_WORD, PA_CS3(BAST_PA_ISAIO), SZ_16M, MT_DEVICE }, 86 .pfn = PA_CS2(BAST_PA_ISAIO),
87 87 .length = SZ_16M,
88 /* we could possibly compress the next set down into a set of smaller tables 88 .type = MT_DEVICE,
89 * pagetables, but that would mean using an L2 section, and it still means 89 }, {
90 * we cannot actually feed the same register to an LDR due to 16K spacing 90 .virtual = (u32)S3C24XX_VA_ISA_WORD,
91 */ 91 .pfn = PA_CS3(BAST_PA_ISAIO),
92 92 .length = SZ_16M,
93 /* bast CPLD control registers, and external interrupt controls */ 93 .type = MT_DEVICE,
94 { (u32)VR1000_VA_CTRL1, VR1000_PA_CTRL1, SZ_1M, MT_DEVICE }, 94 },
95 { (u32)VR1000_VA_CTRL2, VR1000_PA_CTRL2, SZ_1M, MT_DEVICE }, 95
96 { (u32)VR1000_VA_CTRL3, VR1000_PA_CTRL3, SZ_1M, MT_DEVICE }, 96 /* CPLD control registers, and external interrupt controls */
97 { (u32)VR1000_VA_CTRL4, VR1000_PA_CTRL4, SZ_1M, MT_DEVICE }, 97 {
98 .virtual = (u32)VR1000_VA_CTRL1,
99 .pfn = __phys_to_pfn(VR1000_PA_CTRL1),
100 .length = SZ_1M,
101 .type = MT_DEVICE,
102 }, {
103 .virtual = (u32)VR1000_VA_CTRL2,
104 .pfn = __phys_to_pfn(VR1000_PA_CTRL2),
105 .length = SZ_1M,
106 .type = MT_DEVICE,
107 }, {
108 .virtual = (u32)VR1000_VA_CTRL3,
109 .pfn = __phys_to_pfn(VR1000_PA_CTRL3),
110 .length = SZ_1M,
111 .type = MT_DEVICE,
112 }, {
113 .virtual = (u32)VR1000_VA_CTRL4,
114 .pfn = __phys_to_pfn(VR1000_PA_CTRL4),
115 .length = SZ_1M,
116 .type = MT_DEVICE,
117 },
98 118
99 /* peripheral space... one for each of fast/slow/byte/16bit */ 119 /* peripheral space... one for each of fast/slow/byte/16bit */
100 /* note, ide is only decoded in word space, even though some registers 120 /* note, ide is only decoded in word space, even though some registers
diff --git a/arch/arm/mach-sa1100/time.c b/arch/arm/mach-sa1100/time.c
index 47e0420623fc..e4b435e634e4 100644
--- a/arch/arm/mach-sa1100/time.c
+++ b/arch/arm/mach-sa1100/time.c
@@ -124,11 +124,13 @@ static void __init sa1100_timer_init(void)
124 tv.tv_sec = sa1100_get_rtc_time(); 124 tv.tv_sec = sa1100_get_rtc_time();
125 do_settimeofday(&tv); 125 do_settimeofday(&tv);
126 126
127 OSMR0 = 0; /* set initial match at 0 */ 127 OIER = 0; /* disable any timer interrupts */
128 OSCR = LATCH*2; /* push OSCR out of the way */
129 OSMR0 = LATCH; /* set initial match */
128 OSSR = 0xf; /* clear status on all timers */ 130 OSSR = 0xf; /* clear status on all timers */
129 setup_irq(IRQ_OST0, &sa1100_timer_irq); 131 setup_irq(IRQ_OST0, &sa1100_timer_irq);
130 OIER |= OIER_E0; /* enable match on timer 0 to cause interrupts */ 132 OIER = OIER_E0; /* enable match on timer 0 to cause interrupts */
131 OSCR = 0; /* initialize free-running timer, force first match */ 133 OSCR = 0; /* initialize free-running timer */
132} 134}
133 135
134#ifdef CONFIG_NO_IDLE_HZ 136#ifdef CONFIG_NO_IDLE_HZ
diff --git a/arch/arm/plat-omap/ocpi.c b/arch/arm/plat-omap/ocpi.c
index 1fb16f9edfd5..2ede2ee8cae4 100644
--- a/arch/arm/plat-omap/ocpi.c
+++ b/arch/arm/plat-omap/ocpi.c
@@ -25,7 +25,6 @@
25 25
26#include <linux/config.h> 26#include <linux/config.h>
27#include <linux/module.h> 27#include <linux/module.h>
28#include <linux/version.h>
29#include <linux/types.h> 28#include <linux/types.h>
30#include <linux/errno.h> 29#include <linux/errno.h>
31#include <linux/kernel.h> 30#include <linux/kernel.h>
diff --git a/arch/arm26/kernel/process.c b/arch/arm26/kernel/process.c
index 9eb9964d32a7..15833a0057dd 100644
--- a/arch/arm26/kernel/process.c
+++ b/arch/arm26/kernel/process.c
@@ -74,15 +74,13 @@ __setup("hlt", hlt_setup);
74void cpu_idle(void) 74void cpu_idle(void)
75{ 75{
76 /* endless idle loop with no priority at all */ 76 /* endless idle loop with no priority at all */
77 preempt_disable();
78 while (1) { 77 while (1) {
79 while (!need_resched()) { 78 while (!need_resched())
80 local_irq_disable(); 79 cpu_relax();
81 if (!need_resched() && !hlt_counter) 80 preempt_enable_no_resched();
82 local_irq_enable(); 81 schedule();
83 } 82 preempt_disable();
84 } 83 }
85 schedule();
86} 84}
87 85
88static char reboot_mode = 'h'; 86static char reboot_mode = 'h';
diff --git a/arch/cris/arch-v10/drivers/pcf8563.c b/arch/cris/arch-v10/drivers/pcf8563.c
index 201f4c90d961..f2c55742e90c 100644
--- a/arch/cris/arch-v10/drivers/pcf8563.c
+++ b/arch/cris/arch-v10/drivers/pcf8563.c
@@ -19,7 +19,6 @@
19 */ 19 */
20 20
21#include <linux/config.h> 21#include <linux/config.h>
22#include <linux/version.h>
23#include <linux/module.h> 22#include <linux/module.h>
24#include <linux/kernel.h> 23#include <linux/kernel.h>
25#include <linux/types.h> 24#include <linux/types.h>
diff --git a/arch/cris/arch-v10/kernel/fasttimer.c b/arch/cris/arch-v10/kernel/fasttimer.c
index 094ff45ae85b..cac05a5e514c 100644
--- a/arch/cris/arch-v10/kernel/fasttimer.c
+++ b/arch/cris/arch-v10/kernel/fasttimer.c
@@ -112,7 +112,6 @@
112#include <asm/rtc.h> 112#include <asm/rtc.h>
113 113
114#include <linux/config.h> 114#include <linux/config.h>
115#include <linux/version.h>
116 115
117#include <asm/arch/svinto.h> 116#include <asm/arch/svinto.h>
118#include <asm/fasttimer.h> 117#include <asm/fasttimer.h>
diff --git a/arch/cris/arch-v32/drivers/nandflash.c b/arch/cris/arch-v32/drivers/nandflash.c
index fc2a619b035d..93ddea4d9564 100644
--- a/arch/cris/arch-v32/drivers/nandflash.c
+++ b/arch/cris/arch-v32/drivers/nandflash.c
@@ -14,7 +14,6 @@
14 * 14 *
15 */ 15 */
16 16
17#include <linux/version.h>
18#include <linux/slab.h> 17#include <linux/slab.h>
19#include <linux/init.h> 18#include <linux/init.h>
20#include <linux/module.h> 19#include <linux/module.h>
diff --git a/arch/cris/arch-v32/drivers/pcf8563.c b/arch/cris/arch-v32/drivers/pcf8563.c
index f894580b648b..d788bda3578c 100644
--- a/arch/cris/arch-v32/drivers/pcf8563.c
+++ b/arch/cris/arch-v32/drivers/pcf8563.c
@@ -18,7 +18,6 @@
18 */ 18 */
19 19
20#include <linux/config.h> 20#include <linux/config.h>
21#include <linux/version.h>
22#include <linux/module.h> 21#include <linux/module.h>
23#include <linux/kernel.h> 22#include <linux/kernel.h>
24#include <linux/types.h> 23#include <linux/types.h>
diff --git a/arch/cris/arch-v32/kernel/smp.c b/arch/cris/arch-v32/kernel/smp.c
index 957f551ba5ce..13867f4fad16 100644
--- a/arch/cris/arch-v32/kernel/smp.c
+++ b/arch/cris/arch-v32/kernel/smp.c
@@ -161,6 +161,7 @@ void __init smp_callin(void)
161 REG_WR(intr_vect, irq_regs[cpu], rw_mask, vect_mask); 161 REG_WR(intr_vect, irq_regs[cpu], rw_mask, vect_mask);
162 unmask_irq(IPI_INTR_VECT); 162 unmask_irq(IPI_INTR_VECT);
163 unmask_irq(TIMER_INTR_VECT); 163 unmask_irq(TIMER_INTR_VECT);
164 preempt_disable();
164 local_irq_enable(); 165 local_irq_enable();
165 166
166 cpu_set(cpu, cpu_online_map); 167 cpu_set(cpu, cpu_online_map);
diff --git a/arch/cris/kernel/process.c b/arch/cris/kernel/process.c
index 949a0e40e03c..7c80afb10460 100644
--- a/arch/cris/kernel/process.c
+++ b/arch/cris/kernel/process.c
@@ -218,7 +218,9 @@ void cpu_idle (void)
218 idle = default_idle; 218 idle = default_idle;
219 idle(); 219 idle();
220 } 220 }
221 preempt_enable_no_resched();
221 schedule(); 222 schedule();
223 preempt_disable();
222 } 224 }
223} 225}
224 226
diff --git a/arch/frv/kernel/process.c b/arch/frv/kernel/process.c
index 3001b82b1514..54a452136f00 100644
--- a/arch/frv/kernel/process.c
+++ b/arch/frv/kernel/process.c
@@ -77,16 +77,20 @@ void (*idle)(void) = core_sleep_idle;
77 */ 77 */
78void cpu_idle(void) 78void cpu_idle(void)
79{ 79{
80 int cpu = smp_processor_id();
81
80 /* endless idle loop with no priority at all */ 82 /* endless idle loop with no priority at all */
81 while (1) { 83 while (1) {
82 while (!need_resched()) { 84 while (!need_resched()) {
83 irq_stat[smp_processor_id()].idle_timestamp = jiffies; 85 irq_stat[cpu].idle_timestamp = jiffies;
84 86
85 if (!frv_dma_inprogress && idle) 87 if (!frv_dma_inprogress && idle)
86 idle(); 88 idle();
87 } 89 }
88 90
91 preempt_enable_no_resched();
89 schedule(); 92 schedule();
93 preempt_disable();
90 } 94 }
91} 95}
92 96
diff --git a/arch/h8300/kernel/process.c b/arch/h8300/kernel/process.c
index 27f1fce64ce4..fe21adf3e75e 100644
--- a/arch/h8300/kernel/process.c
+++ b/arch/h8300/kernel/process.c
@@ -53,22 +53,18 @@ asmlinkage void ret_from_fork(void);
53#if !defined(CONFIG_H8300H_SIM) && !defined(CONFIG_H8S_SIM) 53#if !defined(CONFIG_H8300H_SIM) && !defined(CONFIG_H8S_SIM)
54void default_idle(void) 54void default_idle(void)
55{ 55{
56 while(1) { 56 local_irq_disable();
57 if (!need_resched()) { 57 if (!need_resched()) {
58 local_irq_enable(); 58 local_irq_enable();
59 __asm__("sleep"); 59 /* XXX: race here! What if need_resched() gets set now? */
60 local_irq_disable(); 60 __asm__("sleep");
61 } 61 } else
62 schedule(); 62 local_irq_enable();
63 }
64} 63}
65#else 64#else
66void default_idle(void) 65void default_idle(void)
67{ 66{
68 while(1) { 67 cpu_relax();
69 if (need_resched())
70 schedule();
71 }
72} 68}
73#endif 69#endif
74void (*idle)(void) = default_idle; 70void (*idle)(void) = default_idle;
@@ -81,7 +77,13 @@ void (*idle)(void) = default_idle;
81 */ 77 */
82void cpu_idle(void) 78void cpu_idle(void)
83{ 79{
84 idle(); 80 while (1) {
81 while (!need_resched())
82 idle();
83 preempt_enable_no_resched();
84 schedule();
85 preempt_disable();
86 }
85} 87}
86 88
87void machine_restart(char * __unused) 89void machine_restart(char * __unused)
diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c
index 86e80c551478..003548b8735f 100644
--- a/arch/i386/kernel/apm.c
+++ b/arch/i386/kernel/apm.c
@@ -769,8 +769,26 @@ static int set_system_power_state(u_short state)
769static int apm_do_idle(void) 769static int apm_do_idle(void)
770{ 770{
771 u32 eax; 771 u32 eax;
772 u8 ret = 0;
773 int idled = 0;
774 int polling;
775
776 polling = test_thread_flag(TIF_POLLING_NRFLAG);
777 if (polling) {
778 clear_thread_flag(TIF_POLLING_NRFLAG);
779 smp_mb__after_clear_bit();
780 }
781 if (!need_resched()) {
782 idled = 1;
783 ret = apm_bios_call_simple(APM_FUNC_IDLE, 0, 0, &eax);
784 }
785 if (polling)
786 set_thread_flag(TIF_POLLING_NRFLAG);
787
788 if (!idled)
789 return 0;
772 790
773 if (apm_bios_call_simple(APM_FUNC_IDLE, 0, 0, &eax)) { 791 if (ret) {
774 static unsigned long t; 792 static unsigned long t;
775 793
776 /* This always fails on some SMP boards running UP kernels. 794 /* This always fails on some SMP boards running UP kernels.
diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c
index 7a14fdfd3af9..1cb261f225d5 100644
--- a/arch/i386/kernel/process.c
+++ b/arch/i386/kernel/process.c
@@ -99,14 +99,22 @@ EXPORT_SYMBOL(enable_hlt);
99 */ 99 */
100void default_idle(void) 100void default_idle(void)
101{ 101{
102 local_irq_enable();
103
102 if (!hlt_counter && boot_cpu_data.hlt_works_ok) { 104 if (!hlt_counter && boot_cpu_data.hlt_works_ok) {
103 local_irq_disable(); 105 clear_thread_flag(TIF_POLLING_NRFLAG);
104 if (!need_resched()) 106 smp_mb__after_clear_bit();
105 safe_halt(); 107 while (!need_resched()) {
106 else 108 local_irq_disable();
107 local_irq_enable(); 109 if (!need_resched())
110 safe_halt();
111 else
112 local_irq_enable();
113 }
114 set_thread_flag(TIF_POLLING_NRFLAG);
108 } else { 115 } else {
109 cpu_relax(); 116 while (!need_resched())
117 cpu_relax();
110 } 118 }
111} 119}
112#ifdef CONFIG_APM_MODULE 120#ifdef CONFIG_APM_MODULE
@@ -120,29 +128,14 @@ EXPORT_SYMBOL(default_idle);
120 */ 128 */
121static void poll_idle (void) 129static void poll_idle (void)
122{ 130{
123 int oldval;
124
125 local_irq_enable(); 131 local_irq_enable();
126 132
127 /* 133 asm volatile(
128 * Deal with another CPU just having chosen a thread to 134 "2:"
129 * run here: 135 "testl %0, %1;"
130 */ 136 "rep; nop;"
131 oldval = test_and_clear_thread_flag(TIF_NEED_RESCHED); 137 "je 2b;"
132 138 : : "i"(_TIF_NEED_RESCHED), "m" (current_thread_info()->flags));
133 if (!oldval) {
134 set_thread_flag(TIF_POLLING_NRFLAG);
135 asm volatile(
136 "2:"
137 "testl %0, %1;"
138 "rep; nop;"
139 "je 2b;"
140 : : "i"(_TIF_NEED_RESCHED), "m" (current_thread_info()->flags));
141
142 clear_thread_flag(TIF_POLLING_NRFLAG);
143 } else {
144 set_need_resched();
145 }
146} 139}
147 140
148#ifdef CONFIG_HOTPLUG_CPU 141#ifdef CONFIG_HOTPLUG_CPU
@@ -179,7 +172,9 @@ static inline void play_dead(void)
179 */ 172 */
180void cpu_idle(void) 173void cpu_idle(void)
181{ 174{
182 int cpu = raw_smp_processor_id(); 175 int cpu = smp_processor_id();
176
177 set_thread_flag(TIF_POLLING_NRFLAG);
183 178
184 /* endless idle loop with no priority at all */ 179 /* endless idle loop with no priority at all */
185 while (1) { 180 while (1) {
@@ -201,7 +196,9 @@ void cpu_idle(void)
201 __get_cpu_var(irq_stat).idle_timestamp = jiffies; 196 __get_cpu_var(irq_stat).idle_timestamp = jiffies;
202 idle(); 197 idle();
203 } 198 }
199 preempt_enable_no_resched();
204 schedule(); 200 schedule();
201 preempt_disable();
205 } 202 }
206} 203}
207 204
@@ -244,15 +241,12 @@ static void mwait_idle(void)
244{ 241{
245 local_irq_enable(); 242 local_irq_enable();
246 243
247 if (!need_resched()) { 244 while (!need_resched()) {
248 set_thread_flag(TIF_POLLING_NRFLAG); 245 __monitor((void *)&current_thread_info()->flags, 0, 0);
249 do { 246 smp_mb();
250 __monitor((void *)&current_thread_info()->flags, 0, 0); 247 if (need_resched())
251 if (need_resched()) 248 break;
252 break; 249 __mwait(0, 0);
253 __mwait(0, 0);
254 } while (!need_resched());
255 clear_thread_flag(TIF_POLLING_NRFLAG);
256 } 250 }
257} 251}
258 252
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index b48ac635f3c1..fdfcb0cba9b4 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -129,9 +129,7 @@ struct drive_info_struct { char dummy[32]; } drive_info;
129EXPORT_SYMBOL(drive_info); 129EXPORT_SYMBOL(drive_info);
130#endif 130#endif
131struct screen_info screen_info; 131struct screen_info screen_info;
132#ifdef CONFIG_VT
133EXPORT_SYMBOL(screen_info); 132EXPORT_SYMBOL(screen_info);
134#endif
135struct apm_info apm_info; 133struct apm_info apm_info;
136EXPORT_SYMBOL(apm_info); 134EXPORT_SYMBOL(apm_info);
137struct sys_desc_table_struct { 135struct sys_desc_table_struct {
diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c
index 47ec76794d02..bc5a9d97466b 100644
--- a/arch/i386/kernel/smpboot.c
+++ b/arch/i386/kernel/smpboot.c
@@ -485,6 +485,7 @@ static void __devinit start_secondary(void *unused)
485 * things done here to the most necessary things. 485 * things done here to the most necessary things.
486 */ 486 */
487 cpu_init(); 487 cpu_init();
488 preempt_disable();
488 smp_callin(); 489 smp_callin();
489 while (!cpu_isset(smp_processor_id(), smp_commenced_mask)) 490 while (!cpu_isset(smp_processor_id(), smp_commenced_mask))
490 rep_nop(); 491 rep_nop();
diff --git a/arch/ia64/ia32/ia32_ioctl.c b/arch/ia64/ia32/ia32_ioctl.c
index 164b211f4174..88739394f6df 100644
--- a/arch/ia64/ia32/ia32_ioctl.c
+++ b/arch/ia64/ia32/ia32_ioctl.c
@@ -29,10 +29,8 @@
29#define CODE 29#define CODE
30#include "compat_ioctl.c" 30#include "compat_ioctl.c"
31 31
32typedef int (* ioctl32_handler_t)(unsigned int, unsigned int, unsigned long, struct file *);
33
34#define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL((cmd),sys_ioctl) 32#define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL((cmd),sys_ioctl)
35#define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl32_handler_t)(handler), NULL }, 33#define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl_trans_handler_t)(handler), NULL },
36#define IOCTL_TABLE_START \ 34#define IOCTL_TABLE_START \
37 struct ioctl_trans ioctl_start[] = { 35 struct ioctl_trans ioctl_start[] = {
38#define IOCTL_TABLE_END \ 36#define IOCTL_TABLE_END \
diff --git a/arch/ia64/kernel/mca_drv.c b/arch/ia64/kernel/mca_drv.c
index f081c60ab206..eb39bc9c133b 100644
--- a/arch/ia64/kernel/mca_drv.c
+++ b/arch/ia64/kernel/mca_drv.c
@@ -88,7 +88,7 @@ mca_page_isolate(unsigned long paddr)
88 if (!ia64_phys_addr_valid(paddr)) 88 if (!ia64_phys_addr_valid(paddr))
89 return ISOLATE_NONE; 89 return ISOLATE_NONE;
90 90
91 if (!pfn_valid(paddr)) 91 if (!pfn_valid(paddr >> PAGE_SHIFT))
92 return ISOLATE_NONE; 92 return ISOLATE_NONE;
93 93
94 /* convert physical address to physical page number */ 94 /* convert physical address to physical page number */
@@ -108,6 +108,7 @@ mca_page_isolate(unsigned long paddr)
108 return ISOLATE_NG; 108 return ISOLATE_NG;
109 109
110 /* add attribute 'Reserved' and register the page */ 110 /* add attribute 'Reserved' and register the page */
111 get_page(p);
111 SetPageReserved(p); 112 SetPageReserved(p);
112 page_isolate[num_page_isolate++] = p; 113 page_isolate[num_page_isolate++] = p;
113 114
diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c
index 051e050359e4..640d6908f8ec 100644
--- a/arch/ia64/kernel/process.c
+++ b/arch/ia64/kernel/process.c
@@ -197,11 +197,15 @@ void
197default_idle (void) 197default_idle (void)
198{ 198{
199 local_irq_enable(); 199 local_irq_enable();
200 while (!need_resched()) 200 while (!need_resched()) {
201 if (can_do_pal_halt) 201 if (can_do_pal_halt) {
202 safe_halt(); 202 local_irq_disable();
203 else 203 if (!need_resched())
204 safe_halt();
205 local_irq_enable();
206 } else
204 cpu_relax(); 207 cpu_relax();
208 }
205} 209}
206 210
207#ifdef CONFIG_HOTPLUG_CPU 211#ifdef CONFIG_HOTPLUG_CPU
@@ -263,16 +267,16 @@ void __attribute__((noreturn))
263cpu_idle (void) 267cpu_idle (void)
264{ 268{
265 void (*mark_idle)(int) = ia64_mark_idle; 269 void (*mark_idle)(int) = ia64_mark_idle;
270 int cpu = smp_processor_id();
271 set_thread_flag(TIF_POLLING_NRFLAG);
266 272
267 /* endless idle loop with no priority at all */ 273 /* endless idle loop with no priority at all */
268 while (1) { 274 while (1) {
275 if (!need_resched()) {
276 void (*idle)(void);
269#ifdef CONFIG_SMP 277#ifdef CONFIG_SMP
270 if (!need_resched())
271 min_xtp(); 278 min_xtp();
272#endif 279#endif
273 while (!need_resched()) {
274 void (*idle)(void);
275
276 if (__get_cpu_var(cpu_idle_state)) 280 if (__get_cpu_var(cpu_idle_state))
277 __get_cpu_var(cpu_idle_state) = 0; 281 __get_cpu_var(cpu_idle_state) = 0;
278 282
@@ -284,17 +288,17 @@ cpu_idle (void)
284 if (!idle) 288 if (!idle)
285 idle = default_idle; 289 idle = default_idle;
286 (*idle)(); 290 (*idle)();
287 } 291 if (mark_idle)
288 292 (*mark_idle)(0);
289 if (mark_idle)
290 (*mark_idle)(0);
291
292#ifdef CONFIG_SMP 293#ifdef CONFIG_SMP
293 normal_xtp(); 294 normal_xtp();
294#endif 295#endif
296 }
297 preempt_enable_no_resched();
295 schedule(); 298 schedule();
299 preempt_disable();
296 check_pgt_cache(); 300 check_pgt_cache();
297 if (cpu_is_offline(smp_processor_id())) 301 if (cpu_is_offline(cpu))
298 play_dead(); 302 play_dead();
299 } 303 }
300} 304}
diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c
index 400a48987124..8f44e7d2df66 100644
--- a/arch/ia64/kernel/smpboot.c
+++ b/arch/ia64/kernel/smpboot.c
@@ -399,6 +399,7 @@ start_secondary (void *unused)
399 Dprintk("start_secondary: starting CPU 0x%x\n", hard_smp_processor_id()); 399 Dprintk("start_secondary: starting CPU 0x%x\n", hard_smp_processor_id());
400 efi_map_pal_code(); 400 efi_map_pal_code();
401 cpu_init(); 401 cpu_init();
402 preempt_disable();
402 smp_callin(); 403 smp_callin();
403 404
404 cpu_idle(); 405 cpu_idle();
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_provider.c b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
index 7b03b8084ffc..1f500c81002c 100644
--- a/arch/ia64/sn/pci/pcibr/pcibr_provider.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
@@ -212,13 +212,13 @@ void pcibr_target_interrupt(struct sn_irq_info *sn_irq_info)
212 pdi_pcibus_info; 212 pdi_pcibus_info;
213 213
214 /* Disable the device's IRQ */ 214 /* Disable the device's IRQ */
215 pcireg_intr_enable_bit_clr(pcibus_info, bit); 215 pcireg_intr_enable_bit_clr(pcibus_info, (1 << bit));
216 216
217 /* Change the device's IRQ */ 217 /* Change the device's IRQ */
218 pcireg_intr_addr_addr_set(pcibus_info, bit, xtalk_addr); 218 pcireg_intr_addr_addr_set(pcibus_info, bit, xtalk_addr);
219 219
220 /* Re-enable the device's IRQ */ 220 /* Re-enable the device's IRQ */
221 pcireg_intr_enable_bit_set(pcibus_info, bit); 221 pcireg_intr_enable_bit_set(pcibus_info, (1 << bit));
222 222
223 pcibr_force_interrupt(sn_irq_info); 223 pcibr_force_interrupt(sn_irq_info);
224 } 224 }
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_reg.c b/arch/ia64/sn/pci/pcibr/pcibr_reg.c
index 4f718c3e93d3..5d534091262c 100644
--- a/arch/ia64/sn/pci/pcibr/pcibr_reg.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_reg.c
@@ -131,7 +131,7 @@ void pcireg_intr_enable_bit_clr(struct pcibus_info *pcibus_info, uint64_t bits)
131 __sn_clrq_relaxed(&ptr->tio.cp_int_enable, bits); 131 __sn_clrq_relaxed(&ptr->tio.cp_int_enable, bits);
132 break; 132 break;
133 case PCIBR_BRIDGETYPE_PIC: 133 case PCIBR_BRIDGETYPE_PIC:
134 __sn_clrq_relaxed(&ptr->pic.p_int_enable, ~bits); 134 __sn_clrq_relaxed(&ptr->pic.p_int_enable, bits);
135 break; 135 break;
136 default: 136 default:
137 panic 137 panic
diff --git a/arch/m32r/kernel/process.c b/arch/m32r/kernel/process.c
index ea13a8f4d8b0..cc4b571e5db7 100644
--- a/arch/m32r/kernel/process.c
+++ b/arch/m32r/kernel/process.c
@@ -104,7 +104,9 @@ void cpu_idle (void)
104 104
105 idle(); 105 idle();
106 } 106 }
107 preempt_enable_no_resched();
107 schedule(); 108 schedule();
109 preempt_disable();
108 } 110 }
109} 111}
110 112
diff --git a/arch/m32r/kernel/smpboot.c b/arch/m32r/kernel/smpboot.c
index 640d592ea072..b90c54169fa5 100644
--- a/arch/m32r/kernel/smpboot.c
+++ b/arch/m32r/kernel/smpboot.c
@@ -426,6 +426,7 @@ void __init smp_cpus_done(unsigned int max_cpus)
426int __init start_secondary(void *unused) 426int __init start_secondary(void *unused)
427{ 427{
428 cpu_init(); 428 cpu_init();
429 preempt_disable();
429 smp_callin(); 430 smp_callin();
430 while (!cpu_isset(smp_processor_id(), smp_commenced_mask)) 431 while (!cpu_isset(smp_processor_id(), smp_commenced_mask))
431 cpu_relax(); 432 cpu_relax();
diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c
index 11b1b90ba6ba..13d109328a42 100644
--- a/arch/m68k/kernel/process.c
+++ b/arch/m68k/kernel/process.c
@@ -102,7 +102,9 @@ void cpu_idle(void)
102 while (1) { 102 while (1) {
103 while (!need_resched()) 103 while (!need_resched())
104 idle(); 104 idle();
105 preempt_enable_no_resched();
105 schedule(); 106 schedule();
107 preempt_disable();
106 } 108 }
107} 109}
108 110
diff --git a/arch/mips/au1000/common/setup.c b/arch/mips/au1000/common/setup.c
index 1ef15d5ef943..4f21f42d096b 100644
--- a/arch/mips/au1000/common/setup.c
+++ b/arch/mips/au1000/common/setup.c
@@ -111,17 +111,6 @@ void __init plat_setup(void)
111 } 111 }
112#endif 112#endif
113 113
114#ifdef CONFIG_FB_E1356
115 if ((argptr = strstr(argptr, "video=")) == NULL) {
116 argptr = prom_getcmdline();
117#ifdef CONFIG_MIPS_PB1000
118 strcat(argptr, " video=e1356fb:system:pb1000,mmunalign:1");
119#else
120 strcat(argptr, " video=e1356fb:system:pb1500");
121#endif
122 }
123#endif
124
125#ifdef CONFIG_FB_XPERT98 114#ifdef CONFIG_FB_XPERT98
126 if ((argptr = strstr(argptr, "video=")) == NULL) { 115 if ((argptr = strstr(argptr, "video=")) == NULL) {
127 argptr = prom_getcmdline(); 116 argptr = prom_getcmdline();
diff --git a/arch/mips/configs/ddb5476_defconfig b/arch/mips/configs/ddb5476_defconfig
index b260e51eb517..326f3aa63741 100644
--- a/arch/mips/configs/ddb5476_defconfig
+++ b/arch/mips/configs/ddb5476_defconfig
@@ -658,7 +658,6 @@ CONFIG_FB=y
658# CONFIG_FB_SMIVGX is not set 658# CONFIG_FB_SMIVGX is not set
659# CONFIG_FB_CYBLA is not set 659# CONFIG_FB_CYBLA is not set
660# CONFIG_FB_TRIDENT is not set 660# CONFIG_FB_TRIDENT is not set
661# CONFIG_FB_E1356 is not set
662# CONFIG_FB_S1D13XXX is not set 661# CONFIG_FB_S1D13XXX is not set
663# CONFIG_FB_VIRTUAL is not set 662# CONFIG_FB_VIRTUAL is not set
664 663
diff --git a/arch/mips/configs/jmr3927_defconfig b/arch/mips/configs/jmr3927_defconfig
index 9a728c2d8fd5..6390a753e80b 100644
--- a/arch/mips/configs/jmr3927_defconfig
+++ b/arch/mips/configs/jmr3927_defconfig
@@ -628,7 +628,6 @@ CONFIG_FB=y
628# CONFIG_FB_SMIVGX is not set 628# CONFIG_FB_SMIVGX is not set
629# CONFIG_FB_CYBLA is not set 629# CONFIG_FB_CYBLA is not set
630# CONFIG_FB_TRIDENT is not set 630# CONFIG_FB_TRIDENT is not set
631# CONFIG_FB_E1356 is not set
632# CONFIG_FB_S1D13XXX is not set 631# CONFIG_FB_S1D13XXX is not set
633# CONFIG_FB_VIRTUAL is not set 632# CONFIG_FB_VIRTUAL is not set
634 633
diff --git a/arch/mips/configs/ocelot_3_defconfig b/arch/mips/configs/ocelot_3_defconfig
index ffb23fcab862..f18d05c2ca77 100644
--- a/arch/mips/configs/ocelot_3_defconfig
+++ b/arch/mips/configs/ocelot_3_defconfig
@@ -758,7 +758,6 @@ CONFIG_FB_MODE_HELPERS=y
758# CONFIG_FB_SMIVGX is not set 758# CONFIG_FB_SMIVGX is not set
759# CONFIG_FB_CYBLA is not set 759# CONFIG_FB_CYBLA is not set
760# CONFIG_FB_TRIDENT is not set 760# CONFIG_FB_TRIDENT is not set
761# CONFIG_FB_E1356 is not set
762# CONFIG_FB_S1D13XXX is not set 761# CONFIG_FB_S1D13XXX is not set
763# CONFIG_FB_VIRTUAL is not set 762# CONFIG_FB_VIRTUAL is not set
764 763
diff --git a/arch/mips/configs/pnx8550-v2pci_defconfig b/arch/mips/configs/pnx8550-v2pci_defconfig
index 05e65206a7b4..37bd8d5c865d 100644
--- a/arch/mips/configs/pnx8550-v2pci_defconfig
+++ b/arch/mips/configs/pnx8550-v2pci_defconfig
@@ -897,7 +897,6 @@ CONFIG_FB=y
897# CONFIG_FB_SMIVGX is not set 897# CONFIG_FB_SMIVGX is not set
898# CONFIG_FB_CYBLA is not set 898# CONFIG_FB_CYBLA is not set
899# CONFIG_FB_TRIDENT is not set 899# CONFIG_FB_TRIDENT is not set
900# CONFIG_FB_E1356 is not set
901# CONFIG_FB_S1D13XXX is not set 900# CONFIG_FB_S1D13XXX is not set
902# CONFIG_FB_VIRTUAL is not set 901# CONFIG_FB_VIRTUAL is not set
903 902
diff --git a/arch/mips/configs/rbhma4500_defconfig b/arch/mips/configs/rbhma4500_defconfig
index 2bc61ca4ba08..897420d39053 100644
--- a/arch/mips/configs/rbhma4500_defconfig
+++ b/arch/mips/configs/rbhma4500_defconfig
@@ -876,7 +876,6 @@ CONFIG_FB_ATY_CT=y
876# CONFIG_FB_SMIVGX is not set 876# CONFIG_FB_SMIVGX is not set
877# CONFIG_FB_CYBLA is not set 877# CONFIG_FB_CYBLA is not set
878# CONFIG_FB_TRIDENT is not set 878# CONFIG_FB_TRIDENT is not set
879# CONFIG_FB_E1356 is not set
880# CONFIG_FB_S1D13XXX is not set 879# CONFIG_FB_S1D13XXX is not set
881# CONFIG_FB_VIRTUAL is not set 880# CONFIG_FB_VIRTUAL is not set
882 881
diff --git a/arch/mips/kernel/ioctl32.c b/arch/mips/kernel/ioctl32.c
index ed9b2da510be..9ea1fc748864 100644
--- a/arch/mips/kernel/ioctl32.c
+++ b/arch/mips/kernel/ioctl32.c
@@ -26,10 +26,8 @@ long sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg);
26#define CODE 26#define CODE
27#include "compat_ioctl.c" 27#include "compat_ioctl.c"
28 28
29typedef int (* ioctl32_handler_t)(unsigned int, unsigned int, unsigned long, struct file *);
30
31#define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL((cmd),sys_ioctl) 29#define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL((cmd),sys_ioctl)
32#define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl32_handler_t)(handler), NULL }, 30#define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl_trans_handler_t)(handler), NULL },
33#define IOCTL_TABLE_START \ 31#define IOCTL_TABLE_START \
34 struct ioctl_trans ioctl_start[] = { 32 struct ioctl_trans ioctl_start[] = {
35#define IOCTL_TABLE_END \ 33#define IOCTL_TABLE_END \
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
index 4fe3d5715c41..dd725779d91f 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
@@ -52,7 +52,9 @@ ATTRIB_NORET void cpu_idle(void)
52 while (!need_resched()) 52 while (!need_resched())
53 if (cpu_wait) 53 if (cpu_wait)
54 (*cpu_wait)(); 54 (*cpu_wait)();
55 preempt_enable_no_resched();
55 schedule(); 56 schedule();
57 preempt_disable();
56 } 58 }
57} 59}
58 60
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c
index fcacf1aae98a..25472fcaf715 100644
--- a/arch/mips/kernel/smp.c
+++ b/arch/mips/kernel/smp.c
@@ -82,7 +82,7 @@ extern ATTRIB_NORET void cpu_idle(void);
82 */ 82 */
83asmlinkage void start_secondary(void) 83asmlinkage void start_secondary(void)
84{ 84{
85 unsigned int cpu = smp_processor_id(); 85 unsigned int cpu;
86 86
87 cpu_probe(); 87 cpu_probe();
88 cpu_report(); 88 cpu_report();
@@ -95,6 +95,8 @@ asmlinkage void start_secondary(void)
95 */ 95 */
96 96
97 calibrate_delay(); 97 calibrate_delay();
98 preempt_disable();
99 cpu = smp_processor_id();
98 cpu_data[cpu].udelay_val = loops_per_jiffy; 100 cpu_data[cpu].udelay_val = loops_per_jiffy;
99 101
100 prom_smp_finish(); 102 prom_smp_finish();
diff --git a/arch/mips/tx4938/toshiba_rbtx4938/irq.c b/arch/mips/tx4938/toshiba_rbtx4938/irq.c
index 230f5a93c2e6..9cd9c0fe2265 100644
--- a/arch/mips/tx4938/toshiba_rbtx4938/irq.c
+++ b/arch/mips/tx4938/toshiba_rbtx4938/irq.c
@@ -84,7 +84,6 @@ IRQ Device
84#include <asm/ptrace.h> 84#include <asm/ptrace.h>
85#include <asm/reboot.h> 85#include <asm/reboot.h>
86#include <asm/time.h> 86#include <asm/time.h>
87#include <linux/version.h>
88#include <linux/bootmem.h> 87#include <linux/bootmem.h>
89#include <asm/tx4938/rbtx4938.h> 88#include <asm/tx4938/rbtx4938.h>
90 89
diff --git a/arch/parisc/kernel/asm-offsets.c b/arch/parisc/kernel/asm-offsets.c
index 1ad44f92d6e4..e23c4e1e3a25 100644
--- a/arch/parisc/kernel/asm-offsets.c
+++ b/arch/parisc/kernel/asm-offsets.c
@@ -30,7 +30,6 @@
30#include <linux/types.h> 30#include <linux/types.h>
31#include <linux/sched.h> 31#include <linux/sched.h>
32#include <linux/thread_info.h> 32#include <linux/thread_info.h>
33#include <linux/version.h>
34#include <linux/ptrace.h> 33#include <linux/ptrace.h>
35#include <linux/hardirq.h> 34#include <linux/hardirq.h>
36 35
diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c
index 7fdca87ef647..fee4f1f09adc 100644
--- a/arch/parisc/kernel/process.c
+++ b/arch/parisc/kernel/process.c
@@ -88,11 +88,15 @@ void default_idle(void)
88 */ 88 */
89void cpu_idle(void) 89void cpu_idle(void)
90{ 90{
91 set_thread_flag(TIF_POLLING_NRFLAG);
92
91 /* endless idle loop with no priority at all */ 93 /* endless idle loop with no priority at all */
92 while (1) { 94 while (1) {
93 while (!need_resched()) 95 while (!need_resched())
94 barrier(); 96 barrier();
97 preempt_enable_no_resched();
95 schedule(); 98 schedule();
99 preempt_disable();
96 check_pgt_cache(); 100 check_pgt_cache();
97 } 101 }
98} 102}
diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c
index 5db3be4e2704..a9ecf6465784 100644
--- a/arch/parisc/kernel/smp.c
+++ b/arch/parisc/kernel/smp.c
@@ -463,6 +463,7 @@ void __init smp_callin(void)
463#endif 463#endif
464 464
465 smp_cpu_init(slave_id); 465 smp_cpu_init(slave_id);
466 preempt_disable();
466 467
467#if 0 /* NOT WORKING YET - see entry.S */ 468#if 0 /* NOT WORKING YET - see entry.S */
468 istack = (void *)__get_free_pages(GFP_KERNEL,ISTACK_ORDER); 469 istack = (void *)__get_free_pages(GFP_KERNEL,ISTACK_ORDER);
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 5c330c3366e4..36d67a8d7cbb 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -510,6 +510,7 @@ int __devinit start_secondary(void *unused)
510 510
511 smp_store_cpu_info(cpu); 511 smp_store_cpu_info(cpu);
512 set_dec(tb_ticks_per_jiffy); 512 set_dec(tb_ticks_per_jiffy);
513 preempt_disable();
513 cpu_callin_map[cpu] = 1; 514 cpu_callin_map[cpu] = 1;
514 515
515 smp_ops->setup_cpu(cpu); 516 smp_ops->setup_cpu(cpu);
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 32f215825e8d..0578f8387603 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -887,10 +887,6 @@ void altivec_unavailable_exception(struct pt_regs *regs)
887 die("Unrecoverable VMX/Altivec Unavailable Exception", regs, SIGABRT); 887 die("Unrecoverable VMX/Altivec Unavailable Exception", regs, SIGABRT);
888} 888}
889 889
890#ifdef CONFIG_PPC64
891extern perf_irq_t perf_irq;
892#endif
893
894#if defined(CONFIG_PPC64) || defined(CONFIG_E500) 890#if defined(CONFIG_PPC64) || defined(CONFIG_E500)
895void performance_monitor_exception(struct pt_regs *regs) 891void performance_monitor_exception(struct pt_regs *regs)
896{ 892{
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index 97082a4203ad..71a6addf9f7f 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -21,6 +21,7 @@
21#include <asm/iommu.h> 21#include <asm/iommu.h>
22#include <asm/dma.h> 22#include <asm/dma.h>
23#include <asm/vio.h> 23#include <asm/vio.h>
24#include <asm/prom.h>
24 25
25static const struct vio_device_id *vio_match_device( 26static const struct vio_device_id *vio_match_device(
26 const struct vio_device_id *, const struct vio_dev *); 27 const struct vio_device_id *, const struct vio_dev *);
@@ -265,7 +266,33 @@ static int vio_bus_match(struct device *dev, struct device_driver *drv)
265 return (ids != NULL) && (vio_match_device(ids, vio_dev) != NULL); 266 return (ids != NULL) && (vio_match_device(ids, vio_dev) != NULL);
266} 267}
267 268
269static int vio_hotplug(struct device *dev, char **envp, int num_envp,
270 char *buffer, int buffer_size)
271{
272 const struct vio_dev *vio_dev = to_vio_dev(dev);
273 char *cp;
274 int length;
275
276 if (!num_envp)
277 return -ENOMEM;
278
279 if (!vio_dev->dev.platform_data)
280 return -ENODEV;
281 cp = (char *)get_property(vio_dev->dev.platform_data, "compatible", &length);
282 if (!cp)
283 return -ENODEV;
284
285 envp[0] = buffer;
286 length = scnprintf(buffer, buffer_size, "MODALIAS=vio:T%sS%s",
287 vio_dev->type, cp);
288 if (buffer_size - length <= 0)
289 return -ENOMEM;
290 envp[1] = NULL;
291 return 0;
292}
293
268struct bus_type vio_bus_type = { 294struct bus_type vio_bus_type = {
269 .name = "vio", 295 .name = "vio",
296 .hotplug = vio_hotplug,
270 .match = vio_bus_match, 297 .match = vio_bus_match,
271}; 298};
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index d3e4bf756c83..7f8f0cda6a74 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -694,20 +694,19 @@ static void iseries_shared_idle(void)
694 if (hvlpevent_is_pending()) 694 if (hvlpevent_is_pending())
695 process_iSeries_events(); 695 process_iSeries_events();
696 696
697 preempt_enable_no_resched();
697 schedule(); 698 schedule();
699 preempt_disable();
698 } 700 }
699} 701}
700 702
701static void iseries_dedicated_idle(void) 703static void iseries_dedicated_idle(void)
702{ 704{
703 long oldval; 705 long oldval;
706 set_thread_flag(TIF_POLLING_NRFLAG);
704 707
705 while (1) { 708 while (1) {
706 oldval = test_and_clear_thread_flag(TIF_NEED_RESCHED); 709 if (!need_resched()) {
707
708 if (!oldval) {
709 set_thread_flag(TIF_POLLING_NRFLAG);
710
711 while (!need_resched()) { 710 while (!need_resched()) {
712 ppc64_runlatch_off(); 711 ppc64_runlatch_off();
713 HMT_low(); 712 HMT_low();
@@ -720,13 +719,12 @@ static void iseries_dedicated_idle(void)
720 } 719 }
721 720
722 HMT_medium(); 721 HMT_medium();
723 clear_thread_flag(TIF_POLLING_NRFLAG);
724 } else {
725 set_need_resched();
726 } 722 }
727 723
728 ppc64_runlatch_on(); 724 ppc64_runlatch_on();
725 preempt_enable_no_resched();
729 schedule(); 726 schedule();
727 preempt_disable();
730 } 728 }
731} 729}
732 730
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index e78c39368841..a093a0d4dd69 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -469,6 +469,7 @@ static inline void dedicated_idle_sleep(unsigned int cpu)
469 * more. 469 * more.
470 */ 470 */
471 clear_thread_flag(TIF_POLLING_NRFLAG); 471 clear_thread_flag(TIF_POLLING_NRFLAG);
472 smp_mb__after_clear_bit();
472 473
473 /* 474 /*
474 * SMT dynamic mode. Cede will result in this thread going 475 * SMT dynamic mode. Cede will result in this thread going
@@ -481,6 +482,7 @@ static inline void dedicated_idle_sleep(unsigned int cpu)
481 cede_processor(); 482 cede_processor();
482 else 483 else
483 local_irq_enable(); 484 local_irq_enable();
485 set_thread_flag(TIF_POLLING_NRFLAG);
484 } else { 486 } else {
485 /* 487 /*
486 * Give the HV an opportunity at the processor, since we are 488 * Give the HV an opportunity at the processor, since we are
@@ -492,11 +494,11 @@ static inline void dedicated_idle_sleep(unsigned int cpu)
492 494
493static void pseries_dedicated_idle(void) 495static void pseries_dedicated_idle(void)
494{ 496{
495 long oldval;
496 struct paca_struct *lpaca = get_paca(); 497 struct paca_struct *lpaca = get_paca();
497 unsigned int cpu = smp_processor_id(); 498 unsigned int cpu = smp_processor_id();
498 unsigned long start_snooze; 499 unsigned long start_snooze;
499 unsigned long *smt_snooze_delay = &__get_cpu_var(smt_snooze_delay); 500 unsigned long *smt_snooze_delay = &__get_cpu_var(smt_snooze_delay);
501 set_thread_flag(TIF_POLLING_NRFLAG);
500 502
501 while (1) { 503 while (1) {
502 /* 504 /*
@@ -505,10 +507,7 @@ static void pseries_dedicated_idle(void)
505 */ 507 */
506 lpaca->lppaca.idle = 1; 508 lpaca->lppaca.idle = 1;
507 509
508 oldval = test_and_clear_thread_flag(TIF_NEED_RESCHED); 510 if (!need_resched()) {
509 if (!oldval) {
510 set_thread_flag(TIF_POLLING_NRFLAG);
511
512 start_snooze = __get_tb() + 511 start_snooze = __get_tb() +
513 *smt_snooze_delay * tb_ticks_per_usec; 512 *smt_snooze_delay * tb_ticks_per_usec;
514 513
@@ -531,15 +530,14 @@ static void pseries_dedicated_idle(void)
531 } 530 }
532 531
533 HMT_medium(); 532 HMT_medium();
534 clear_thread_flag(TIF_POLLING_NRFLAG);
535 } else {
536 set_need_resched();
537 } 533 }
538 534
539 lpaca->lppaca.idle = 0; 535 lpaca->lppaca.idle = 0;
540 ppc64_runlatch_on(); 536 ppc64_runlatch_on();
541 537
538 preempt_enable_no_resched();
542 schedule(); 539 schedule();
540 preempt_disable();
543 541
544 if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING) 542 if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING)
545 cpu_die(); 543 cpu_die();
@@ -583,7 +581,9 @@ static void pseries_shared_idle(void)
583 lpaca->lppaca.idle = 0; 581 lpaca->lppaca.idle = 0;
584 ppc64_runlatch_on(); 582 ppc64_runlatch_on();
585 583
584 preempt_enable_no_resched();
586 schedule(); 585 schedule();
586 preempt_disable();
587 587
588 if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING) 588 if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING)
589 cpu_die(); 589 cpu_die();
diff --git a/arch/ppc/configs/mpc834x_sys_defconfig b/arch/ppc/configs/mpc834x_sys_defconfig
index 4a5522ca8207..673dc64ebcb1 100644
--- a/arch/ppc/configs/mpc834x_sys_defconfig
+++ b/arch/ppc/configs/mpc834x_sys_defconfig
@@ -1,16 +1,17 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc4 3# Linux kernel version: 2.6.14
4# Thu Feb 17 16:12:23 2005 4# Mon Nov 7 15:38:29 2005
5# 5#
6CONFIG_MMU=y 6CONFIG_MMU=y
7CONFIG_GENERIC_HARDIRQS=y 7CONFIG_GENERIC_HARDIRQS=y
8CONFIG_RWSEM_XCHGADD_ALGORITHM=y 8CONFIG_RWSEM_XCHGADD_ALGORITHM=y
9CONFIG_GENERIC_CALIBRATE_DELAY=y 9CONFIG_GENERIC_CALIBRATE_DELAY=y
10CONFIG_HAVE_DEC_LOCK=y
11CONFIG_PPC=y 10CONFIG_PPC=y
12CONFIG_PPC32=y 11CONFIG_PPC32=y
13CONFIG_GENERIC_NVRAM=y 12CONFIG_GENERIC_NVRAM=y
13CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
14CONFIG_ARCH_MAY_HAVE_PC_FDC=y
14 15
15# 16#
16# Code maturity level options 17# Code maturity level options
@@ -18,23 +19,28 @@ CONFIG_GENERIC_NVRAM=y
18CONFIG_EXPERIMENTAL=y 19CONFIG_EXPERIMENTAL=y
19CONFIG_CLEAN_COMPILE=y 20CONFIG_CLEAN_COMPILE=y
20CONFIG_BROKEN_ON_SMP=y 21CONFIG_BROKEN_ON_SMP=y
22CONFIG_INIT_ENV_ARG_LIMIT=32
21 23
22# 24#
23# General setup 25# General setup
24# 26#
25CONFIG_LOCALVERSION="" 27CONFIG_LOCALVERSION=""
28CONFIG_LOCALVERSION_AUTO=y
26CONFIG_SWAP=y 29CONFIG_SWAP=y
27CONFIG_SYSVIPC=y 30CONFIG_SYSVIPC=y
28# CONFIG_POSIX_MQUEUE is not set 31# CONFIG_POSIX_MQUEUE is not set
29# CONFIG_BSD_PROCESS_ACCT is not set 32# CONFIG_BSD_PROCESS_ACCT is not set
30CONFIG_SYSCTL=y 33CONFIG_SYSCTL=y
31# CONFIG_AUDIT is not set 34# CONFIG_AUDIT is not set
32CONFIG_LOG_BUF_SHIFT=14
33# CONFIG_HOTPLUG is not set 35# CONFIG_HOTPLUG is not set
34CONFIG_KOBJECT_UEVENT=y 36CONFIG_KOBJECT_UEVENT=y
35# CONFIG_IKCONFIG is not set 37# CONFIG_IKCONFIG is not set
38CONFIG_INITRAMFS_SOURCE=""
36CONFIG_EMBEDDED=y 39CONFIG_EMBEDDED=y
37# CONFIG_KALLSYMS is not set 40# CONFIG_KALLSYMS is not set
41CONFIG_PRINTK=y
42CONFIG_BUG=y
43CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y 44CONFIG_FUTEX=y
39# CONFIG_EPOLL is not set 45# CONFIG_EPOLL is not set
40# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 46# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -44,6 +50,7 @@ CONFIG_CC_ALIGN_LABELS=0
44CONFIG_CC_ALIGN_LOOPS=0 50CONFIG_CC_ALIGN_LOOPS=0
45CONFIG_CC_ALIGN_JUMPS=0 51CONFIG_CC_ALIGN_JUMPS=0
46# CONFIG_TINY_SHMEM is not set 52# CONFIG_TINY_SHMEM is not set
53CONFIG_BASE_SMALL=0
47 54
48# 55#
49# Loadable module support 56# Loadable module support
@@ -59,34 +66,84 @@ CONFIG_6xx=y
59# CONFIG_POWER3 is not set 66# CONFIG_POWER3 is not set
60# CONFIG_POWER4 is not set 67# CONFIG_POWER4 is not set
61# CONFIG_8xx is not set 68# CONFIG_8xx is not set
69# CONFIG_E200 is not set
62# CONFIG_E500 is not set 70# CONFIG_E500 is not set
71CONFIG_PPC_FPU=y
72# CONFIG_KEXEC is not set
63# CONFIG_CPU_FREQ is not set 73# CONFIG_CPU_FREQ is not set
74# CONFIG_WANT_EARLY_SERIAL is not set
64CONFIG_PPC_GEN550=y 75CONFIG_PPC_GEN550=y
65CONFIG_83xx=y
66
67#
68# Freescale 83xx options
69#
70CONFIG_MPC834x_SYS=y
71CONFIG_MPC834x=y
72CONFIG_PPC_STD_MMU=y 76CONFIG_PPC_STD_MMU=y
73 77
74# 78#
75# Platform options 79# Platform options
76# 80#
81# CONFIG_PPC_MULTIPLATFORM is not set
82# CONFIG_APUS is not set
83# CONFIG_KATANA is not set
84# CONFIG_WILLOW is not set
85# CONFIG_CPCI690 is not set
86# CONFIG_POWERPMC250 is not set
87# CONFIG_CHESTNUT is not set
88# CONFIG_SPRUCE is not set
89# CONFIG_HDPU is not set
90# CONFIG_EV64260 is not set
91# CONFIG_LOPEC is not set
92# CONFIG_MVME5100 is not set
93# CONFIG_PPLUS is not set
94# CONFIG_PRPMC750 is not set
95# CONFIG_PRPMC800 is not set
96# CONFIG_SANDPOINT is not set
97# CONFIG_RADSTONE_PPC7D is not set
98# CONFIG_PAL4 is not set
99# CONFIG_GEMINI is not set
100# CONFIG_EST8260 is not set
101# CONFIG_SBC82xx is not set
102# CONFIG_SBS8260 is not set
103# CONFIG_RPX8260 is not set
104# CONFIG_TQM8260 is not set
105# CONFIG_ADS8272 is not set
106# CONFIG_PQ2FADS is not set
107# CONFIG_LITE5200 is not set
108CONFIG_MPC834x_SYS=y
109# CONFIG_EV64360 is not set
110CONFIG_83xx=y
111CONFIG_MPC834x=y
77# CONFIG_SMP is not set 112# CONFIG_SMP is not set
78# CONFIG_PREEMPT is not set
79# CONFIG_HIGHMEM is not set 113# CONFIG_HIGHMEM is not set
114# CONFIG_HZ_100 is not set
115CONFIG_HZ_250=y
116# CONFIG_HZ_1000 is not set
117CONFIG_HZ=250
118CONFIG_PREEMPT_NONE=y
119# CONFIG_PREEMPT_VOLUNTARY is not set
120# CONFIG_PREEMPT is not set
121CONFIG_SELECT_MEMORY_MODEL=y
122CONFIG_FLATMEM_MANUAL=y
123# CONFIG_DISCONTIGMEM_MANUAL is not set
124# CONFIG_SPARSEMEM_MANUAL is not set
125CONFIG_FLATMEM=y
126CONFIG_FLAT_NODE_MEM_MAP=y
127# CONFIG_SPARSEMEM_STATIC is not set
128CONFIG_SPLIT_PTLOCK_CPUS=4
80CONFIG_BINFMT_ELF=y 129CONFIG_BINFMT_ELF=y
81# CONFIG_BINFMT_MISC is not set 130# CONFIG_BINFMT_MISC is not set
82# CONFIG_CMDLINE_BOOL is not set 131# CONFIG_CMDLINE_BOOL is not set
132# CONFIG_PM is not set
133# CONFIG_SOFTWARE_SUSPEND is not set
134CONFIG_SECCOMP=y
135CONFIG_ISA_DMA_API=y
83 136
84# 137#
85# Bus options 138# Bus options
86# 139#
87CONFIG_GENERIC_ISA_DMA=y 140CONFIG_GENERIC_ISA_DMA=y
88# CONFIG_PCI is not set 141# CONFIG_PPC_I8259 is not set
89# CONFIG_PCI_DOMAINS is not set 142CONFIG_PPC_INDIRECT_PCI=y
143CONFIG_PCI=y
144CONFIG_PCI_DOMAINS=y
145# CONFIG_MPC83xx_PCI2 is not set
146CONFIG_PCI_LEGACY_PROC=y
90 147
91# 148#
92# PCCARD (PCMCIA/CardBus) support 149# PCCARD (PCMCIA/CardBus) support
@@ -94,10 +151,6 @@ CONFIG_GENERIC_ISA_DMA=y
94# CONFIG_PCCARD is not set 151# CONFIG_PCCARD is not set
95 152
96# 153#
97# PC-card bridges
98#
99
100#
101# Advanced setup 154# Advanced setup
102# 155#
103# CONFIG_ADVANCED_OPTIONS is not set 156# CONFIG_ADVANCED_OPTIONS is not set
@@ -112,6 +165,75 @@ CONFIG_TASK_SIZE=0x80000000
112CONFIG_BOOT_LOAD=0x00800000 165CONFIG_BOOT_LOAD=0x00800000
113 166
114# 167#
168# Networking
169#
170CONFIG_NET=y
171
172#
173# Networking options
174#
175CONFIG_PACKET=y
176# CONFIG_PACKET_MMAP is not set
177CONFIG_UNIX=y
178# CONFIG_NET_KEY is not set
179CONFIG_INET=y
180CONFIG_IP_MULTICAST=y
181# CONFIG_IP_ADVANCED_ROUTER is not set
182CONFIG_IP_FIB_HASH=y
183CONFIG_IP_PNP=y
184CONFIG_IP_PNP_DHCP=y
185CONFIG_IP_PNP_BOOTP=y
186# CONFIG_IP_PNP_RARP is not set
187# CONFIG_NET_IPIP is not set
188# CONFIG_NET_IPGRE is not set
189# CONFIG_IP_MROUTE is not set
190# CONFIG_ARPD is not set
191CONFIG_SYN_COOKIES=y
192# CONFIG_INET_AH is not set
193# CONFIG_INET_ESP is not set
194# CONFIG_INET_IPCOMP is not set
195# CONFIG_INET_TUNNEL is not set
196CONFIG_INET_DIAG=y
197CONFIG_INET_TCP_DIAG=y
198# CONFIG_TCP_CONG_ADVANCED is not set
199CONFIG_TCP_CONG_BIC=y
200# CONFIG_IPV6 is not set
201# CONFIG_NETFILTER is not set
202
203#
204# DCCP Configuration (EXPERIMENTAL)
205#
206# CONFIG_IP_DCCP is not set
207
208#
209# SCTP Configuration (EXPERIMENTAL)
210#
211# CONFIG_IP_SCTP is not set
212# CONFIG_ATM is not set
213# CONFIG_BRIDGE is not set
214# CONFIG_VLAN_8021Q is not set
215# CONFIG_DECNET is not set
216# CONFIG_LLC2 is not set
217# CONFIG_IPX is not set
218# CONFIG_ATALK is not set
219# CONFIG_X25 is not set
220# CONFIG_LAPB is not set
221# CONFIG_NET_DIVERT is not set
222# CONFIG_ECONET is not set
223# CONFIG_WAN_ROUTER is not set
224# CONFIG_NET_SCHED is not set
225# CONFIG_NET_CLS_ROUTE is not set
226
227#
228# Network testing
229#
230# CONFIG_NET_PKTGEN is not set
231# CONFIG_HAMRADIO is not set
232# CONFIG_IRDA is not set
233# CONFIG_BT is not set
234# CONFIG_IEEE80211 is not set
235
236#
115# Device Drivers 237# Device Drivers
116# 238#
117 239
@@ -123,6 +245,11 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
123# CONFIG_FW_LOADER is not set 245# CONFIG_FW_LOADER is not set
124 246
125# 247#
248# Connector - unified userspace <-> kernelspace linker
249#
250# CONFIG_CONNECTOR is not set
251
252#
126# Memory Technology Devices (MTD) 253# Memory Technology Devices (MTD)
127# 254#
128# CONFIG_MTD is not set 255# CONFIG_MTD is not set
@@ -140,15 +267,19 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
140# Block devices 267# Block devices
141# 268#
142# CONFIG_BLK_DEV_FD is not set 269# CONFIG_BLK_DEV_FD is not set
270# CONFIG_BLK_CPQ_DA is not set
271# CONFIG_BLK_CPQ_CISS_DA is not set
272# CONFIG_BLK_DEV_DAC960 is not set
273# CONFIG_BLK_DEV_UMEM is not set
143# CONFIG_BLK_DEV_COW_COMMON is not set 274# CONFIG_BLK_DEV_COW_COMMON is not set
144CONFIG_BLK_DEV_LOOP=y 275CONFIG_BLK_DEV_LOOP=y
145# CONFIG_BLK_DEV_CRYPTOLOOP is not set 276# CONFIG_BLK_DEV_CRYPTOLOOP is not set
146# CONFIG_BLK_DEV_NBD is not set 277# CONFIG_BLK_DEV_NBD is not set
278# CONFIG_BLK_DEV_SX8 is not set
147CONFIG_BLK_DEV_RAM=y 279CONFIG_BLK_DEV_RAM=y
148CONFIG_BLK_DEV_RAM_COUNT=16 280CONFIG_BLK_DEV_RAM_COUNT=16
149CONFIG_BLK_DEV_RAM_SIZE=32768 281CONFIG_BLK_DEV_RAM_SIZE=32768
150CONFIG_BLK_DEV_INITRD=y 282CONFIG_BLK_DEV_INITRD=y
151CONFIG_INITRAMFS_SOURCE=""
152# CONFIG_LBD is not set 283# CONFIG_LBD is not set
153# CONFIG_CDROM_PKTCDVD is not set 284# CONFIG_CDROM_PKTCDVD is not set
154 285
@@ -159,6 +290,11 @@ CONFIG_IOSCHED_NOOP=y
159CONFIG_IOSCHED_AS=y 290CONFIG_IOSCHED_AS=y
160CONFIG_IOSCHED_DEADLINE=y 291CONFIG_IOSCHED_DEADLINE=y
161CONFIG_IOSCHED_CFQ=y 292CONFIG_IOSCHED_CFQ=y
293CONFIG_DEFAULT_AS=y
294# CONFIG_DEFAULT_DEADLINE is not set
295# CONFIG_DEFAULT_CFQ is not set
296# CONFIG_DEFAULT_NOOP is not set
297CONFIG_DEFAULT_IOSCHED="anticipatory"
162# CONFIG_ATA_OVER_ETH is not set 298# CONFIG_ATA_OVER_ETH is not set
163 299
164# 300#
@@ -169,6 +305,7 @@ CONFIG_IOSCHED_CFQ=y
169# 305#
170# SCSI device support 306# SCSI device support
171# 307#
308# CONFIG_RAID_ATTRS is not set
172# CONFIG_SCSI is not set 309# CONFIG_SCSI is not set
173 310
174# 311#
@@ -179,110 +316,116 @@ CONFIG_IOSCHED_CFQ=y
179# 316#
180# Fusion MPT device support 317# Fusion MPT device support
181# 318#
319# CONFIG_FUSION is not set
182 320
183# 321#
184# IEEE 1394 (FireWire) support 322# IEEE 1394 (FireWire) support
185# 323#
324# CONFIG_IEEE1394 is not set
186 325
187# 326#
188# I2O device support 327# I2O device support
189# 328#
329# CONFIG_I2O is not set
190 330
191# 331#
192# Macintosh device drivers 332# Macintosh device drivers
193# 333#
194 334
195# 335#
196# Networking support 336# Network device support
197# 337#
198CONFIG_NET=y 338CONFIG_NETDEVICES=y
199 339# CONFIG_DUMMY is not set
200# 340# CONFIG_BONDING is not set
201# Networking options 341# CONFIG_EQUALIZER is not set
202# 342# CONFIG_TUN is not set
203CONFIG_PACKET=y
204# CONFIG_PACKET_MMAP is not set
205# CONFIG_NETLINK_DEV is not set
206CONFIG_UNIX=y
207# CONFIG_NET_KEY is not set
208CONFIG_INET=y
209CONFIG_IP_MULTICAST=y
210# CONFIG_IP_ADVANCED_ROUTER is not set
211CONFIG_IP_PNP=y
212CONFIG_IP_PNP_DHCP=y
213CONFIG_IP_PNP_BOOTP=y
214# CONFIG_IP_PNP_RARP is not set
215# CONFIG_NET_IPIP is not set
216# CONFIG_NET_IPGRE is not set
217# CONFIG_IP_MROUTE is not set
218# CONFIG_ARPD is not set
219CONFIG_SYN_COOKIES=y
220# CONFIG_INET_AH is not set
221# CONFIG_INET_ESP is not set
222# CONFIG_INET_IPCOMP is not set
223# CONFIG_INET_TUNNEL is not set
224CONFIG_IP_TCPDIAG=y
225# CONFIG_IP_TCPDIAG_IPV6 is not set
226# CONFIG_IPV6 is not set
227# CONFIG_NETFILTER is not set
228 343
229# 344#
230# SCTP Configuration (EXPERIMENTAL) 345# ARCnet devices
231# 346#
232# CONFIG_IP_SCTP is not set 347# CONFIG_ARCNET is not set
233# CONFIG_ATM is not set
234# CONFIG_BRIDGE is not set
235# CONFIG_VLAN_8021Q is not set
236# CONFIG_DECNET is not set
237# CONFIG_LLC2 is not set
238# CONFIG_IPX is not set
239# CONFIG_ATALK is not set
240# CONFIG_X25 is not set
241# CONFIG_LAPB is not set
242# CONFIG_NET_DIVERT is not set
243# CONFIG_ECONET is not set
244# CONFIG_WAN_ROUTER is not set
245 348
246# 349#
247# QoS and/or fair queueing 350# PHY device support
248# 351#
249# CONFIG_NET_SCHED is not set 352CONFIG_PHYLIB=y
250# CONFIG_NET_CLS_ROUTE is not set
251 353
252# 354#
253# Network testing 355# MII PHY device drivers
254# 356#
255# CONFIG_NET_PKTGEN is not set 357CONFIG_MARVELL_PHY=y
256# CONFIG_NETPOLL is not set 358# CONFIG_DAVICOM_PHY is not set
257# CONFIG_NET_POLL_CONTROLLER is not set 359# CONFIG_QSEMI_PHY is not set
258# CONFIG_HAMRADIO is not set 360# CONFIG_LXT_PHY is not set
259# CONFIG_IRDA is not set 361# CONFIG_CICADA_PHY is not set
260# CONFIG_BT is not set
261CONFIG_NETDEVICES=y
262# CONFIG_DUMMY is not set
263# CONFIG_BONDING is not set
264# CONFIG_EQUALIZER is not set
265# CONFIG_TUN is not set
266 362
267# 363#
268# Ethernet (10 or 100Mbit) 364# Ethernet (10 or 100Mbit)
269# 365#
270CONFIG_NET_ETHERNET=y 366CONFIG_NET_ETHERNET=y
271CONFIG_MII=y 367CONFIG_MII=y
368# CONFIG_HAPPYMEAL is not set
369# CONFIG_SUNGEM is not set
370# CONFIG_CASSINI is not set
371# CONFIG_NET_VENDOR_3COM is not set
372
373#
374# Tulip family network device support
375#
376# CONFIG_NET_TULIP is not set
377# CONFIG_HP100 is not set
378CONFIG_NET_PCI=y
379# CONFIG_PCNET32 is not set
380# CONFIG_AMD8111_ETH is not set
381# CONFIG_ADAPTEC_STARFIRE is not set
382# CONFIG_B44 is not set
383# CONFIG_FORCEDETH is not set
384# CONFIG_DGRS is not set
385# CONFIG_EEPRO100 is not set
386CONFIG_E100=y
387# CONFIG_FEALNX is not set
388# CONFIG_NATSEMI is not set
389# CONFIG_NE2K_PCI is not set
390# CONFIG_8139CP is not set
391# CONFIG_8139TOO is not set
392# CONFIG_SIS900 is not set
393# CONFIG_EPIC100 is not set
394# CONFIG_SUNDANCE is not set
395# CONFIG_TLAN is not set
396# CONFIG_VIA_RHINE is not set
272 397
273# 398#
274# Ethernet (1000 Mbit) 399# Ethernet (1000 Mbit)
275# 400#
401# CONFIG_ACENIC is not set
402# CONFIG_DL2K is not set
403CONFIG_E1000=y
404# CONFIG_E1000_NAPI is not set
405# CONFIG_NS83820 is not set
406# CONFIG_HAMACHI is not set
407# CONFIG_YELLOWFIN is not set
408# CONFIG_R8169 is not set
409# CONFIG_SIS190 is not set
410# CONFIG_SKGE is not set
411# CONFIG_SK98LIN is not set
412# CONFIG_VIA_VELOCITY is not set
413# CONFIG_TIGON3 is not set
414# CONFIG_BNX2 is not set
276CONFIG_GIANFAR=y 415CONFIG_GIANFAR=y
277# CONFIG_GFAR_NAPI is not set 416# CONFIG_GFAR_NAPI is not set
278 417
279# 418#
280# Ethernet (10000 Mbit) 419# Ethernet (10000 Mbit)
281# 420#
421# CONFIG_CHELSIO_T1 is not set
422# CONFIG_IXGB is not set
423# CONFIG_S2IO is not set
282 424
283# 425#
284# Token Ring devices 426# Token Ring devices
285# 427#
428# CONFIG_TR is not set
286 429
287# 430#
288# Wireless LAN (non-hamradio) 431# Wireless LAN (non-hamradio)
@@ -293,10 +436,14 @@ CONFIG_GIANFAR=y
293# Wan interfaces 436# Wan interfaces
294# 437#
295# CONFIG_WAN is not set 438# CONFIG_WAN is not set
439# CONFIG_FDDI is not set
440# CONFIG_HIPPI is not set
296# CONFIG_PPP is not set 441# CONFIG_PPP is not set
297# CONFIG_SLIP is not set 442# CONFIG_SLIP is not set
298# CONFIG_SHAPER is not set 443# CONFIG_SHAPER is not set
299# CONFIG_NETCONSOLE is not set 444# CONFIG_NETCONSOLE is not set
445# CONFIG_NETPOLL is not set
446# CONFIG_NET_POLL_CONTROLLER is not set
300 447
301# 448#
302# ISDN subsystem 449# ISDN subsystem
@@ -323,14 +470,6 @@ CONFIG_INPUT=y
323# CONFIG_INPUT_EVBUG is not set 470# CONFIG_INPUT_EVBUG is not set
324 471
325# 472#
326# Input I/O drivers
327#
328# CONFIG_GAMEPORT is not set
329CONFIG_SOUND_GAMEPORT=y
330# CONFIG_SERIO is not set
331# CONFIG_SERIO_I8042 is not set
332
333#
334# Input Device Drivers 473# Input Device Drivers
335# 474#
336# CONFIG_INPUT_KEYBOARD is not set 475# CONFIG_INPUT_KEYBOARD is not set
@@ -340,6 +479,12 @@ CONFIG_SOUND_GAMEPORT=y
340# CONFIG_INPUT_MISC is not set 479# CONFIG_INPUT_MISC is not set
341 480
342# 481#
482# Hardware I/O ports
483#
484# CONFIG_SERIO is not set
485# CONFIG_GAMEPORT is not set
486
487#
343# Character devices 488# Character devices
344# 489#
345# CONFIG_VT is not set 490# CONFIG_VT is not set
@@ -358,6 +503,7 @@ CONFIG_SERIAL_8250_NR_UARTS=4
358# 503#
359CONFIG_SERIAL_CORE=y 504CONFIG_SERIAL_CORE=y
360CONFIG_SERIAL_CORE_CONSOLE=y 505CONFIG_SERIAL_CORE_CONSOLE=y
506# CONFIG_SERIAL_JSM is not set
361CONFIG_UNIX98_PTYS=y 507CONFIG_UNIX98_PTYS=y
362CONFIG_LEGACY_PTYS=y 508CONFIG_LEGACY_PTYS=y
363CONFIG_LEGACY_PTY_COUNT=256 509CONFIG_LEGACY_PTY_COUNT=256
@@ -376,6 +522,7 @@ CONFIG_GEN_RTC=y
376# CONFIG_GEN_RTC_X is not set 522# CONFIG_GEN_RTC_X is not set
377# CONFIG_DTLK is not set 523# CONFIG_DTLK is not set
378# CONFIG_R3964 is not set 524# CONFIG_R3964 is not set
525# CONFIG_APPLICOM is not set
379 526
380# 527#
381# Ftape, the floppy tape device driver 528# Ftape, the floppy tape device driver
@@ -385,6 +532,12 @@ CONFIG_GEN_RTC=y
385# CONFIG_RAW_DRIVER is not set 532# CONFIG_RAW_DRIVER is not set
386 533
387# 534#
535# TPM devices
536#
537# CONFIG_TCG_TPM is not set
538# CONFIG_TELCLOCK is not set
539
540#
388# I2C support 541# I2C support
389# 542#
390CONFIG_I2C=y 543CONFIG_I2C=y
@@ -400,23 +553,68 @@ CONFIG_I2C_CHARDEV=y
400# 553#
401# I2C Hardware Bus support 554# I2C Hardware Bus support
402# 555#
403# CONFIG_I2C_ISA is not set 556# CONFIG_I2C_ALI1535 is not set
557# CONFIG_I2C_ALI1563 is not set
558# CONFIG_I2C_ALI15X3 is not set
559# CONFIG_I2C_AMD756 is not set
560# CONFIG_I2C_AMD8111 is not set
561# CONFIG_I2C_I801 is not set
562# CONFIG_I2C_I810 is not set
563# CONFIG_I2C_PIIX4 is not set
404CONFIG_I2C_MPC=y 564CONFIG_I2C_MPC=y
565# CONFIG_I2C_NFORCE2 is not set
405# CONFIG_I2C_PARPORT_LIGHT is not set 566# CONFIG_I2C_PARPORT_LIGHT is not set
567# CONFIG_I2C_PROSAVAGE is not set
568# CONFIG_I2C_SAVAGE4 is not set
569# CONFIG_SCx200_ACB is not set
570# CONFIG_I2C_SIS5595 is not set
571# CONFIG_I2C_SIS630 is not set
572# CONFIG_I2C_SIS96X is not set
573# CONFIG_I2C_VIA is not set
574# CONFIG_I2C_VIAPRO is not set
575# CONFIG_I2C_VOODOO3 is not set
406# CONFIG_I2C_PCA_ISA is not set 576# CONFIG_I2C_PCA_ISA is not set
407 577
408# 578#
409# Hardware Sensors Chip support 579# Miscellaneous I2C Chip support
580#
581# CONFIG_SENSORS_DS1337 is not set
582# CONFIG_SENSORS_DS1374 is not set
583# CONFIG_SENSORS_EEPROM is not set
584# CONFIG_SENSORS_PCF8574 is not set
585# CONFIG_SENSORS_PCA9539 is not set
586# CONFIG_SENSORS_PCF8591 is not set
587# CONFIG_SENSORS_RTC8564 is not set
588# CONFIG_SENSORS_M41T00 is not set
589# CONFIG_SENSORS_MAX6875 is not set
590# CONFIG_RTC_X1205_I2C is not set
591# CONFIG_I2C_DEBUG_CORE is not set
592# CONFIG_I2C_DEBUG_ALGO is not set
593# CONFIG_I2C_DEBUG_BUS is not set
594# CONFIG_I2C_DEBUG_CHIP is not set
595
596#
597# Dallas's 1-wire bus
598#
599# CONFIG_W1 is not set
600
601#
602# Hardware Monitoring support
410# 603#
411# CONFIG_I2C_SENSOR is not set 604CONFIG_HWMON=y
605# CONFIG_HWMON_VID is not set
412# CONFIG_SENSORS_ADM1021 is not set 606# CONFIG_SENSORS_ADM1021 is not set
413# CONFIG_SENSORS_ADM1025 is not set 607# CONFIG_SENSORS_ADM1025 is not set
414# CONFIG_SENSORS_ADM1026 is not set 608# CONFIG_SENSORS_ADM1026 is not set
415# CONFIG_SENSORS_ADM1031 is not set 609# CONFIG_SENSORS_ADM1031 is not set
610# CONFIG_SENSORS_ADM9240 is not set
416# CONFIG_SENSORS_ASB100 is not set 611# CONFIG_SENSORS_ASB100 is not set
612# CONFIG_SENSORS_ATXP1 is not set
417# CONFIG_SENSORS_DS1621 is not set 613# CONFIG_SENSORS_DS1621 is not set
418# CONFIG_SENSORS_FSCHER is not set 614# CONFIG_SENSORS_FSCHER is not set
615# CONFIG_SENSORS_FSCPOS is not set
419# CONFIG_SENSORS_GL518SM is not set 616# CONFIG_SENSORS_GL518SM is not set
617# CONFIG_SENSORS_GL520SM is not set
420# CONFIG_SENSORS_IT87 is not set 618# CONFIG_SENSORS_IT87 is not set
421# CONFIG_SENSORS_LM63 is not set 619# CONFIG_SENSORS_LM63 is not set
422# CONFIG_SENSORS_LM75 is not set 620# CONFIG_SENSORS_LM75 is not set
@@ -427,33 +625,26 @@ CONFIG_I2C_MPC=y
427# CONFIG_SENSORS_LM85 is not set 625# CONFIG_SENSORS_LM85 is not set
428# CONFIG_SENSORS_LM87 is not set 626# CONFIG_SENSORS_LM87 is not set
429# CONFIG_SENSORS_LM90 is not set 627# CONFIG_SENSORS_LM90 is not set
628# CONFIG_SENSORS_LM92 is not set
430# CONFIG_SENSORS_MAX1619 is not set 629# CONFIG_SENSORS_MAX1619 is not set
431# CONFIG_SENSORS_PC87360 is not set 630# CONFIG_SENSORS_PC87360 is not set
432# CONFIG_SENSORS_SMSC47B397 is not set 631# CONFIG_SENSORS_SIS5595 is not set
433# CONFIG_SENSORS_SMSC47M1 is not set 632# CONFIG_SENSORS_SMSC47M1 is not set
633# CONFIG_SENSORS_SMSC47B397 is not set
634# CONFIG_SENSORS_VIA686A is not set
434# CONFIG_SENSORS_W83781D is not set 635# CONFIG_SENSORS_W83781D is not set
636# CONFIG_SENSORS_W83792D is not set
435# CONFIG_SENSORS_W83L785TS is not set 637# CONFIG_SENSORS_W83L785TS is not set
436# CONFIG_SENSORS_W83627HF is not set 638# CONFIG_SENSORS_W83627HF is not set
639# CONFIG_SENSORS_W83627EHF is not set
640# CONFIG_HWMON_DEBUG_CHIP is not set
437 641
438# 642#
439# Other I2C Chip support 643# Misc devices
440#
441# CONFIG_SENSORS_EEPROM is not set
442# CONFIG_SENSORS_PCF8574 is not set
443# CONFIG_SENSORS_PCF8591 is not set
444# CONFIG_SENSORS_RTC8564 is not set
445# CONFIG_I2C_DEBUG_CORE is not set
446# CONFIG_I2C_DEBUG_ALGO is not set
447# CONFIG_I2C_DEBUG_BUS is not set
448# CONFIG_I2C_DEBUG_CHIP is not set
449
450#
451# Dallas's 1-wire bus
452# 644#
453# CONFIG_W1 is not set
454 645
455# 646#
456# Misc devices 647# Multimedia Capabilities Port drivers
457# 648#
458 649
459# 650#
@@ -479,11 +670,12 @@ CONFIG_I2C_MPC=y
479# 670#
480# USB support 671# USB support
481# 672#
482# CONFIG_USB_ARCH_HAS_HCD is not set 673CONFIG_USB_ARCH_HAS_HCD=y
483# CONFIG_USB_ARCH_HAS_OHCI is not set 674CONFIG_USB_ARCH_HAS_OHCI=y
675# CONFIG_USB is not set
484 676
485# 677#
486# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information 678# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
487# 679#
488 680
489# 681#
@@ -502,10 +694,15 @@ CONFIG_I2C_MPC=y
502# CONFIG_INFINIBAND is not set 694# CONFIG_INFINIBAND is not set
503 695
504# 696#
697# SN Devices
698#
699
700#
505# File systems 701# File systems
506# 702#
507CONFIG_EXT2_FS=y 703CONFIG_EXT2_FS=y
508# CONFIG_EXT2_FS_XATTR is not set 704# CONFIG_EXT2_FS_XATTR is not set
705# CONFIG_EXT2_FS_XIP is not set
509CONFIG_EXT3_FS=y 706CONFIG_EXT3_FS=y
510CONFIG_EXT3_FS_XATTR=y 707CONFIG_EXT3_FS_XATTR=y
511# CONFIG_EXT3_FS_POSIX_ACL is not set 708# CONFIG_EXT3_FS_POSIX_ACL is not set
@@ -515,17 +712,16 @@ CONFIG_JBD=y
515CONFIG_FS_MBCACHE=y 712CONFIG_FS_MBCACHE=y
516# CONFIG_REISERFS_FS is not set 713# CONFIG_REISERFS_FS is not set
517# CONFIG_JFS_FS is not set 714# CONFIG_JFS_FS is not set
518 715# CONFIG_FS_POSIX_ACL is not set
519#
520# XFS support
521#
522# CONFIG_XFS_FS is not set 716# CONFIG_XFS_FS is not set
523# CONFIG_MINIX_FS is not set 717# CONFIG_MINIX_FS is not set
524# CONFIG_ROMFS_FS is not set 718# CONFIG_ROMFS_FS is not set
719CONFIG_INOTIFY=y
525# CONFIG_QUOTA is not set 720# CONFIG_QUOTA is not set
526CONFIG_DNOTIFY=y 721CONFIG_DNOTIFY=y
527# CONFIG_AUTOFS_FS is not set 722# CONFIG_AUTOFS_FS is not set
528# CONFIG_AUTOFS4_FS is not set 723# CONFIG_AUTOFS4_FS is not set
724# CONFIG_FUSE_FS is not set
529 725
530# 726#
531# CD-ROM/DVD Filesystems 727# CD-ROM/DVD Filesystems
@@ -546,12 +742,10 @@ CONFIG_DNOTIFY=y
546CONFIG_PROC_FS=y 742CONFIG_PROC_FS=y
547CONFIG_PROC_KCORE=y 743CONFIG_PROC_KCORE=y
548CONFIG_SYSFS=y 744CONFIG_SYSFS=y
549# CONFIG_DEVFS_FS is not set
550# CONFIG_DEVPTS_FS_XATTR is not set
551CONFIG_TMPFS=y 745CONFIG_TMPFS=y
552# CONFIG_TMPFS_XATTR is not set
553# CONFIG_HUGETLB_PAGE is not set 746# CONFIG_HUGETLB_PAGE is not set
554CONFIG_RAMFS=y 747CONFIG_RAMFS=y
748# CONFIG_RELAYFS_FS is not set
555 749
556# 750#
557# Miscellaneous filesystems 751# Miscellaneous filesystems
@@ -580,6 +774,7 @@ CONFIG_NFS_FS=y
580# CONFIG_NFSD is not set 774# CONFIG_NFSD is not set
581CONFIG_ROOT_NFS=y 775CONFIG_ROOT_NFS=y
582CONFIG_LOCKD=y 776CONFIG_LOCKD=y
777CONFIG_NFS_COMMON=y
583CONFIG_SUNRPC=y 778CONFIG_SUNRPC=y
584# CONFIG_RPCSEC_GSS_KRB5 is not set 779# CONFIG_RPCSEC_GSS_KRB5 is not set
585# CONFIG_RPCSEC_GSS_SPKM3 is not set 780# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -588,6 +783,7 @@ CONFIG_SUNRPC=y
588# CONFIG_NCP_FS is not set 783# CONFIG_NCP_FS is not set
589# CONFIG_CODA_FS is not set 784# CONFIG_CODA_FS is not set
590# CONFIG_AFS_FS is not set 785# CONFIG_AFS_FS is not set
786# CONFIG_9P_FS is not set
591 787
592# 788#
593# Partition Types 789# Partition Types
@@ -614,6 +810,7 @@ CONFIG_PARTITION_ADVANCED=y
614# Library routines 810# Library routines
615# 811#
616# CONFIG_CRC_CCITT is not set 812# CONFIG_CRC_CCITT is not set
813# CONFIG_CRC16 is not set
617CONFIG_CRC32=y 814CONFIG_CRC32=y
618# CONFIG_LIBCRC32C is not set 815# CONFIG_LIBCRC32C is not set
619 816
@@ -625,7 +822,9 @@ CONFIG_CRC32=y
625# 822#
626# Kernel hacking 823# Kernel hacking
627# 824#
825# CONFIG_PRINTK_TIME is not set
628# CONFIG_DEBUG_KERNEL is not set 826# CONFIG_DEBUG_KERNEL is not set
827CONFIG_LOG_BUF_SHIFT=14
629# CONFIG_SERIAL_TEXT_DEBUG is not set 828# CONFIG_SERIAL_TEXT_DEBUG is not set
630 829
631# 830#
diff --git a/arch/ppc/kernel/idle.c b/arch/ppc/kernel/idle.c
index 11e5b44713f7..821a75e45602 100644
--- a/arch/ppc/kernel/idle.c
+++ b/arch/ppc/kernel/idle.c
@@ -53,10 +53,6 @@ void default_idle(void)
53 } 53 }
54#endif 54#endif
55 } 55 }
56 if (need_resched())
57 schedule();
58 if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING)
59 cpu_die();
60} 56}
61 57
62/* 58/*
@@ -64,11 +60,22 @@ void default_idle(void)
64 */ 60 */
65void cpu_idle(void) 61void cpu_idle(void)
66{ 62{
67 for (;;) 63 int cpu = smp_processor_id();
68 if (ppc_md.idle != NULL) 64
69 ppc_md.idle(); 65 for (;;) {
70 else 66 while (!need_resched()) {
71 default_idle(); 67 if (ppc_md.idle != NULL)
68 ppc_md.idle();
69 else
70 default_idle();
71 }
72
73 if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING)
74 cpu_die();
75 preempt_enable_no_resched();
76 schedule();
77 preempt_disable();
78 }
72} 79}
73 80
74#if defined(CONFIG_SYSCTL) && defined(CONFIG_6xx) 81#if defined(CONFIG_SYSCTL) && defined(CONFIG_6xx)
diff --git a/arch/ppc/kernel/smp.c b/arch/ppc/kernel/smp.c
index bc5bf1124836..43b8fc2ca591 100644
--- a/arch/ppc/kernel/smp.c
+++ b/arch/ppc/kernel/smp.c
@@ -341,6 +341,7 @@ int __devinit start_secondary(void *unused)
341 cpu = smp_processor_id(); 341 cpu = smp_processor_id();
342 smp_store_cpu_info(cpu); 342 smp_store_cpu_info(cpu);
343 set_dec(tb_ticks_per_jiffy); 343 set_dec(tb_ticks_per_jiffy);
344 preempt_disable();
344 cpu_callin_map[cpu] = 1; 345 cpu_callin_map[cpu] = 1;
345 346
346 printk("CPU %d done callin...\n", cpu); 347 printk("CPU %d done callin...\n", cpu);
diff --git a/arch/ppc/platforms/83xx/mpc834x_sys.c b/arch/ppc/platforms/83xx/mpc834x_sys.c
index 79b3f533d0a3..98edc75f4105 100644
--- a/arch/ppc/platforms/83xx/mpc834x_sys.c
+++ b/arch/ppc/platforms/83xx/mpc834x_sys.c
@@ -51,6 +51,9 @@
51 51
52#include <syslib/ppc83xx_setup.h> 52#include <syslib/ppc83xx_setup.h>
53 53
54static const char *GFAR_PHY_0 = "phy0:0";
55static const char *GFAR_PHY_1 = "phy0:1";
56
54#ifndef CONFIG_PCI 57#ifndef CONFIG_PCI
55unsigned long isa_io_base = 0; 58unsigned long isa_io_base = 0;
56unsigned long isa_mem_base = 0; 59unsigned long isa_mem_base = 0;
@@ -97,6 +100,7 @@ mpc834x_sys_setup_arch(void)
97 bd_t *binfo = (bd_t *) __res; 100 bd_t *binfo = (bd_t *) __res;
98 unsigned int freq; 101 unsigned int freq;
99 struct gianfar_platform_data *pdata; 102 struct gianfar_platform_data *pdata;
103 struct gianfar_mdio_data *mdata;
100 104
101 /* get the core frequency */ 105 /* get the core frequency */
102 freq = binfo->bi_intfreq; 106 freq = binfo->bi_intfreq;
@@ -111,24 +115,27 @@ mpc834x_sys_setup_arch(void)
111#endif 115#endif
112 mpc83xx_early_serial_map(); 116 mpc83xx_early_serial_map();
113 117
118 /* setup the board related info for the MDIO bus */
119 mdata = (struct gianfar_mdio_data *) ppc_sys_get_pdata(MPC83xx_MDIO);
120
121 mdata->irq[0] = MPC83xx_IRQ_EXT1;
122 mdata->irq[1] = MPC83xx_IRQ_EXT2;
123 mdata->irq[2] = -1;
124 mdata->irq[31] = -1;
125 mdata->paddr += binfo->bi_immr_base;
126
114 /* setup the board related information for the enet controllers */ 127 /* setup the board related information for the enet controllers */
115 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC83xx_TSEC1); 128 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC83xx_TSEC1);
116 if (pdata) { 129 if (pdata) {
117 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; 130 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
118 pdata->interruptPHY = MPC83xx_IRQ_EXT1; 131 pdata->bus_id = GFAR_PHY_0;
119 pdata->phyid = 0;
120 /* fixup phy address */
121 pdata->phy_reg_addr += binfo->bi_immr_base;
122 memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6); 132 memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6);
123 } 133 }
124 134
125 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC83xx_TSEC2); 135 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC83xx_TSEC2);
126 if (pdata) { 136 if (pdata) {
127 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; 137 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
128 pdata->interruptPHY = MPC83xx_IRQ_EXT2; 138 pdata->bus_id = GFAR_PHY_1;
129 pdata->phyid = 1;
130 /* fixup phy address */
131 pdata->phy_reg_addr += binfo->bi_immr_base;
132 memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6); 139 memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
133 } 140 }
134 141
diff --git a/arch/ppc/platforms/85xx/stx_gp3.h b/arch/ppc/platforms/85xx/stx_gp3.h
index 95fdf4b0680b..7bcc6c35a417 100644
--- a/arch/ppc/platforms/85xx/stx_gp3.h
+++ b/arch/ppc/platforms/85xx/stx_gp3.h
@@ -21,6 +21,7 @@
21 21
22#include <linux/config.h> 22#include <linux/config.h>
23#include <linux/init.h> 23#include <linux/init.h>
24#include <linux/seq_file.h>
24#include <asm/ppcboot.h> 25#include <asm/ppcboot.h>
25 26
26#define BOARD_CCSRBAR ((uint)0xe0000000) 27#define BOARD_CCSRBAR ((uint)0xe0000000)
diff --git a/arch/ppc/syslib/Makefile b/arch/ppc/syslib/Makefile
index 5bd33baac243..5b7f2b80e56e 100644
--- a/arch/ppc/syslib/Makefile
+++ b/arch/ppc/syslib/Makefile
@@ -33,7 +33,6 @@ obj-$(CONFIG_PPC4xx_DMA) += ppc4xx_dma.o
33obj-$(CONFIG_PPC4xx_EDMA) += ppc4xx_sgdma.o 33obj-$(CONFIG_PPC4xx_EDMA) += ppc4xx_sgdma.o
34ifeq ($(CONFIG_40x),y) 34ifeq ($(CONFIG_40x),y)
35obj-$(CONFIG_PCI) += pci_auto.o ppc405_pci.o 35obj-$(CONFIG_PCI) += pci_auto.o ppc405_pci.o
36obj-$(CONFIG_RAPIDIO) += ppc85xx_rio.o
37endif 36endif
38endif 37endif
39obj-$(CONFIG_8xx) += m8xx_setup.o ppc8xx_pic.o $(wdt-mpc8xx-y) \ 38obj-$(CONFIG_8xx) += m8xx_setup.o ppc8xx_pic.o $(wdt-mpc8xx-y) \
@@ -96,6 +95,7 @@ obj-$(CONFIG_85xx) += open_pic.o ppc85xx_common.o ppc85xx_setup.o \
96ifeq ($(CONFIG_85xx),y) 95ifeq ($(CONFIG_85xx),y)
97obj-$(CONFIG_PCI) += pci_auto.o 96obj-$(CONFIG_PCI) += pci_auto.o
98endif 97endif
98obj-$(CONFIG_RAPIDIO) += ppc85xx_rio.o
99obj-$(CONFIG_83xx) += ipic.o ppc83xx_setup.o ppc_sys.o \ 99obj-$(CONFIG_83xx) += ipic.o ppc83xx_setup.o ppc_sys.o \
100 mpc83xx_sys.o mpc83xx_devices.o 100 mpc83xx_sys.o mpc83xx_devices.o
101ifeq ($(CONFIG_83xx),y) 101ifeq ($(CONFIG_83xx),y)
diff --git a/arch/ppc/syslib/mpc83xx_devices.c b/arch/ppc/syslib/mpc83xx_devices.c
index dbf8acac507f..f43fbf9a9389 100644
--- a/arch/ppc/syslib/mpc83xx_devices.c
+++ b/arch/ppc/syslib/mpc83xx_devices.c
@@ -27,18 +27,20 @@
27 * what IMMRBAR is, will get fixed up by mach_mpc83xx_fixup 27 * what IMMRBAR is, will get fixed up by mach_mpc83xx_fixup
28 */ 28 */
29 29
30struct gianfar_mdio_data mpc83xx_mdio_pdata = {
31 .paddr = 0x24520,
32};
33
30static struct gianfar_platform_data mpc83xx_tsec1_pdata = { 34static struct gianfar_platform_data mpc83xx_tsec1_pdata = {
31 .device_flags = FSL_GIANFAR_DEV_HAS_GIGABIT | 35 .device_flags = FSL_GIANFAR_DEV_HAS_GIGABIT |
32 FSL_GIANFAR_DEV_HAS_COALESCE | FSL_GIANFAR_DEV_HAS_RMON | 36 FSL_GIANFAR_DEV_HAS_COALESCE | FSL_GIANFAR_DEV_HAS_RMON |
33 FSL_GIANFAR_DEV_HAS_MULTI_INTR, 37 FSL_GIANFAR_DEV_HAS_MULTI_INTR,
34 .phy_reg_addr = 0x24000,
35}; 38};
36 39
37static struct gianfar_platform_data mpc83xx_tsec2_pdata = { 40static struct gianfar_platform_data mpc83xx_tsec2_pdata = {
38 .device_flags = FSL_GIANFAR_DEV_HAS_GIGABIT | 41 .device_flags = FSL_GIANFAR_DEV_HAS_GIGABIT |
39 FSL_GIANFAR_DEV_HAS_COALESCE | FSL_GIANFAR_DEV_HAS_RMON | 42 FSL_GIANFAR_DEV_HAS_COALESCE | FSL_GIANFAR_DEV_HAS_RMON |
40 FSL_GIANFAR_DEV_HAS_MULTI_INTR, 43 FSL_GIANFAR_DEV_HAS_MULTI_INTR,
41 .phy_reg_addr = 0x24000,
42}; 44};
43 45
44static struct fsl_i2c_platform_data mpc83xx_fsl_i2c1_pdata = { 46static struct fsl_i2c_platform_data mpc83xx_fsl_i2c1_pdata = {
@@ -220,6 +222,12 @@ struct platform_device ppc_sys_platform_devices[] = {
220 }, 222 },
221 }, 223 },
222 }, 224 },
225 [MPC83xx_MDIO] = {
226 .name = "fsl-gianfar_mdio",
227 .id = 0,
228 .dev.platform_data = &mpc83xx_mdio_pdata,
229 .num_resources = 0,
230 },
223}; 231};
224 232
225static int __init mach_mpc83xx_fixup(struct platform_device *pdev) 233static int __init mach_mpc83xx_fixup(struct platform_device *pdev)
diff --git a/arch/ppc/syslib/mpc83xx_sys.c b/arch/ppc/syslib/mpc83xx_sys.c
index 29aa63350025..da743446789b 100644
--- a/arch/ppc/syslib/mpc83xx_sys.c
+++ b/arch/ppc/syslib/mpc83xx_sys.c
@@ -24,72 +24,72 @@ struct ppc_sys_spec ppc_sys_specs[] = {
24 .ppc_sys_name = "8349E", 24 .ppc_sys_name = "8349E",
25 .mask = 0xFFFF0000, 25 .mask = 0xFFFF0000,
26 .value = 0x80500000, 26 .value = 0x80500000,
27 .num_devices = 8, 27 .num_devices = 9,
28 .device_list = (enum ppc_sys_devices[]) 28 .device_list = (enum ppc_sys_devices[])
29 { 29 {
30 MPC83xx_TSEC1, MPC83xx_TSEC2, MPC83xx_IIC1, 30 MPC83xx_TSEC1, MPC83xx_TSEC2, MPC83xx_IIC1,
31 MPC83xx_IIC2, MPC83xx_DUART, MPC83xx_SEC2, 31 MPC83xx_IIC2, MPC83xx_DUART, MPC83xx_SEC2,
32 MPC83xx_USB2_DR, MPC83xx_USB2_MPH 32 MPC83xx_USB2_DR, MPC83xx_USB2_MPH, MPC83xx_MDIO
33 }, 33 },
34 }, 34 },
35 { 35 {
36 .ppc_sys_name = "8349", 36 .ppc_sys_name = "8349",
37 .mask = 0xFFFF0000, 37 .mask = 0xFFFF0000,
38 .value = 0x80510000, 38 .value = 0x80510000,
39 .num_devices = 7, 39 .num_devices = 8,
40 .device_list = (enum ppc_sys_devices[]) 40 .device_list = (enum ppc_sys_devices[])
41 { 41 {
42 MPC83xx_TSEC1, MPC83xx_TSEC2, MPC83xx_IIC1, 42 MPC83xx_TSEC1, MPC83xx_TSEC2, MPC83xx_IIC1,
43 MPC83xx_IIC2, MPC83xx_DUART, 43 MPC83xx_IIC2, MPC83xx_DUART,
44 MPC83xx_USB2_DR, MPC83xx_USB2_MPH 44 MPC83xx_USB2_DR, MPC83xx_USB2_MPH, MPC83xx_MDIO
45 }, 45 },
46 }, 46 },
47 { 47 {
48 .ppc_sys_name = "8347E", 48 .ppc_sys_name = "8347E",
49 .mask = 0xFFFF0000, 49 .mask = 0xFFFF0000,
50 .value = 0x80520000, 50 .value = 0x80520000,
51 .num_devices = 8, 51 .num_devices = 9,
52 .device_list = (enum ppc_sys_devices[]) 52 .device_list = (enum ppc_sys_devices[])
53 { 53 {
54 MPC83xx_TSEC1, MPC83xx_TSEC2, MPC83xx_IIC1, 54 MPC83xx_TSEC1, MPC83xx_TSEC2, MPC83xx_IIC1,
55 MPC83xx_IIC2, MPC83xx_DUART, MPC83xx_SEC2, 55 MPC83xx_IIC2, MPC83xx_DUART, MPC83xx_SEC2,
56 MPC83xx_USB2_DR, MPC83xx_USB2_MPH 56 MPC83xx_USB2_DR, MPC83xx_USB2_MPH, MPC83xx_MDIO
57 }, 57 },
58 }, 58 },
59 { 59 {
60 .ppc_sys_name = "8347", 60 .ppc_sys_name = "8347",
61 .mask = 0xFFFF0000, 61 .mask = 0xFFFF0000,
62 .value = 0x80530000, 62 .value = 0x80530000,
63 .num_devices = 7, 63 .num_devices = 8,
64 .device_list = (enum ppc_sys_devices[]) 64 .device_list = (enum ppc_sys_devices[])
65 { 65 {
66 MPC83xx_TSEC1, MPC83xx_TSEC2, MPC83xx_IIC1, 66 MPC83xx_TSEC1, MPC83xx_TSEC2, MPC83xx_IIC1,
67 MPC83xx_IIC2, MPC83xx_DUART, 67 MPC83xx_IIC2, MPC83xx_DUART,
68 MPC83xx_USB2_DR, MPC83xx_USB2_MPH 68 MPC83xx_USB2_DR, MPC83xx_USB2_MPH, MPC83xx_MDIO
69 }, 69 },
70 }, 70 },
71 { 71 {
72 .ppc_sys_name = "8343E", 72 .ppc_sys_name = "8343E",
73 .mask = 0xFFFF0000, 73 .mask = 0xFFFF0000,
74 .value = 0x80540000, 74 .value = 0x80540000,
75 .num_devices = 7, 75 .num_devices = 8,
76 .device_list = (enum ppc_sys_devices[]) 76 .device_list = (enum ppc_sys_devices[])
77 { 77 {
78 MPC83xx_TSEC1, MPC83xx_TSEC2, MPC83xx_IIC1, 78 MPC83xx_TSEC1, MPC83xx_TSEC2, MPC83xx_IIC1,
79 MPC83xx_IIC2, MPC83xx_DUART, MPC83xx_SEC2, 79 MPC83xx_IIC2, MPC83xx_DUART, MPC83xx_SEC2,
80 MPC83xx_USB2_DR, 80 MPC83xx_USB2_DR, MPC83xx_MDIO
81 }, 81 },
82 }, 82 },
83 { 83 {
84 .ppc_sys_name = "8343", 84 .ppc_sys_name = "8343",
85 .mask = 0xFFFF0000, 85 .mask = 0xFFFF0000,
86 .value = 0x80550000, 86 .value = 0x80550000,
87 .num_devices = 6, 87 .num_devices = 7,
88 .device_list = (enum ppc_sys_devices[]) 88 .device_list = (enum ppc_sys_devices[])
89 { 89 {
90 MPC83xx_TSEC1, MPC83xx_TSEC2, MPC83xx_IIC1, 90 MPC83xx_TSEC1, MPC83xx_TSEC2, MPC83xx_IIC1,
91 MPC83xx_IIC2, MPC83xx_DUART, 91 MPC83xx_IIC2, MPC83xx_DUART,
92 MPC83xx_USB2_DR, 92 MPC83xx_USB2_DR, MPC83xx_MDIO
93 }, 93 },
94 }, 94 },
95 { /* default match */ 95 { /* default match */
diff --git a/arch/ppc/syslib/prom.c b/arch/ppc/syslib/prom.c
index 03b1fc9b9501..af4deace49e0 100644
--- a/arch/ppc/syslib/prom.c
+++ b/arch/ppc/syslib/prom.c
@@ -13,7 +13,6 @@
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/string.h> 14#include <linux/string.h>
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/version.h>
17#include <linux/threads.h> 16#include <linux/threads.h>
18#include <linux/spinlock.h> 17#include <linux/spinlock.h>
19#include <linux/ioport.h> 18#include <linux/ioport.h>
diff --git a/arch/ppc/syslib/prom_init.c b/arch/ppc/syslib/prom_init.c
index 7f15136830f4..df14422ae1c6 100644
--- a/arch/ppc/syslib/prom_init.c
+++ b/arch/ppc/syslib/prom_init.c
@@ -9,7 +9,6 @@
9#include <linux/kernel.h> 9#include <linux/kernel.h>
10#include <linux/string.h> 10#include <linux/string.h>
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/version.h>
13#include <linux/threads.h> 12#include <linux/threads.h>
14#include <linux/spinlock.h> 13#include <linux/spinlock.h>
15#include <linux/ioport.h> 14#include <linux/ioport.h>
diff --git a/arch/ppc64/kernel/idle.c b/arch/ppc64/kernel/idle.c
index 8fec27469802..715bc0e71e0f 100644
--- a/arch/ppc64/kernel/idle.c
+++ b/arch/ppc64/kernel/idle.c
@@ -34,15 +34,11 @@ extern void power4_idle(void);
34 34
35void default_idle(void) 35void default_idle(void)
36{ 36{
37 long oldval;
38 unsigned int cpu = smp_processor_id(); 37 unsigned int cpu = smp_processor_id();
38 set_thread_flag(TIF_POLLING_NRFLAG);
39 39
40 while (1) { 40 while (1) {
41 oldval = test_and_clear_thread_flag(TIF_NEED_RESCHED); 41 if (!need_resched()) {
42
43 if (!oldval) {
44 set_thread_flag(TIF_POLLING_NRFLAG);
45
46 while (!need_resched() && !cpu_is_offline(cpu)) { 42 while (!need_resched() && !cpu_is_offline(cpu)) {
47 ppc64_runlatch_off(); 43 ppc64_runlatch_off();
48 44
@@ -55,13 +51,12 @@ void default_idle(void)
55 } 51 }
56 52
57 HMT_medium(); 53 HMT_medium();
58 clear_thread_flag(TIF_POLLING_NRFLAG);
59 } else {
60 set_need_resched();
61 } 54 }
62 55
63 ppc64_runlatch_on(); 56 ppc64_runlatch_on();
57 preempt_enable_no_resched();
64 schedule(); 58 schedule();
59 preempt_disable();
65 if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING) 60 if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING)
66 cpu_die(); 61 cpu_die();
67 } 62 }
@@ -77,7 +72,9 @@ void native_idle(void)
77 72
78 if (need_resched()) { 73 if (need_resched()) {
79 ppc64_runlatch_on(); 74 ppc64_runlatch_on();
75 preempt_enable_no_resched();
80 schedule(); 76 schedule();
77 preempt_disable();
81 } 78 }
82 79
83 if (cpu_is_offline(smp_processor_id()) && 80 if (cpu_is_offline(smp_processor_id()) &&
diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c
index c9f2f60cfa58..dee6ab54984d 100644
--- a/arch/s390/appldata/appldata_base.c
+++ b/arch/s390/appldata/appldata_base.c
@@ -592,12 +592,15 @@ int appldata_register_ops(struct appldata_ops *ops)
592 */ 592 */
593void appldata_unregister_ops(struct appldata_ops *ops) 593void appldata_unregister_ops(struct appldata_ops *ops)
594{ 594{
595 void *table;
595 spin_lock(&appldata_ops_lock); 596 spin_lock(&appldata_ops_lock);
596 unregister_sysctl_table(ops->sysctl_header);
597 list_del(&ops->list); 597 list_del(&ops->list);
598 kfree(ops->ctl_table); 598 /* at that point any incoming access will fail */
599 table = ops->ctl_table;
599 ops->ctl_table = NULL; 600 ops->ctl_table = NULL;
600 spin_unlock(&appldata_ops_lock); 601 spin_unlock(&appldata_ops_lock);
602 unregister_sysctl_table(ops->sysctl_header);
603 kfree(table);
601 P_INFO("%s-ops unregistered!\n", ops->name); 604 P_INFO("%s-ops unregistered!\n", ops->name);
602} 605}
603/********************** module-ops management <END> **************************/ 606/********************** module-ops management <END> **************************/
diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c
index bc59282da762..896d39d0e4ce 100644
--- a/arch/s390/kernel/debug.c
+++ b/arch/s390/kernel/debug.c
@@ -486,7 +486,7 @@ out:
486 * - goto next entry in p_info 486 * - goto next entry in p_info
487 */ 487 */
488 488
489extern inline int 489static inline int
490debug_next_entry(file_private_info_t *p_info) 490debug_next_entry(file_private_info_t *p_info)
491{ 491{
492 debug_info_t *id; 492 debug_info_t *id;
@@ -800,7 +800,7 @@ debug_set_level(debug_info_t* id, int new_level)
800 * - set active entry to next in the ring buffer 800 * - set active entry to next in the ring buffer
801 */ 801 */
802 802
803extern inline void 803static inline void
804proceed_active_entry(debug_info_t * id) 804proceed_active_entry(debug_info_t * id)
805{ 805{
806 if ((id->active_entries[id->active_area] += id->entry_size) 806 if ((id->active_entries[id->active_area] += id->entry_size)
@@ -817,7 +817,7 @@ proceed_active_entry(debug_info_t * id)
817 * - set active area to next in the ring buffer 817 * - set active area to next in the ring buffer
818 */ 818 */
819 819
820extern inline void 820static inline void
821proceed_active_area(debug_info_t * id) 821proceed_active_area(debug_info_t * id)
822{ 822{
823 id->active_area++; 823 id->active_area++;
@@ -828,7 +828,7 @@ proceed_active_area(debug_info_t * id)
828 * get_active_entry: 828 * get_active_entry:
829 */ 829 */
830 830
831extern inline debug_entry_t* 831static inline debug_entry_t*
832get_active_entry(debug_info_t * id) 832get_active_entry(debug_info_t * id)
833{ 833{
834 return (debug_entry_t *) (((char *) id->areas[id->active_area] 834 return (debug_entry_t *) (((char *) id->areas[id->active_area]
@@ -841,7 +841,7 @@ get_active_entry(debug_info_t * id)
841 * - set timestamp, caller address, cpu number etc. 841 * - set timestamp, caller address, cpu number etc.
842 */ 842 */
843 843
844extern inline void 844static inline void
845debug_finish_entry(debug_info_t * id, debug_entry_t* active, int level, 845debug_finish_entry(debug_info_t * id, debug_entry_t* active, int level,
846 int exception) 846 int exception)
847{ 847{
@@ -971,7 +971,7 @@ debug_entry_t
971 * counts arguments in format string for sprintf view 971 * counts arguments in format string for sprintf view
972 */ 972 */
973 973
974extern inline int 974static inline int
975debug_count_numargs(char *string) 975debug_count_numargs(char *string)
976{ 976{
977 int numargs=0; 977 int numargs=0;
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c
index 9f3dff6c0b72..78b64fe5e7c2 100644
--- a/arch/s390/kernel/process.c
+++ b/arch/s390/kernel/process.c
@@ -99,15 +99,15 @@ void default_idle(void)
99{ 99{
100 int cpu, rc; 100 int cpu, rc;
101 101
102 /* CPU is going idle. */
103 cpu = smp_processor_id();
104
102 local_irq_disable(); 105 local_irq_disable();
103 if (need_resched()) { 106 if (need_resched()) {
104 local_irq_enable(); 107 local_irq_enable();
105 schedule(); 108 return;
106 return; 109 }
107 }
108 110
109 /* CPU is going idle. */
110 cpu = smp_processor_id();
111 rc = notifier_call_chain(&idle_chain, CPU_IDLE, (void *)(long) cpu); 111 rc = notifier_call_chain(&idle_chain, CPU_IDLE, (void *)(long) cpu);
112 if (rc != NOTIFY_OK && rc != NOTIFY_DONE) 112 if (rc != NOTIFY_OK && rc != NOTIFY_DONE)
113 BUG(); 113 BUG();
@@ -120,7 +120,7 @@ void default_idle(void)
120 __ctl_set_bit(8, 15); 120 __ctl_set_bit(8, 15);
121 121
122#ifdef CONFIG_HOTPLUG_CPU 122#ifdef CONFIG_HOTPLUG_CPU
123 if (cpu_is_offline(smp_processor_id())) 123 if (cpu_is_offline(cpu))
124 cpu_die(); 124 cpu_die();
125#endif 125#endif
126 126
@@ -139,8 +139,14 @@ void default_idle(void)
139 139
140void cpu_idle(void) 140void cpu_idle(void)
141{ 141{
142 for (;;) 142 for (;;) {
143 default_idle(); 143 while (!need_resched())
144 default_idle();
145
146 preempt_enable_no_resched();
147 schedule();
148 preempt_disable();
149 }
144} 150}
145 151
146void show_regs(struct pt_regs *regs) 152void show_regs(struct pt_regs *regs)
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index e13c87b446b2..5856b3fda6bf 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -533,6 +533,7 @@ int __devinit start_secondary(void *cpuvoid)
533{ 533{
534 /* Setup the cpu */ 534 /* Setup the cpu */
535 cpu_init(); 535 cpu_init();
536 preempt_disable();
536 /* init per CPU timer */ 537 /* init per CPU timer */
537 init_cpu_timer(); 538 init_cpu_timer();
538#ifdef CONFIG_VIRT_TIMER 539#ifdef CONFIG_VIRT_TIMER
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index 64e32da77754..fb2607c369ed 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -160,7 +160,7 @@ static void do_sigsegv(struct pt_regs *regs, unsigned long error_code,
160 * 11 Page translation -> Not present (nullification) 160 * 11 Page translation -> Not present (nullification)
161 * 3b Region third trans. -> Not present (nullification) 161 * 3b Region third trans. -> Not present (nullification)
162 */ 162 */
163extern inline void 163static inline void
164do_exception(struct pt_regs *regs, unsigned long error_code, int is_protection) 164do_exception(struct pt_regs *regs, unsigned long error_code, int is_protection)
165{ 165{
166 struct task_struct *tsk; 166 struct task_struct *tsk;
diff --git a/arch/sh/kernel/process.c b/arch/sh/kernel/process.c
index 6dce9d0b81f8..fd4f240b833d 100644
--- a/arch/sh/kernel/process.c
+++ b/arch/sh/kernel/process.c
@@ -51,28 +51,24 @@ void enable_hlt(void)
51 51
52EXPORT_SYMBOL(enable_hlt); 52EXPORT_SYMBOL(enable_hlt);
53 53
54void default_idle(void) 54void cpu_idle(void)
55{ 55{
56 /* endless idle loop with no priority at all */ 56 /* endless idle loop with no priority at all */
57 while (1) { 57 while (1) {
58 if (hlt_counter) { 58 if (hlt_counter) {
59 while (1) 59 while (!need_resched())
60 if (need_resched()) 60 cpu_relax();
61 break;
62 } else { 61 } else {
63 while (!need_resched()) 62 while (!need_resched())
64 cpu_sleep(); 63 cpu_sleep();
65 } 64 }
66 65
66 preempt_enable_no_resched();
67 schedule(); 67 schedule();
68 preempt_disable();
68 } 69 }
69} 70}
70 71
71void cpu_idle(void)
72{
73 default_idle();
74}
75
76void machine_restart(char * __unused) 72void machine_restart(char * __unused)
77{ 73{
78 /* SR.BL=1 and invoke address error to let CPU reset (manual reset) */ 74 /* SR.BL=1 and invoke address error to let CPU reset (manual reset) */
diff --git a/arch/sh/kernel/smp.c b/arch/sh/kernel/smp.c
index 5ecefc02896a..59e49b18252c 100644
--- a/arch/sh/kernel/smp.c
+++ b/arch/sh/kernel/smp.c
@@ -112,7 +112,9 @@ int __cpu_up(unsigned int cpu)
112 112
113int start_secondary(void *unused) 113int start_secondary(void *unused)
114{ 114{
115 unsigned int cpu = smp_processor_id(); 115 unsigned int cpu;
116
117 cpu = smp_processor_id();
116 118
117 atomic_inc(&init_mm.mm_count); 119 atomic_inc(&init_mm.mm_count);
118 current->active_mm = &init_mm; 120 current->active_mm = &init_mm;
@@ -120,6 +122,7 @@ int start_secondary(void *unused)
120 smp_store_cpu_info(cpu); 122 smp_store_cpu_info(cpu);
121 123
122 __smp_slave_init(cpu); 124 __smp_slave_init(cpu);
125 preempt_disable();
123 per_cpu_trap_init(); 126 per_cpu_trap_init();
124 127
125 atomic_inc(&cpus_booted); 128 atomic_inc(&cpus_booted);
diff --git a/arch/sh64/kernel/process.c b/arch/sh64/kernel/process.c
index efde41c0cd66..b95d04141855 100644
--- a/arch/sh64/kernel/process.c
+++ b/arch/sh64/kernel/process.c
@@ -307,23 +307,19 @@ __setup("hlt", hlt_setup);
307 307
308static inline void hlt(void) 308static inline void hlt(void)
309{ 309{
310 if (hlt_counter)
311 return;
312
313 __asm__ __volatile__ ("sleep" : : : "memory"); 310 __asm__ __volatile__ ("sleep" : : : "memory");
314} 311}
315 312
316/* 313/*
317 * The idle loop on a uniprocessor SH.. 314 * The idle loop on a uniprocessor SH..
318 */ 315 */
319void default_idle(void) 316void cpu_idle(void)
320{ 317{
321 /* endless idle loop with no priority at all */ 318 /* endless idle loop with no priority at all */
322 while (1) { 319 while (1) {
323 if (hlt_counter) { 320 if (hlt_counter) {
324 while (1) 321 while (!need_resched())
325 if (need_resched()) 322 cpu_relax();
326 break;
327 } else { 323 } else {
328 local_irq_disable(); 324 local_irq_disable();
329 while (!need_resched()) { 325 while (!need_resched()) {
@@ -334,13 +330,11 @@ void default_idle(void)
334 } 330 }
335 local_irq_enable(); 331 local_irq_enable();
336 } 332 }
333 preempt_enable_no_resched();
337 schedule(); 334 schedule();
335 preempt_disable();
338 } 336 }
339}
340 337
341void cpu_idle(void)
342{
343 default_idle();
344} 338}
345 339
346void machine_restart(char * __unused) 340void machine_restart(char * __unused)
diff --git a/arch/sparc/kernel/cpu.c b/arch/sparc/kernel/cpu.c
index 6a4ebc62193e..d7bfc61d2879 100644
--- a/arch/sparc/kernel/cpu.c
+++ b/arch/sparc/kernel/cpu.c
@@ -75,7 +75,7 @@ struct cpu_fp_info linux_sparc_fpu[] = {
75 { 9, 3, "Fujitsu or Weitek on-chip FPU"}, 75 { 9, 3, "Fujitsu or Weitek on-chip FPU"},
76}; 76};
77 77
78#define NSPARCFPU (sizeof(linux_sparc_fpu)/sizeof(struct cpu_fp_info)) 78#define NSPARCFPU ARRAY_SIZE(linux_sparc_fpu)
79 79
80struct cpu_iu_info linux_sparc_chips[] = { 80struct cpu_iu_info linux_sparc_chips[] = {
81 /* Sun4/100, 4/200, SLC */ 81 /* Sun4/100, 4/200, SLC */
@@ -120,7 +120,7 @@ struct cpu_iu_info linux_sparc_chips[] = {
120 { 0xf, 0, "UNKNOWN CPU-VENDOR/TYPE"}, 120 { 0xf, 0, "UNKNOWN CPU-VENDOR/TYPE"},
121}; 121};
122 122
123#define NSPARCCHIPS (sizeof(linux_sparc_chips)/sizeof(struct cpu_iu_info)) 123#define NSPARCCHIPS ARRAY_SIZE(linux_sparc_chips)
124 124
125char *sparc_cpu_type; 125char *sparc_cpu_type;
126char *sparc_fpu_type; 126char *sparc_fpu_type;
diff --git a/arch/sparc/kernel/pcic.c b/arch/sparc/kernel/pcic.c
index 25e31d5ec99b..cccfc12802ed 100644
--- a/arch/sparc/kernel/pcic.c
+++ b/arch/sparc/kernel/pcic.c
@@ -143,7 +143,7 @@ static struct pcic_ca2irq pcic_i_jk[] = {
143 * as several PROMs may be installed on the same physical board. 143 * as several PROMs may be installed on the same physical board.
144 */ 144 */
145#define SN2L_INIT(name, map) \ 145#define SN2L_INIT(name, map) \
146 { name, map, sizeof(map)/sizeof(struct pcic_ca2irq) } 146 { name, map, ARRAY_SIZE(map) }
147 147
148static struct pcic_sn2list pcic_known_sysnames[] = { 148static struct pcic_sn2list pcic_known_sysnames[] = {
149 SN2L_INIT("SUNW,JavaEngine1", pcic_i_je1a), /* JE1, PROM 2.32 */ 149 SN2L_INIT("SUNW,JavaEngine1", pcic_i_je1a), /* JE1, PROM 2.32 */
diff --git a/arch/sparc/kernel/process.c b/arch/sparc/kernel/process.c
index 29e72b57d4fd..ea8647411462 100644
--- a/arch/sparc/kernel/process.c
+++ b/arch/sparc/kernel/process.c
@@ -67,13 +67,6 @@ extern void fpsave(unsigned long *, unsigned long *, void *, unsigned long *);
67struct task_struct *last_task_used_math = NULL; 67struct task_struct *last_task_used_math = NULL;
68struct thread_info *current_set[NR_CPUS]; 68struct thread_info *current_set[NR_CPUS];
69 69
70/*
71 * default_idle is new in 2.5. XXX Review, currently stolen from sparc64.
72 */
73void default_idle(void)
74{
75}
76
77#ifndef CONFIG_SMP 70#ifndef CONFIG_SMP
78 71
79#define SUN4C_FAULT_HIGH 100 72#define SUN4C_FAULT_HIGH 100
@@ -92,12 +85,11 @@ void cpu_idle(void)
92 static unsigned long fps; 85 static unsigned long fps;
93 unsigned long now; 86 unsigned long now;
94 unsigned long faults; 87 unsigned long faults;
95 unsigned long flags;
96 88
97 extern unsigned long sun4c_kernel_faults; 89 extern unsigned long sun4c_kernel_faults;
98 extern void sun4c_grow_kernel_ring(void); 90 extern void sun4c_grow_kernel_ring(void);
99 91
100 local_irq_save(flags); 92 local_irq_disable();
101 now = jiffies; 93 now = jiffies;
102 count -= (now - last_jiffies); 94 count -= (now - last_jiffies);
103 last_jiffies = now; 95 last_jiffies = now;
@@ -113,14 +105,19 @@ void cpu_idle(void)
113 sun4c_grow_kernel_ring(); 105 sun4c_grow_kernel_ring();
114 } 106 }
115 } 107 }
116 local_irq_restore(flags); 108 local_irq_enable();
117 } 109 }
118 110
119 while((!need_resched()) && pm_idle) { 111 if (pm_idle) {
120 (*pm_idle)(); 112 while (!need_resched())
113 (*pm_idle)();
114 } else {
115 while (!need_resched())
116 cpu_relax();
121 } 117 }
122 118 preempt_enable_no_resched();
123 schedule(); 119 schedule();
120 preempt_disable();
124 check_pgt_cache(); 121 check_pgt_cache();
125 } 122 }
126} 123}
@@ -130,13 +127,15 @@ void cpu_idle(void)
130/* This is being executed in task 0 'user space'. */ 127/* This is being executed in task 0 'user space'. */
131void cpu_idle(void) 128void cpu_idle(void)
132{ 129{
130 set_thread_flag(TIF_POLLING_NRFLAG);
133 /* endless idle loop with no priority at all */ 131 /* endless idle loop with no priority at all */
134 while(1) { 132 while(1) {
135 if(need_resched()) { 133 while (!need_resched())
136 schedule(); 134 cpu_relax();
137 check_pgt_cache(); 135 preempt_enable_no_resched();
138 } 136 schedule();
139 barrier(); /* or else gcc optimizes... */ 137 preempt_disable();
138 check_pgt_cache();
140 } 139 }
141} 140}
142 141
diff --git a/arch/sparc/mm/fault.c b/arch/sparc/mm/fault.c
index 2bbd53f3cafb..9eeed3347df3 100644
--- a/arch/sparc/mm/fault.c
+++ b/arch/sparc/mm/fault.c
@@ -33,8 +33,6 @@
33#include <asm/kdebug.h> 33#include <asm/kdebug.h>
34#include <asm/uaccess.h> 34#include <asm/uaccess.h>
35 35
36#define ELEMENTS(arr) (sizeof (arr)/sizeof (arr[0]))
37
38extern int prom_node_root; 36extern int prom_node_root;
39 37
40/* At boot time we determine these two values necessary for setting 38/* At boot time we determine these two values necessary for setting
diff --git a/arch/sparc64/kernel/cpu.c b/arch/sparc64/kernel/cpu.c
index 77ef5df4e5a7..00eed88ef2e8 100644
--- a/arch/sparc64/kernel/cpu.c
+++ b/arch/sparc64/kernel/cpu.c
@@ -43,7 +43,7 @@ struct cpu_fp_info linux_sparc_fpu[] = {
43 { 0x3e, 0x22, 0, "UltraSparc IIIi+ integrated FPU"}, 43 { 0x3e, 0x22, 0, "UltraSparc IIIi+ integrated FPU"},
44}; 44};
45 45
46#define NSPARCFPU (sizeof(linux_sparc_fpu)/sizeof(struct cpu_fp_info)) 46#define NSPARCFPU ARRAY_SIZE(linux_sparc_fpu)
47 47
48struct cpu_iu_info linux_sparc_chips[] = { 48struct cpu_iu_info linux_sparc_chips[] = {
49 { 0x17, 0x10, "TI UltraSparc I (SpitFire)"}, 49 { 0x17, 0x10, "TI UltraSparc I (SpitFire)"},
@@ -59,7 +59,7 @@ struct cpu_iu_info linux_sparc_chips[] = {
59 { 0x3e, 0x22, "TI UltraSparc IIIi+ (Serrano)"}, 59 { 0x3e, 0x22, "TI UltraSparc IIIi+ (Serrano)"},
60}; 60};
61 61
62#define NSPARCCHIPS (sizeof(linux_sparc_chips)/sizeof(struct cpu_iu_info)) 62#define NSPARCCHIPS ARRAY_SIZE(linux_sparc_chips)
63 63
64char *sparc_cpu_type = "cpu-oops"; 64char *sparc_cpu_type = "cpu-oops";
65char *sparc_fpu_type = "fpu-oops"; 65char *sparc_fpu_type = "fpu-oops";
diff --git a/arch/sparc64/kernel/ioctl32.c b/arch/sparc64/kernel/ioctl32.c
index 92e26304de90..e62214354bb5 100644
--- a/arch/sparc64/kernel/ioctl32.c
+++ b/arch/sparc64/kernel/ioctl32.c
@@ -92,10 +92,8 @@ static int fbiogscursor(unsigned int fd, unsigned int cmd, unsigned long arg)
92 return sys_ioctl (fd, FBIOSCURSOR, (unsigned long)p); 92 return sys_ioctl (fd, FBIOSCURSOR, (unsigned long)p);
93} 93}
94 94
95typedef int (* ioctl32_handler_t)(unsigned int, unsigned int, unsigned long, struct file *);
96
97#define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL((cmd),sys_ioctl) 95#define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL((cmd),sys_ioctl)
98#define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl32_handler_t)(handler), NULL }, 96#define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl_trans_handler_t)(handler), NULL },
99#define IOCTL_TABLE_START \ 97#define IOCTL_TABLE_START \
100 struct ioctl_trans ioctl_start[] = { 98 struct ioctl_trans ioctl_start[] = {
101#define IOCTL_TABLE_END \ 99#define IOCTL_TABLE_END \
@@ -116,8 +114,6 @@ COMPATIBLE_IOCTL(FBIOGCURPOS)
116COMPATIBLE_IOCTL(FBIOGCURMAX) 114COMPATIBLE_IOCTL(FBIOGCURMAX)
117/* Little k */ 115/* Little k */
118/* Little v, the video4linux ioctls */ 116/* Little v, the video4linux ioctls */
119COMPATIBLE_IOCTL(_IOR('p', 20, int[7])) /* RTCGET */
120COMPATIBLE_IOCTL(_IOW('p', 21, int[7])) /* RTCSET */
121/* And these ioctls need translation */ 117/* And these ioctls need translation */
122/* Note SIOCRTMSG is no longer, so this is safe and * the user would have seen just an -EINVAL anyways. */ 118/* Note SIOCRTMSG is no longer, so this is safe and * the user would have seen just an -EINVAL anyways. */
123HANDLE_IOCTL(FBIOPUTCMAP32, fbiogetputcmap) 119HANDLE_IOCTL(FBIOPUTCMAP32, fbiogetputcmap)
diff --git a/arch/sparc64/kernel/process.c b/arch/sparc64/kernel/process.c
index 7d10b0397091..02f9dec1d459 100644
--- a/arch/sparc64/kernel/process.c
+++ b/arch/sparc64/kernel/process.c
@@ -74,7 +74,9 @@ void cpu_idle(void)
74 while (!need_resched()) 74 while (!need_resched())
75 barrier(); 75 barrier();
76 76
77 preempt_enable_no_resched();
77 schedule(); 78 schedule();
79 preempt_disable();
78 check_pgt_cache(); 80 check_pgt_cache();
79 } 81 }
80} 82}
@@ -83,21 +85,31 @@ void cpu_idle(void)
83 85
84/* 86/*
85 * the idle loop on a UltraMultiPenguin... 87 * the idle loop on a UltraMultiPenguin...
88 *
89 * TIF_POLLING_NRFLAG is set because we do not sleep the cpu
90 * inside of the idler task, so an interrupt is not needed
91 * to get a clean fast response.
92 *
93 * XXX Reverify this assumption... -DaveM
94 *
95 * Addendum: We do want it to do something for the signal
96 * delivery case, we detect that by just seeing
97 * if we are trying to send this to an idler or not.
86 */ 98 */
87#define idle_me_harder() (cpu_data(smp_processor_id()).idle_volume += 1)
88#define unidle_me() (cpu_data(smp_processor_id()).idle_volume = 0)
89void cpu_idle(void) 99void cpu_idle(void)
90{ 100{
101 cpuinfo_sparc *cpuinfo = &local_cpu_data();
91 set_thread_flag(TIF_POLLING_NRFLAG); 102 set_thread_flag(TIF_POLLING_NRFLAG);
103
92 while(1) { 104 while(1) {
93 if (need_resched()) { 105 if (need_resched()) {
94 unidle_me(); 106 cpuinfo->idle_volume = 0;
95 clear_thread_flag(TIF_POLLING_NRFLAG); 107 preempt_enable_no_resched();
96 schedule(); 108 schedule();
97 set_thread_flag(TIF_POLLING_NRFLAG); 109 preempt_disable();
98 check_pgt_cache(); 110 check_pgt_cache();
99 } 111 }
100 idle_me_harder(); 112 cpuinfo->idle_volume++;
101 113
102 /* The store ordering is so that IRQ handlers on 114 /* The store ordering is so that IRQ handlers on
103 * other cpus see our increasing idleness for the buddy 115 * other cpus see our increasing idleness for the buddy
diff --git a/arch/sparc64/kernel/sbus.c b/arch/sparc64/kernel/sbus.c
index e09ddf927655..96b825055668 100644
--- a/arch/sparc64/kernel/sbus.c
+++ b/arch/sparc64/kernel/sbus.c
@@ -790,7 +790,7 @@ static unsigned long sysio_irq_offsets[] = {
790 790
791#undef bogon 791#undef bogon
792 792
793#define NUM_SYSIO_OFFSETS (sizeof(sysio_irq_offsets) / sizeof(sysio_irq_offsets[0])) 793#define NUM_SYSIO_OFFSETS ARRAY_SIZE(sysio_irq_offsets)
794 794
795/* Convert Interrupt Mapping register pointer to associated 795/* Convert Interrupt Mapping register pointer to associated
796 * Interrupt Clear register pointer, SYSIO specific version. 796 * Interrupt Clear register pointer, SYSIO specific version.
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
index 5d90ee9aebf1..797a65493fb8 100644
--- a/arch/sparc64/kernel/smp.c
+++ b/arch/sparc64/kernel/smp.c
@@ -168,6 +168,9 @@ void __init smp_callin(void)
168 rmb(); 168 rmb();
169 169
170 cpu_set(cpuid, cpu_online_map); 170 cpu_set(cpuid, cpu_online_map);
171
172 /* idle thread is expected to have preempt disabled */
173 preempt_disable();
171} 174}
172 175
173void cpu_panic(void) 176void cpu_panic(void)
@@ -1149,20 +1152,9 @@ void __init smp_cpus_done(unsigned int max_cpus)
1149 (bogosum/(5000/HZ))%100); 1152 (bogosum/(5000/HZ))%100);
1150} 1153}
1151 1154
1152/* This needn't do anything as we do not sleep the cpu
1153 * inside of the idler task, so an interrupt is not needed
1154 * to get a clean fast response.
1155 *
1156 * XXX Reverify this assumption... -DaveM
1157 *
1158 * Addendum: We do want it to do something for the signal
1159 * delivery case, we detect that by just seeing
1160 * if we are trying to send this to an idler or not.
1161 */
1162void smp_send_reschedule(int cpu) 1155void smp_send_reschedule(int cpu)
1163{ 1156{
1164 if (cpu_data(cpu).idle_volume == 0) 1157 smp_receive_signal(cpu);
1165 smp_receive_signal(cpu);
1166} 1158}
1167 1159
1168/* This is a nop because we capture all other cpus 1160/* This is a nop because we capture all other cpus
diff --git a/arch/sparc64/mm/fault.c b/arch/sparc64/mm/fault.c
index 31fbc67719a1..6f0539aa44d0 100644
--- a/arch/sparc64/mm/fault.c
+++ b/arch/sparc64/mm/fault.c
@@ -30,8 +30,6 @@
30#include <asm/sections.h> 30#include <asm/sections.h>
31#include <asm/kdebug.h> 31#include <asm/kdebug.h>
32 32
33#define ELEMENTS(arr) (sizeof (arr)/sizeof (arr[0]))
34
35/* 33/*
36 * To debug kernel to catch accesses to certain virtual/physical addresses. 34 * To debug kernel to catch accesses to certain virtual/physical addresses.
37 * Mode = 0 selects physical watchpoints, mode = 1 selects virtual watchpoints. 35 * Mode = 0 selects physical watchpoints, mode = 1 selects virtual watchpoints.
@@ -109,7 +107,7 @@ static void bad_kernel_pc(struct pt_regs *regs)
109 * this. Additionally, to prevent kswapd from ripping ptes from 107 * this. Additionally, to prevent kswapd from ripping ptes from
110 * under us, raise interrupts around the time that we look at the 108 * under us, raise interrupts around the time that we look at the
111 * pte, kswapd will have to wait to get his smp ipi response from 109 * pte, kswapd will have to wait to get his smp ipi response from
112 * us. This saves us having to get page_table_lock. 110 * us. vmtruncate likewise. This saves us having to get pte lock.
113 */ 111 */
114static unsigned int get_user_insn(unsigned long tpc) 112static unsigned int get_user_insn(unsigned long tpc)
115{ 113{
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c
index fe865d9a3721..4cf31a2ae19c 100644
--- a/arch/um/drivers/net_kern.c
+++ b/arch/um/drivers/net_kern.c
@@ -243,34 +243,18 @@ static int uml_net_change_mtu(struct net_device *dev, int new_mtu)
243 return err; 243 return err;
244} 244}
245 245
246static int uml_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) 246static void uml_net_get_drvinfo(struct net_device *dev,
247{ 247 struct ethtool_drvinfo *info)
248 static const struct ethtool_drvinfo info = { 248{
249 .cmd = ETHTOOL_GDRVINFO, 249 strcpy(info->driver, DRIVER_NAME);
250 .driver = DRIVER_NAME, 250 strcpy(info->version, "42");
251 .version = "42",
252 };
253 void *useraddr;
254 u32 ethcmd;
255
256 switch (cmd) {
257 case SIOCETHTOOL:
258 useraddr = ifr->ifr_data;
259 if (copy_from_user(&ethcmd, useraddr, sizeof(ethcmd)))
260 return -EFAULT;
261 switch (ethcmd) {
262 case ETHTOOL_GDRVINFO:
263 if (copy_to_user(useraddr, &info, sizeof(info)))
264 return -EFAULT;
265 return 0;
266 default:
267 return -EOPNOTSUPP;
268 }
269 default:
270 return -EINVAL;
271 }
272} 251}
273 252
253static struct ethtool_ops uml_net_ethtool_ops = {
254 .get_drvinfo = uml_net_get_drvinfo,
255 .get_link = ethtool_op_get_link,
256};
257
274void uml_net_user_timer_expire(unsigned long _conn) 258void uml_net_user_timer_expire(unsigned long _conn)
275{ 259{
276#ifdef undef 260#ifdef undef
@@ -359,7 +343,7 @@ static int eth_configure(int n, void *init, char *mac,
359 dev->tx_timeout = uml_net_tx_timeout; 343 dev->tx_timeout = uml_net_tx_timeout;
360 dev->set_mac_address = uml_net_set_mac; 344 dev->set_mac_address = uml_net_set_mac;
361 dev->change_mtu = uml_net_change_mtu; 345 dev->change_mtu = uml_net_change_mtu;
362 dev->do_ioctl = uml_net_ioctl; 346 dev->ethtool_ops = &uml_net_ethtool_ops;
363 dev->watchdog_timeo = (HZ >> 1); 347 dev->watchdog_timeo = (HZ >> 1);
364 dev->irq = UM_ETH_IRQ; 348 dev->irq = UM_ETH_IRQ;
365 349
diff --git a/arch/v850/kernel/process.c b/arch/v850/kernel/process.c
index 9c708c32c1f0..39cf247cdae4 100644
--- a/arch/v850/kernel/process.c
+++ b/arch/v850/kernel/process.c
@@ -36,11 +36,8 @@ extern void ret_from_fork (void);
36/* The idle loop. */ 36/* The idle loop. */
37void default_idle (void) 37void default_idle (void)
38{ 38{
39 while (1) { 39 while (! need_resched ())
40 while (! need_resched ()) 40 asm ("halt; nop; nop; nop; nop; nop" ::: "cc");
41 asm ("halt; nop; nop; nop; nop; nop" ::: "cc");
42 schedule ();
43 }
44} 41}
45 42
46void (*idle)(void) = default_idle; 43void (*idle)(void) = default_idle;
@@ -54,7 +51,14 @@ void (*idle)(void) = default_idle;
54void cpu_idle (void) 51void cpu_idle (void)
55{ 52{
56 /* endless idle loop with no priority at all */ 53 /* endless idle loop with no priority at all */
57 (*idle) (); 54 while (1) {
55 while (!need_resched())
56 (*idle) ();
57
58 preempt_enable_no_resched();
59 schedule();
60 preempt_disable();
61 }
58} 62}
59 63
60/* 64/*
diff --git a/arch/x86_64/ia32/ia32_ioctl.c b/arch/x86_64/ia32/ia32_ioctl.c
index 4ba0e293d5e5..e335bd0b637d 100644
--- a/arch/x86_64/ia32/ia32_ioctl.c
+++ b/arch/x86_64/ia32/ia32_ioctl.c
@@ -64,12 +64,6 @@ struct ioctl_trans ioctl_start[] = {
64#include <linux/compat_ioctl.h> 64#include <linux/compat_ioctl.h>
65#define DECLARES 65#define DECLARES
66#include "compat_ioctl.c" 66#include "compat_ioctl.c"
67COMPATIBLE_IOCTL(HDIO_SET_KEEPSETTINGS)
68COMPATIBLE_IOCTL(HDIO_SCAN_HWIF)
69COMPATIBLE_IOCTL(BLKRASET)
70COMPATIBLE_IOCTL(0x4B50) /* KDGHWCLK - not in the kernel, but don't complain */
71COMPATIBLE_IOCTL(0x4B51) /* KDSHWCLK - not in the kernel, but don't complain */
72COMPATIBLE_IOCTL(FIOQSIZE)
73 67
74/* And these ioctls need translation */ 68/* And these ioctls need translation */
75/* realtime device */ 69/* realtime device */
diff --git a/arch/x86_64/kernel/process.c b/arch/x86_64/kernel/process.c
index b5a89c0bdf59..59be85d9a4bc 100644
--- a/arch/x86_64/kernel/process.c
+++ b/arch/x86_64/kernel/process.c
@@ -86,12 +86,22 @@ EXPORT_SYMBOL(enable_hlt);
86 */ 86 */
87void default_idle(void) 87void default_idle(void)
88{ 88{
89 local_irq_enable();
90
89 if (!atomic_read(&hlt_counter)) { 91 if (!atomic_read(&hlt_counter)) {
90 local_irq_disable(); 92 clear_thread_flag(TIF_POLLING_NRFLAG);
91 if (!need_resched()) 93 smp_mb__after_clear_bit();
92 safe_halt(); 94 while (!need_resched()) {
93 else 95 local_irq_disable();
94 local_irq_enable(); 96 if (!need_resched())
97 safe_halt();
98 else
99 local_irq_enable();
100 }
101 set_thread_flag(TIF_POLLING_NRFLAG);
102 } else {
103 while (!need_resched())
104 cpu_relax();
95 } 105 }
96} 106}
97 107
@@ -102,30 +112,16 @@ void default_idle(void)
102 */ 112 */
103static void poll_idle (void) 113static void poll_idle (void)
104{ 114{
105 int oldval;
106
107 local_irq_enable(); 115 local_irq_enable();
108 116
109 /* 117 asm volatile(
110 * Deal with another CPU just having chosen a thread to 118 "2:"
111 * run here: 119 "testl %0,%1;"
112 */ 120 "rep; nop;"
113 oldval = test_and_clear_thread_flag(TIF_NEED_RESCHED); 121 "je 2b;"
114 122 : :
115 if (!oldval) { 123 "i" (_TIF_NEED_RESCHED),
116 set_thread_flag(TIF_POLLING_NRFLAG); 124 "m" (current_thread_info()->flags));
117 asm volatile(
118 "2:"
119 "testl %0,%1;"
120 "rep; nop;"
121 "je 2b;"
122 : :
123 "i" (_TIF_NEED_RESCHED),
124 "m" (current_thread_info()->flags));
125 clear_thread_flag(TIF_POLLING_NRFLAG);
126 } else {
127 set_need_resched();
128 }
129} 125}
130 126
131void cpu_idle_wait(void) 127void cpu_idle_wait(void)
@@ -187,6 +183,8 @@ static inline void play_dead(void)
187 */ 183 */
188void cpu_idle (void) 184void cpu_idle (void)
189{ 185{
186 set_thread_flag(TIF_POLLING_NRFLAG);
187
190 /* endless idle loop with no priority at all */ 188 /* endless idle loop with no priority at all */
191 while (1) { 189 while (1) {
192 while (!need_resched()) { 190 while (!need_resched()) {
@@ -204,7 +202,9 @@ void cpu_idle (void)
204 idle(); 202 idle();
205 } 203 }
206 204
205 preempt_enable_no_resched();
207 schedule(); 206 schedule();
207 preempt_disable();
208 } 208 }
209} 209}
210 210
@@ -219,15 +219,12 @@ static void mwait_idle(void)
219{ 219{
220 local_irq_enable(); 220 local_irq_enable();
221 221
222 if (!need_resched()) { 222 while (!need_resched()) {
223 set_thread_flag(TIF_POLLING_NRFLAG); 223 __monitor((void *)&current_thread_info()->flags, 0, 0);
224 do { 224 smp_mb();
225 __monitor((void *)&current_thread_info()->flags, 0, 0); 225 if (need_resched())
226 if (need_resched()) 226 break;
227 break; 227 __mwait(0, 0);
228 __mwait(0, 0);
229 } while (!need_resched());
230 clear_thread_flag(TIF_POLLING_NRFLAG);
231 } 228 }
232} 229}
233 230
diff --git a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c
index 4b5b088ec102..c4e59bbdc187 100644
--- a/arch/x86_64/kernel/smpboot.c
+++ b/arch/x86_64/kernel/smpboot.c
@@ -472,6 +472,7 @@ void __cpuinit start_secondary(void)
472 * things done here to the most necessary things. 472 * things done here to the most necessary things.
473 */ 473 */
474 cpu_init(); 474 cpu_init();
475 preempt_disable();
475 smp_callin(); 476 smp_callin();
476 477
477 /* otherwise gcc will move up the smp_processor_id before the cpu_init */ 478 /* otherwise gcc will move up the smp_processor_id before the cpu_init */
diff --git a/arch/xtensa/kernel/process.c b/arch/xtensa/kernel/process.c
index 08ef6d82ee51..6a44b54ae817 100644
--- a/arch/xtensa/kernel/process.c
+++ b/arch/xtensa/kernel/process.c
@@ -96,8 +96,9 @@ void cpu_idle(void)
96 while (1) { 96 while (1) {
97 while (!need_resched()) 97 while (!need_resched())
98 platform_idle(); 98 platform_idle();
99 preempt_enable(); 99 preempt_enable_no_resched();
100 schedule(); 100 schedule();
101 preempt_disable();
101 } 102 }
102} 103}
103 104
diff --git a/arch/xtensa/platform-iss/network.c b/arch/xtensa/platform-iss/network.c
index 0682ffd38175..96b9bb4a478d 100644
--- a/arch/xtensa/platform-iss/network.c
+++ b/arch/xtensa/platform-iss/network.c
@@ -611,38 +611,6 @@ static int iss_net_change_mtu(struct net_device *dev, int new_mtu)
611 return -EINVAL; 611 return -EINVAL;
612} 612}
613 613
614static int iss_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
615{
616#if 0
617 static const struct ethtool_drvinfo info = {
618 .cmd = ETHTOOL_GDRVINFO,
619 .driver = DRIVER_NAME,
620 .version = "42",
621 };
622 void *useraddr;
623 u32 ethcmd;
624
625 switch (cmd) {
626 case SIOCETHTOOL:
627 useraddr = ifr->ifr_data;
628 if (copy_from_user(&ethcmd, useraddr, sizeof(ethcmd)))
629 return -EFAULT;
630
631 switch (ethcmd) {
632 case ETHTOOL_GDRVINFO:
633 if (copy_to_user(useraddr, &info, sizeof(info)))
634 return -EFAULT;
635 return 0;
636 default:
637 return -EOPNOTSUPP;
638 }
639 default:
640 return -EINVAL;
641 }
642#endif
643 return -EINVAL;
644}
645
646void iss_net_user_timer_expire(unsigned long _conn) 614void iss_net_user_timer_expire(unsigned long _conn)
647{ 615{
648} 616}
@@ -730,7 +698,6 @@ static int iss_net_configure(int index, char *init)
730 dev->tx_timeout = iss_net_tx_timeout; 698 dev->tx_timeout = iss_net_tx_timeout;
731 dev->set_mac_address = iss_net_set_mac; 699 dev->set_mac_address = iss_net_set_mac;
732 dev->change_mtu = iss_net_change_mtu; 700 dev->change_mtu = iss_net_change_mtu;
733 dev->do_ioctl = iss_net_ioctl;
734 dev->watchdog_timeo = (HZ >> 1); 701 dev->watchdog_timeo = (HZ >> 1);
735 dev->irq = -1; 702 dev->irq = -1;
736 703