aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/Makefile2
-rw-r--r--arch/powerpc/boot/dts/canyonlands.dts8
-rw-r--r--arch/powerpc/include/asm/compat.h2
-rw-r--r--arch/powerpc/include/asm/fsldma.h1
-rw-r--r--arch/powerpc/include/asm/mmu-hash64.h2
-rw-r--r--arch/powerpc/include/asm/reg.h9
-rw-r--r--arch/powerpc/include/asm/rwsem.h64
-rw-r--r--arch/powerpc/include/asm/systbl.h3
-rw-r--r--arch/powerpc/include/asm/unistd.h5
-rw-r--r--arch/powerpc/kernel/cputable.c1
-rw-r--r--arch/powerpc/kernel/crash.c24
-rw-r--r--arch/powerpc/kernel/head_44x.S4
-rw-r--r--arch/powerpc/kernel/head_64.S18
-rw-r--r--arch/powerpc/kernel/idle.c2
-rw-r--r--arch/powerpc/kernel/irq.c16
-rw-r--r--arch/powerpc/kernel/misc_32.S3
-rw-r--r--arch/powerpc/kernel/module.c6
-rw-r--r--arch/powerpc/kernel/pci_of_scan.c2
-rw-r--r--arch/powerpc/kernel/process.c25
-rw-r--r--arch/powerpc/kernel/setup_32.c9
-rw-r--r--arch/powerpc/kernel/setup_64.c63
-rw-r--r--arch/powerpc/kernel/signal.c2
-rw-r--r--arch/powerpc/kernel/signal_32.c3
-rw-r--r--arch/powerpc/kernel/signal_64.c2
-rw-r--r--arch/powerpc/kernel/smp.c4
-rw-r--r--arch/powerpc/kernel/sys_ppc32.c8
-rw-r--r--arch/powerpc/kernel/time.c23
-rw-r--r--arch/powerpc/kernel/vio.c3
-rw-r--r--arch/powerpc/mm/init_64.c2
-rw-r--r--arch/powerpc/mm/tlb_nohash_low.S1
-rw-r--r--arch/powerpc/platforms/512x/clock.c2
-rw-r--r--arch/powerpc/platforms/52xx/efika.c9
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_common.c8
-rw-r--r--arch/powerpc/platforms/83xx/mpc837x_mds.c9
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_mds.c1
-rw-r--r--arch/powerpc/platforms/85xx/p1022_ds.c3
-rw-r--r--arch/powerpc/platforms/Kconfig3
-rw-r--r--arch/powerpc/platforms/cell/iommu.c2
-rw-r--r--arch/powerpc/platforms/iseries/iommu.c2
-rw-r--r--arch/powerpc/platforms/powermac/feature.c3
-rw-r--r--arch/powerpc/platforms/powermac/pci.c2
-rw-r--r--arch/powerpc/platforms/pseries/dlpar.c42
-rw-r--r--arch/powerpc/platforms/pseries/iommu.c8
-rw-r--r--arch/powerpc/platforms/pseries/smp.c11
-rw-r--r--arch/powerpc/platforms/pseries/xics.c6
-rw-r--r--arch/powerpc/sysdev/fsl_pci.c2
-rw-r--r--arch/powerpc/sysdev/fsl_rio.c6
-rw-r--r--arch/powerpc/sysdev/qe_lib/qe.c1
-rw-r--r--arch/powerpc/xmon/xmon.c5
49 files changed, 269 insertions, 173 deletions
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index e3ea151c9597..b7212b619c52 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -164,7 +164,7 @@ drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/
164all: zImage 164all: zImage
165 165
166# With make 3.82 we cannot mix normal and wildcard targets 166# With make 3.82 we cannot mix normal and wildcard targets
167BOOT_TARGETS1 := zImage zImage.initrd uImaged 167BOOT_TARGETS1 := zImage zImage.initrd uImage
168BOOT_TARGETS2 := zImage% dtbImage% treeImage.% cuImage.% simpleImage.% 168BOOT_TARGETS2 := zImage% dtbImage% treeImage.% cuImage.% simpleImage.%
169 169
170PHONY += $(BOOT_TARGETS1) $(BOOT_TARGETS2) 170PHONY += $(BOOT_TARGETS1) $(BOOT_TARGETS2)
diff --git a/arch/powerpc/boot/dts/canyonlands.dts b/arch/powerpc/boot/dts/canyonlands.dts
index 5806ef0b860b..a30370396250 100644
--- a/arch/powerpc/boot/dts/canyonlands.dts
+++ b/arch/powerpc/boot/dts/canyonlands.dts
@@ -163,6 +163,14 @@
163 interrupts = <0x1e 4>; 163 interrupts = <0x1e 4>;
164 }; 164 };
165 165
166 SATA0: sata@bffd1000 {
167 compatible = "amcc,sata-460ex";
168 reg = <4 0xbffd1000 0x800 4 0xbffd0800 0x400>;
169 interrupt-parent = <&UIC3>;
170 interrupts = <0x0 0x4 /* SATA */
171 0x5 0x4>; /* AHBDMA */
172 };
173
166 POB0: opb { 174 POB0: opb {
167 compatible = "ibm,opb-460ex", "ibm,opb"; 175 compatible = "ibm,opb-460ex", "ibm,opb";
168 #address-cells = <1>; 176 #address-cells = <1>;
diff --git a/arch/powerpc/include/asm/compat.h b/arch/powerpc/include/asm/compat.h
index 396d21a80058..a11d4eac4f97 100644
--- a/arch/powerpc/include/asm/compat.h
+++ b/arch/powerpc/include/asm/compat.h
@@ -134,7 +134,7 @@ static inline compat_uptr_t ptr_to_compat(void __user *uptr)
134 return (u32)(unsigned long)uptr; 134 return (u32)(unsigned long)uptr;
135} 135}
136 136
137static inline void __user *compat_alloc_user_space(long len) 137static inline void __user *arch_compat_alloc_user_space(long len)
138{ 138{
139 struct pt_regs *regs = current->thread.regs; 139 struct pt_regs *regs = current->thread.regs;
140 unsigned long usp = regs->gpr[1]; 140 unsigned long usp = regs->gpr[1];
diff --git a/arch/powerpc/include/asm/fsldma.h b/arch/powerpc/include/asm/fsldma.h
index a67aeed17d40..debc5ed96d6e 100644
--- a/arch/powerpc/include/asm/fsldma.h
+++ b/arch/powerpc/include/asm/fsldma.h
@@ -11,6 +11,7 @@
11#ifndef __ARCH_POWERPC_ASM_FSLDMA_H__ 11#ifndef __ARCH_POWERPC_ASM_FSLDMA_H__
12#define __ARCH_POWERPC_ASM_FSLDMA_H__ 12#define __ARCH_POWERPC_ASM_FSLDMA_H__
13 13
14#include <linux/slab.h>
14#include <linux/dmaengine.h> 15#include <linux/dmaengine.h>
15 16
16/* 17/*
diff --git a/arch/powerpc/include/asm/mmu-hash64.h b/arch/powerpc/include/asm/mmu-hash64.h
index 0e398cfee2c8..acac35d5b382 100644
--- a/arch/powerpc/include/asm/mmu-hash64.h
+++ b/arch/powerpc/include/asm/mmu-hash64.h
@@ -433,7 +433,7 @@ typedef struct {
433 * with. However gcc is not clever enough to compute the 433 * with. However gcc is not clever enough to compute the
434 * modulus (2^n-1) without a second multiply. 434 * modulus (2^n-1) without a second multiply.
435 */ 435 */
436#define vsid_scrample(protovsid, size) \ 436#define vsid_scramble(protovsid, size) \
437 ((((protovsid) * VSID_MULTIPLIER_##size) % VSID_MODULUS_##size)) 437 ((((protovsid) * VSID_MULTIPLIER_##size) % VSID_MODULUS_##size))
438 438
439#else /* 1 */ 439#else /* 1 */
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index d8be016d2ede..ff0005eec7dd 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -951,7 +951,14 @@
951#ifdef CONFIG_PPC64 951#ifdef CONFIG_PPC64
952 952
953extern void ppc64_runlatch_on(void); 953extern void ppc64_runlatch_on(void);
954extern void ppc64_runlatch_off(void); 954extern void __ppc64_runlatch_off(void);
955
956#define ppc64_runlatch_off() \
957 do { \
958 if (cpu_has_feature(CPU_FTR_CTRL) && \
959 test_thread_flag(TIF_RUNLATCH)) \
960 __ppc64_runlatch_off(); \
961 } while (0)
955 962
956extern unsigned long scom970_read(unsigned int address); 963extern unsigned long scom970_read(unsigned int address);
957extern void scom970_write(unsigned int address, unsigned long value); 964extern void scom970_write(unsigned int address, unsigned long value);
diff --git a/arch/powerpc/include/asm/rwsem.h b/arch/powerpc/include/asm/rwsem.h
index 24cd9281ec37..8447d89fbe72 100644
--- a/arch/powerpc/include/asm/rwsem.h
+++ b/arch/powerpc/include/asm/rwsem.h
@@ -21,15 +21,20 @@
21/* 21/*
22 * the semaphore definition 22 * the semaphore definition
23 */ 23 */
24struct rw_semaphore { 24#ifdef CONFIG_PPC64
25 /* XXX this should be able to be an atomic_t -- paulus */ 25# define RWSEM_ACTIVE_MASK 0xffffffffL
26 signed int count; 26#else
27#define RWSEM_UNLOCKED_VALUE 0x00000000 27# define RWSEM_ACTIVE_MASK 0x0000ffffL
28#define RWSEM_ACTIVE_BIAS 0x00000001 28#endif
29#define RWSEM_ACTIVE_MASK 0x0000ffff 29
30#define RWSEM_WAITING_BIAS (-0x00010000) 30#define RWSEM_UNLOCKED_VALUE 0x00000000L
31#define RWSEM_ACTIVE_BIAS 0x00000001L
32#define RWSEM_WAITING_BIAS (-RWSEM_ACTIVE_MASK-1)
31#define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BIAS 33#define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BIAS
32#define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS) 34#define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
35
36struct rw_semaphore {
37 long count;
33 spinlock_t wait_lock; 38 spinlock_t wait_lock;
34 struct list_head wait_list; 39 struct list_head wait_list;
35#ifdef CONFIG_DEBUG_LOCK_ALLOC 40#ifdef CONFIG_DEBUG_LOCK_ALLOC
@@ -43,9 +48,13 @@ struct rw_semaphore {
43# define __RWSEM_DEP_MAP_INIT(lockname) 48# define __RWSEM_DEP_MAP_INIT(lockname)
44#endif 49#endif
45 50
46#define __RWSEM_INITIALIZER(name) \ 51#define __RWSEM_INITIALIZER(name) \
47 { RWSEM_UNLOCKED_VALUE, __SPIN_LOCK_UNLOCKED((name).wait_lock), \ 52{ \
48 LIST_HEAD_INIT((name).wait_list) __RWSEM_DEP_MAP_INIT(name) } 53 RWSEM_UNLOCKED_VALUE, \
54 __SPIN_LOCK_UNLOCKED((name).wait_lock), \
55 LIST_HEAD_INIT((name).wait_list) \
56 __RWSEM_DEP_MAP_INIT(name) \
57}
49 58
50#define DECLARE_RWSEM(name) \ 59#define DECLARE_RWSEM(name) \
51 struct rw_semaphore name = __RWSEM_INITIALIZER(name) 60 struct rw_semaphore name = __RWSEM_INITIALIZER(name)
@@ -70,13 +79,13 @@ extern void __init_rwsem(struct rw_semaphore *sem, const char *name,
70 */ 79 */
71static inline void __down_read(struct rw_semaphore *sem) 80static inline void __down_read(struct rw_semaphore *sem)
72{ 81{
73 if (unlikely(atomic_inc_return((atomic_t *)(&sem->count)) <= 0)) 82 if (unlikely(atomic_long_inc_return((atomic_long_t *)&sem->count) <= 0))
74 rwsem_down_read_failed(sem); 83 rwsem_down_read_failed(sem);
75} 84}
76 85
77static inline int __down_read_trylock(struct rw_semaphore *sem) 86static inline int __down_read_trylock(struct rw_semaphore *sem)
78{ 87{
79 int tmp; 88 long tmp;
80 89
81 while ((tmp = sem->count) >= 0) { 90 while ((tmp = sem->count) >= 0) {
82 if (tmp == cmpxchg(&sem->count, tmp, 91 if (tmp == cmpxchg(&sem->count, tmp,
@@ -92,10 +101,10 @@ static inline int __down_read_trylock(struct rw_semaphore *sem)
92 */ 101 */
93static inline void __down_write_nested(struct rw_semaphore *sem, int subclass) 102static inline void __down_write_nested(struct rw_semaphore *sem, int subclass)
94{ 103{
95 int tmp; 104 long tmp;
96 105
97 tmp = atomic_add_return(RWSEM_ACTIVE_WRITE_BIAS, 106 tmp = atomic_long_add_return(RWSEM_ACTIVE_WRITE_BIAS,
98 (atomic_t *)(&sem->count)); 107 (atomic_long_t *)&sem->count);
99 if (unlikely(tmp != RWSEM_ACTIVE_WRITE_BIAS)) 108 if (unlikely(tmp != RWSEM_ACTIVE_WRITE_BIAS))
100 rwsem_down_write_failed(sem); 109 rwsem_down_write_failed(sem);
101} 110}
@@ -107,7 +116,7 @@ static inline void __down_write(struct rw_semaphore *sem)
107 116
108static inline int __down_write_trylock(struct rw_semaphore *sem) 117static inline int __down_write_trylock(struct rw_semaphore *sem)
109{ 118{
110 int tmp; 119 long tmp;
111 120
112 tmp = cmpxchg(&sem->count, RWSEM_UNLOCKED_VALUE, 121 tmp = cmpxchg(&sem->count, RWSEM_UNLOCKED_VALUE,
113 RWSEM_ACTIVE_WRITE_BIAS); 122 RWSEM_ACTIVE_WRITE_BIAS);
@@ -119,9 +128,9 @@ static inline int __down_write_trylock(struct rw_semaphore *sem)
119 */ 128 */
120static inline void __up_read(struct rw_semaphore *sem) 129static inline void __up_read(struct rw_semaphore *sem)
121{ 130{
122 int tmp; 131 long tmp;
123 132
124 tmp = atomic_dec_return((atomic_t *)(&sem->count)); 133 tmp = atomic_long_dec_return((atomic_long_t *)&sem->count);
125 if (unlikely(tmp < -1 && (tmp & RWSEM_ACTIVE_MASK) == 0)) 134 if (unlikely(tmp < -1 && (tmp & RWSEM_ACTIVE_MASK) == 0))
126 rwsem_wake(sem); 135 rwsem_wake(sem);
127} 136}
@@ -131,17 +140,17 @@ static inline void __up_read(struct rw_semaphore *sem)
131 */ 140 */
132static inline void __up_write(struct rw_semaphore *sem) 141static inline void __up_write(struct rw_semaphore *sem)
133{ 142{
134 if (unlikely(atomic_sub_return(RWSEM_ACTIVE_WRITE_BIAS, 143 if (unlikely(atomic_long_sub_return(RWSEM_ACTIVE_WRITE_BIAS,
135 (atomic_t *)(&sem->count)) < 0)) 144 (atomic_long_t *)&sem->count) < 0))
136 rwsem_wake(sem); 145 rwsem_wake(sem);
137} 146}
138 147
139/* 148/*
140 * implement atomic add functionality 149 * implement atomic add functionality
141 */ 150 */
142static inline void rwsem_atomic_add(int delta, struct rw_semaphore *sem) 151static inline void rwsem_atomic_add(long delta, struct rw_semaphore *sem)
143{ 152{
144 atomic_add(delta, (atomic_t *)(&sem->count)); 153 atomic_long_add(delta, (atomic_long_t *)&sem->count);
145} 154}
146 155
147/* 156/*
@@ -149,9 +158,10 @@ static inline void rwsem_atomic_add(int delta, struct rw_semaphore *sem)
149 */ 158 */
150static inline void __downgrade_write(struct rw_semaphore *sem) 159static inline void __downgrade_write(struct rw_semaphore *sem)
151{ 160{
152 int tmp; 161 long tmp;
153 162
154 tmp = atomic_add_return(-RWSEM_WAITING_BIAS, (atomic_t *)(&sem->count)); 163 tmp = atomic_long_add_return(-RWSEM_WAITING_BIAS,
164 (atomic_long_t *)&sem->count);
155 if (tmp < 0) 165 if (tmp < 0)
156 rwsem_downgrade_wake(sem); 166 rwsem_downgrade_wake(sem);
157} 167}
@@ -159,14 +169,14 @@ static inline void __downgrade_write(struct rw_semaphore *sem)
159/* 169/*
160 * implement exchange and add functionality 170 * implement exchange and add functionality
161 */ 171 */
162static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem) 172static inline long rwsem_atomic_update(long delta, struct rw_semaphore *sem)
163{ 173{
164 return atomic_add_return(delta, (atomic_t *)(&sem->count)); 174 return atomic_long_add_return(delta, (atomic_long_t *)&sem->count);
165} 175}
166 176
167static inline int rwsem_is_locked(struct rw_semaphore *sem) 177static inline int rwsem_is_locked(struct rw_semaphore *sem)
168{ 178{
169 return (sem->count != 0); 179 return sem->count != 0;
170} 180}
171 181
172#endif /* __KERNEL__ */ 182#endif /* __KERNEL__ */
diff --git a/arch/powerpc/include/asm/systbl.h b/arch/powerpc/include/asm/systbl.h
index a5ee345b6a5c..3d212669a130 100644
--- a/arch/powerpc/include/asm/systbl.h
+++ b/arch/powerpc/include/asm/systbl.h
@@ -326,3 +326,6 @@ SYSCALL_SPU(perf_event_open)
326COMPAT_SYS_SPU(preadv) 326COMPAT_SYS_SPU(preadv)
327COMPAT_SYS_SPU(pwritev) 327COMPAT_SYS_SPU(pwritev)
328COMPAT_SYS(rt_tgsigqueueinfo) 328COMPAT_SYS(rt_tgsigqueueinfo)
329SYSCALL(fanotify_init)
330COMPAT_SYS(fanotify_mark)
331SYSCALL_SPU(prlimit64)
diff --git a/arch/powerpc/include/asm/unistd.h b/arch/powerpc/include/asm/unistd.h
index f0a10266e7f7..597e6f9d094a 100644
--- a/arch/powerpc/include/asm/unistd.h
+++ b/arch/powerpc/include/asm/unistd.h
@@ -345,10 +345,13 @@
345#define __NR_preadv 320 345#define __NR_preadv 320
346#define __NR_pwritev 321 346#define __NR_pwritev 321
347#define __NR_rt_tgsigqueueinfo 322 347#define __NR_rt_tgsigqueueinfo 322
348#define __NR_fanotify_init 323
349#define __NR_fanotify_mark 324
350#define __NR_prlimit64 325
348 351
349#ifdef __KERNEL__ 352#ifdef __KERNEL__
350 353
351#define __NR_syscalls 323 354#define __NR_syscalls 326
352 355
353#define __NR__exit __NR_exit 356#define __NR__exit __NR_exit
354#define NR_syscalls __NR_syscalls 357#define NR_syscalls __NR_syscalls
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index 65e2b4e10f97..1f9123f412ec 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -1826,7 +1826,6 @@ static struct cpu_spec __initdata cpu_specs[] = {
1826 .cpu_features = CPU_FTRS_47X, 1826 .cpu_features = CPU_FTRS_47X,
1827 .cpu_user_features = COMMON_USER_BOOKE | 1827 .cpu_user_features = COMMON_USER_BOOKE |
1828 PPC_FEATURE_HAS_FPU, 1828 PPC_FEATURE_HAS_FPU,
1829 .cpu_user_features = COMMON_USER_BOOKE,
1830 .mmu_features = MMU_FTR_TYPE_47x | 1829 .mmu_features = MMU_FTR_TYPE_47x |
1831 MMU_FTR_USE_TLBIVAX_BCAST | MMU_FTR_LOCK_BCAST_INVAL, 1830 MMU_FTR_USE_TLBIVAX_BCAST | MMU_FTR_LOCK_BCAST_INVAL,
1832 .icache_bsize = 32, 1831 .icache_bsize = 32,
diff --git a/arch/powerpc/kernel/crash.c b/arch/powerpc/kernel/crash.c
index 417f7b05a9ce..4457382f8667 100644
--- a/arch/powerpc/kernel/crash.c
+++ b/arch/powerpc/kernel/crash.c
@@ -402,6 +402,18 @@ void default_machine_crash_shutdown(struct pt_regs *regs)
402 */ 402 */
403 hard_irq_disable(); 403 hard_irq_disable();
404 404
405 /*
406 * Make a note of crashing cpu. Will be used in machine_kexec
407 * such that another IPI will not be sent.
408 */
409 crashing_cpu = smp_processor_id();
410 crash_save_cpu(regs, crashing_cpu);
411 crash_kexec_prepare_cpus(crashing_cpu);
412 cpu_set(crashing_cpu, cpus_in_crash);
413#if defined(CONFIG_PPC_STD_MMU_64) && defined(CONFIG_SMP)
414 crash_kexec_wait_realmode(crashing_cpu);
415#endif
416
405 for_each_irq(i) { 417 for_each_irq(i) {
406 struct irq_desc *desc = irq_to_desc(i); 418 struct irq_desc *desc = irq_to_desc(i);
407 419
@@ -438,18 +450,8 @@ void default_machine_crash_shutdown(struct pt_regs *regs)
438 crash_shutdown_cpu = -1; 450 crash_shutdown_cpu = -1;
439 __debugger_fault_handler = old_handler; 451 __debugger_fault_handler = old_handler;
440 452
441 /*
442 * Make a note of crashing cpu. Will be used in machine_kexec
443 * such that another IPI will not be sent.
444 */
445 crashing_cpu = smp_processor_id();
446 crash_save_cpu(regs, crashing_cpu);
447 crash_kexec_prepare_cpus(crashing_cpu);
448 cpu_set(crashing_cpu, cpus_in_crash);
449 crash_kexec_stop_spus(); 453 crash_kexec_stop_spus();
450#if defined(CONFIG_PPC_STD_MMU_64) && defined(CONFIG_SMP) 454
451 crash_kexec_wait_realmode(crashing_cpu);
452#endif
453 if (ppc_md.kexec_cpu_down) 455 if (ppc_md.kexec_cpu_down)
454 ppc_md.kexec_cpu_down(1, 0); 456 ppc_md.kexec_cpu_down(1, 0);
455} 457}
diff --git a/arch/powerpc/kernel/head_44x.S b/arch/powerpc/kernel/head_44x.S
index 5ab484ef06a7..562305b40a8e 100644
--- a/arch/powerpc/kernel/head_44x.S
+++ b/arch/powerpc/kernel/head_44x.S
@@ -113,6 +113,10 @@ _ENTRY(_start);
113 stw r5, 0(r4) /* Save abatron_pteptrs at a fixed location */ 113 stw r5, 0(r4) /* Save abatron_pteptrs at a fixed location */
114 stw r6, 0(r5) 114 stw r6, 0(r5)
115 115
116 /* Clear the Machine Check Syndrome Register */
117 li r0,0
118 mtspr SPRN_MCSR,r0
119
116 /* Let's move on */ 120 /* Let's move on */
117 lis r4,start_kernel@h 121 lis r4,start_kernel@h
118 ori r4,r4,start_kernel@l 122 ori r4,r4,start_kernel@l
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index 844a44b64472..c571cd3c1453 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -572,15 +572,21 @@ __secondary_start:
572 /* Set thread priority to MEDIUM */ 572 /* Set thread priority to MEDIUM */
573 HMT_MEDIUM 573 HMT_MEDIUM
574 574
575 /* Do early setup for that CPU (stab, slb, hash table pointer) */
576 bl .early_setup_secondary
577
578 /* Initialize the kernel stack. Just a repeat for iSeries. */ 575 /* Initialize the kernel stack. Just a repeat for iSeries. */
579 LOAD_REG_ADDR(r3, current_set) 576 LOAD_REG_ADDR(r3, current_set)
580 sldi r28,r24,3 /* get current_set[cpu#] */ 577 sldi r28,r24,3 /* get current_set[cpu#] */
581 ldx r1,r3,r28 578 ldx r14,r3,r28
582 addi r1,r1,THREAD_SIZE-STACK_FRAME_OVERHEAD 579 addi r14,r14,THREAD_SIZE-STACK_FRAME_OVERHEAD
583 std r1,PACAKSAVE(r13) 580 std r14,PACAKSAVE(r13)
581
582 /* Do early setup for that CPU (stab, slb, hash table pointer) */
583 bl .early_setup_secondary
584
585 /*
586 * setup the new stack pointer, but *don't* use this until
587 * translation is on.
588 */
589 mr r1, r14
584 590
585 /* Clear backchain so we get nice backtraces */ 591 /* Clear backchain so we get nice backtraces */
586 li r7,0 592 li r7,0
diff --git a/arch/powerpc/kernel/idle.c b/arch/powerpc/kernel/idle.c
index 049dda60e475..39a2baa6ad58 100644
--- a/arch/powerpc/kernel/idle.c
+++ b/arch/powerpc/kernel/idle.c
@@ -94,9 +94,9 @@ void cpu_idle(void)
94 HMT_medium(); 94 HMT_medium();
95 ppc64_runlatch_on(); 95 ppc64_runlatch_on();
96 tick_nohz_restart_sched_tick(); 96 tick_nohz_restart_sched_tick();
97 preempt_enable_no_resched();
97 if (cpu_should_die()) 98 if (cpu_should_die())
98 cpu_die(); 99 cpu_die();
99 preempt_enable_no_resched();
100 schedule(); 100 schedule();
101 preempt_disable(); 101 preempt_disable();
102 } 102 }
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index d3ce67cf03be..4a65386995d7 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -67,6 +67,7 @@
67#include <asm/machdep.h> 67#include <asm/machdep.h>
68#include <asm/udbg.h> 68#include <asm/udbg.h>
69#include <asm/dbell.h> 69#include <asm/dbell.h>
70#include <asm/smp.h>
70 71
71#ifdef CONFIG_PPC64 72#ifdef CONFIG_PPC64
72#include <asm/paca.h> 73#include <asm/paca.h>
@@ -446,22 +447,23 @@ struct thread_info *mcheckirq_ctx[NR_CPUS] __read_mostly;
446void exc_lvl_ctx_init(void) 447void exc_lvl_ctx_init(void)
447{ 448{
448 struct thread_info *tp; 449 struct thread_info *tp;
449 int i; 450 int i, hw_cpu;
450 451
451 for_each_possible_cpu(i) { 452 for_each_possible_cpu(i) {
452 memset((void *)critirq_ctx[i], 0, THREAD_SIZE); 453 hw_cpu = get_hard_smp_processor_id(i);
453 tp = critirq_ctx[i]; 454 memset((void *)critirq_ctx[hw_cpu], 0, THREAD_SIZE);
455 tp = critirq_ctx[hw_cpu];
454 tp->cpu = i; 456 tp->cpu = i;
455 tp->preempt_count = 0; 457 tp->preempt_count = 0;
456 458
457#ifdef CONFIG_BOOKE 459#ifdef CONFIG_BOOKE
458 memset((void *)dbgirq_ctx[i], 0, THREAD_SIZE); 460 memset((void *)dbgirq_ctx[hw_cpu], 0, THREAD_SIZE);
459 tp = dbgirq_ctx[i]; 461 tp = dbgirq_ctx[hw_cpu];
460 tp->cpu = i; 462 tp->cpu = i;
461 tp->preempt_count = 0; 463 tp->preempt_count = 0;
462 464
463 memset((void *)mcheckirq_ctx[i], 0, THREAD_SIZE); 465 memset((void *)mcheckirq_ctx[hw_cpu], 0, THREAD_SIZE);
464 tp = mcheckirq_ctx[i]; 466 tp = mcheckirq_ctx[hw_cpu];
465 tp->cpu = i; 467 tp->cpu = i;
466 tp->preempt_count = HARDIRQ_OFFSET; 468 tp->preempt_count = HARDIRQ_OFFSET;
467#endif 469#endif
diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S
index 6bbd7a604d24..a7a570dcdd57 100644
--- a/arch/powerpc/kernel/misc_32.S
+++ b/arch/powerpc/kernel/misc_32.S
@@ -810,6 +810,9 @@ relocate_new_kernel:
810 isync 810 isync
811 sync 811 sync
812 812
813 mfspr r3, SPRN_PIR /* current core we are running on */
814 mr r4, r5 /* load physical address of chunk called */
815
813 /* jump to the entry point, usually the setup routine */ 816 /* jump to the entry point, usually the setup routine */
814 mtlr r5 817 mtlr r5
815 blrl 818 blrl
diff --git a/arch/powerpc/kernel/module.c b/arch/powerpc/kernel/module.c
index 477c663e0140..49cee9df225b 100644
--- a/arch/powerpc/kernel/module.c
+++ b/arch/powerpc/kernel/module.c
@@ -63,11 +63,6 @@ int module_finalize(const Elf_Ehdr *hdr,
63 const Elf_Shdr *sechdrs, struct module *me) 63 const Elf_Shdr *sechdrs, struct module *me)
64{ 64{
65 const Elf_Shdr *sect; 65 const Elf_Shdr *sect;
66 int err;
67
68 err = module_bug_finalize(hdr, sechdrs, me);
69 if (err)
70 return err;
71 66
72 /* Apply feature fixups */ 67 /* Apply feature fixups */
73 sect = find_section(hdr, sechdrs, "__ftr_fixup"); 68 sect = find_section(hdr, sechdrs, "__ftr_fixup");
@@ -101,5 +96,4 @@ int module_finalize(const Elf_Ehdr *hdr,
101 96
102void module_arch_cleanup(struct module *mod) 97void module_arch_cleanup(struct module *mod)
103{ 98{
104 module_bug_cleanup(mod);
105} 99}
diff --git a/arch/powerpc/kernel/pci_of_scan.c b/arch/powerpc/kernel/pci_of_scan.c
index 6ddb795f83e8..e751506323b4 100644
--- a/arch/powerpc/kernel/pci_of_scan.c
+++ b/arch/powerpc/kernel/pci_of_scan.c
@@ -336,7 +336,7 @@ static void __devinit __of_scan_bus(struct device_node *node,
336 if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE || 336 if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
337 dev->hdr_type == PCI_HEADER_TYPE_CARDBUS) { 337 dev->hdr_type == PCI_HEADER_TYPE_CARDBUS) {
338 struct device_node *child = pci_device_to_OF_node(dev); 338 struct device_node *child = pci_device_to_OF_node(dev);
339 if (dev) 339 if (child)
340 of_scan_pci_bridge(child, dev); 340 of_scan_pci_bridge(child, dev);
341 } 341 }
342 } 342 }
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index feacfb789686..b1c648a36b03 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -728,7 +728,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
728 p->thread.regs = childregs; 728 p->thread.regs = childregs;
729 if (clone_flags & CLONE_SETTLS) { 729 if (clone_flags & CLONE_SETTLS) {
730#ifdef CONFIG_PPC64 730#ifdef CONFIG_PPC64
731 if (!test_thread_flag(TIF_32BIT)) 731 if (!is_32bit_task())
732 childregs->gpr[13] = childregs->gpr[6]; 732 childregs->gpr[13] = childregs->gpr[6];
733 else 733 else
734#endif 734#endif
@@ -823,7 +823,7 @@ void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp)
823 regs->nip = start; 823 regs->nip = start;
824 regs->msr = MSR_USER; 824 regs->msr = MSR_USER;
825#else 825#else
826 if (!test_thread_flag(TIF_32BIT)) { 826 if (!is_32bit_task()) {
827 unsigned long entry, toc; 827 unsigned long entry, toc;
828 828
829 /* start is a relocated pointer to the function descriptor for 829 /* start is a relocated pointer to the function descriptor for
@@ -995,7 +995,7 @@ int sys_clone(unsigned long clone_flags, unsigned long usp,
995 if (usp == 0) 995 if (usp == 0)
996 usp = regs->gpr[1]; /* stack pointer for child */ 996 usp = regs->gpr[1]; /* stack pointer for child */
997#ifdef CONFIG_PPC64 997#ifdef CONFIG_PPC64
998 if (test_thread_flag(TIF_32BIT)) { 998 if (is_32bit_task()) {
999 parent_tidp = TRUNC_PTR(parent_tidp); 999 parent_tidp = TRUNC_PTR(parent_tidp);
1000 child_tidp = TRUNC_PTR(child_tidp); 1000 child_tidp = TRUNC_PTR(child_tidp);
1001 } 1001 }
@@ -1034,8 +1034,9 @@ int sys_execve(unsigned long a0, unsigned long a1, unsigned long a2,
1034 flush_fp_to_thread(current); 1034 flush_fp_to_thread(current);
1035 flush_altivec_to_thread(current); 1035 flush_altivec_to_thread(current);
1036 flush_spe_to_thread(current); 1036 flush_spe_to_thread(current);
1037 error = do_execve(filename, (char __user * __user *) a1, 1037 error = do_execve(filename,
1038 (char __user * __user *) a2, regs); 1038 (const char __user *const __user *) a1,
1039 (const char __user *const __user *) a2, regs);
1039 putname(filename); 1040 putname(filename);
1040out: 1041out:
1041 return error; 1042 return error;
@@ -1198,19 +1199,17 @@ void ppc64_runlatch_on(void)
1198 } 1199 }
1199} 1200}
1200 1201
1201void ppc64_runlatch_off(void) 1202void __ppc64_runlatch_off(void)
1202{ 1203{
1203 unsigned long ctrl; 1204 unsigned long ctrl;
1204 1205
1205 if (cpu_has_feature(CPU_FTR_CTRL) && test_thread_flag(TIF_RUNLATCH)) { 1206 HMT_medium();
1206 HMT_medium();
1207 1207
1208 clear_thread_flag(TIF_RUNLATCH); 1208 clear_thread_flag(TIF_RUNLATCH);
1209 1209
1210 ctrl = mfspr(SPRN_CTRLF); 1210 ctrl = mfspr(SPRN_CTRLF);
1211 ctrl &= ~CTRL_RUNLATCH; 1211 ctrl &= ~CTRL_RUNLATCH;
1212 mtspr(SPRN_CTRLT, ctrl); 1212 mtspr(SPRN_CTRLT, ctrl);
1213 }
1214} 1213}
1215#endif 1214#endif
1216 1215
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index a10ffc85ada7..93666f9cabf1 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -258,17 +258,18 @@ static void __init irqstack_early_init(void)
258#if defined(CONFIG_BOOKE) || defined(CONFIG_40x) 258#if defined(CONFIG_BOOKE) || defined(CONFIG_40x)
259static void __init exc_lvl_early_init(void) 259static void __init exc_lvl_early_init(void)
260{ 260{
261 unsigned int i; 261 unsigned int i, hw_cpu;
262 262
263 /* interrupt stacks must be in lowmem, we get that for free on ppc32 263 /* interrupt stacks must be in lowmem, we get that for free on ppc32
264 * as the memblock is limited to lowmem by MEMBLOCK_REAL_LIMIT */ 264 * as the memblock is limited to lowmem by MEMBLOCK_REAL_LIMIT */
265 for_each_possible_cpu(i) { 265 for_each_possible_cpu(i) {
266 critirq_ctx[i] = (struct thread_info *) 266 hw_cpu = get_hard_smp_processor_id(i);
267 critirq_ctx[hw_cpu] = (struct thread_info *)
267 __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE)); 268 __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
268#ifdef CONFIG_BOOKE 269#ifdef CONFIG_BOOKE
269 dbgirq_ctx[i] = (struct thread_info *) 270 dbgirq_ctx[hw_cpu] = (struct thread_info *)
270 __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE)); 271 __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
271 mcheckirq_ctx[i] = (struct thread_info *) 272 mcheckirq_ctx[hw_cpu] = (struct thread_info *)
272 __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE)); 273 __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
273#endif 274#endif
274 } 275 }
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 1bee4b68fa45..e72690ec9b87 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -95,7 +95,7 @@ int ucache_bsize;
95 95
96#ifdef CONFIG_SMP 96#ifdef CONFIG_SMP
97 97
98static int smt_enabled_cmdline; 98static char *smt_enabled_cmdline;
99 99
100/* Look for ibm,smt-enabled OF option */ 100/* Look for ibm,smt-enabled OF option */
101static void check_smt_enabled(void) 101static void check_smt_enabled(void)
@@ -103,37 +103,46 @@ static void check_smt_enabled(void)
103 struct device_node *dn; 103 struct device_node *dn;
104 const char *smt_option; 104 const char *smt_option;
105 105
106 /* Allow the command line to overrule the OF option */ 106 /* Default to enabling all threads */
107 if (smt_enabled_cmdline) 107 smt_enabled_at_boot = threads_per_core;
108 return;
109
110 dn = of_find_node_by_path("/options");
111
112 if (dn) {
113 smt_option = of_get_property(dn, "ibm,smt-enabled", NULL);
114 108
115 if (smt_option) { 109 /* Allow the command line to overrule the OF option */
116 if (!strcmp(smt_option, "on")) 110 if (smt_enabled_cmdline) {
117 smt_enabled_at_boot = 1; 111 if (!strcmp(smt_enabled_cmdline, "on"))
118 else if (!strcmp(smt_option, "off")) 112 smt_enabled_at_boot = threads_per_core;
119 smt_enabled_at_boot = 0; 113 else if (!strcmp(smt_enabled_cmdline, "off"))
120 } 114 smt_enabled_at_boot = 0;
121 } 115 else {
116 long smt;
117 int rc;
118
119 rc = strict_strtol(smt_enabled_cmdline, 10, &smt);
120 if (!rc)
121 smt_enabled_at_boot =
122 min(threads_per_core, (int)smt);
123 }
124 } else {
125 dn = of_find_node_by_path("/options");
126 if (dn) {
127 smt_option = of_get_property(dn, "ibm,smt-enabled",
128 NULL);
129
130 if (smt_option) {
131 if (!strcmp(smt_option, "on"))
132 smt_enabled_at_boot = threads_per_core;
133 else if (!strcmp(smt_option, "off"))
134 smt_enabled_at_boot = 0;
135 }
136
137 of_node_put(dn);
138 }
139 }
122} 140}
123 141
124/* Look for smt-enabled= cmdline option */ 142/* Look for smt-enabled= cmdline option */
125static int __init early_smt_enabled(char *p) 143static int __init early_smt_enabled(char *p)
126{ 144{
127 smt_enabled_cmdline = 1; 145 smt_enabled_cmdline = p;
128
129 if (!p)
130 return 0;
131
132 if (!strcmp(p, "on") || !strcmp(p, "1"))
133 smt_enabled_at_boot = 1;
134 else if (!strcmp(p, "off") || !strcmp(p, "0"))
135 smt_enabled_at_boot = 0;
136
137 return 0; 146 return 0;
138} 147}
139early_param("smt-enabled", early_smt_enabled); 148early_param("smt-enabled", early_smt_enabled);
@@ -380,8 +389,8 @@ void __init setup_system(void)
380 */ 389 */
381 xmon_setup(); 390 xmon_setup();
382 391
383 check_smt_enabled();
384 smp_setup_cpu_maps(); 392 smp_setup_cpu_maps();
393 check_smt_enabled();
385 394
386#ifdef CONFIG_SMP 395#ifdef CONFIG_SMP
387 /* Release secondary cpus out of their spinloops at 0x60 now that 396 /* Release secondary cpus out of their spinloops at 0x60 now that
diff --git a/arch/powerpc/kernel/signal.c b/arch/powerpc/kernel/signal.c
index 7109f5b1baa8..2300426e531a 100644
--- a/arch/powerpc/kernel/signal.c
+++ b/arch/powerpc/kernel/signal.c
@@ -138,6 +138,7 @@ static int do_signal_pending(sigset_t *oldset, struct pt_regs *regs)
138 ti->local_flags &= ~_TLF_RESTORE_SIGMASK; 138 ti->local_flags &= ~_TLF_RESTORE_SIGMASK;
139 sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL); 139 sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL);
140 } 140 }
141 regs->trap = 0;
141 return 0; /* no signals delivered */ 142 return 0; /* no signals delivered */
142 } 143 }
143 144
@@ -164,6 +165,7 @@ static int do_signal_pending(sigset_t *oldset, struct pt_regs *regs)
164 ret = handle_rt_signal64(signr, &ka, &info, oldset, regs); 165 ret = handle_rt_signal64(signr, &ka, &info, oldset, regs);
165 } 166 }
166 167
168 regs->trap = 0;
167 if (ret) { 169 if (ret) {
168 spin_lock_irq(&current->sighand->siglock); 170 spin_lock_irq(&current->sighand->siglock);
169 sigorsets(&current->blocked, &current->blocked, 171 sigorsets(&current->blocked, &current->blocked,
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
index 266610119f66..b96a3a010c26 100644
--- a/arch/powerpc/kernel/signal_32.c
+++ b/arch/powerpc/kernel/signal_32.c
@@ -511,6 +511,7 @@ static long restore_user_regs(struct pt_regs *regs,
511 if (!sig) 511 if (!sig)
512 save_r2 = (unsigned int)regs->gpr[2]; 512 save_r2 = (unsigned int)regs->gpr[2];
513 err = restore_general_regs(regs, sr); 513 err = restore_general_regs(regs, sr);
514 regs->trap = 0;
514 err |= __get_user(msr, &sr->mc_gregs[PT_MSR]); 515 err |= __get_user(msr, &sr->mc_gregs[PT_MSR]);
515 if (!sig) 516 if (!sig)
516 regs->gpr[2] = (unsigned long) save_r2; 517 regs->gpr[2] = (unsigned long) save_r2;
@@ -884,7 +885,6 @@ int handle_rt_signal32(unsigned long sig, struct k_sigaction *ka,
884 regs->nip = (unsigned long) ka->sa.sa_handler; 885 regs->nip = (unsigned long) ka->sa.sa_handler;
885 /* enter the signal handler in big-endian mode */ 886 /* enter the signal handler in big-endian mode */
886 regs->msr &= ~MSR_LE; 887 regs->msr &= ~MSR_LE;
887 regs->trap = 0;
888 return 1; 888 return 1;
889 889
890badframe: 890badframe:
@@ -1228,7 +1228,6 @@ int handle_signal32(unsigned long sig, struct k_sigaction *ka,
1228 regs->nip = (unsigned long) ka->sa.sa_handler; 1228 regs->nip = (unsigned long) ka->sa.sa_handler;
1229 /* enter the signal handler in big-endian mode */ 1229 /* enter the signal handler in big-endian mode */
1230 regs->msr &= ~MSR_LE; 1230 regs->msr &= ~MSR_LE;
1231 regs->trap = 0;
1232 1231
1233 return 1; 1232 return 1;
1234 1233
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c
index 2fe6fc64b614..27c4a4584f80 100644
--- a/arch/powerpc/kernel/signal_64.c
+++ b/arch/powerpc/kernel/signal_64.c
@@ -178,7 +178,7 @@ static long restore_sigcontext(struct pt_regs *regs, sigset_t *set, int sig,
178 err |= __get_user(regs->xer, &sc->gp_regs[PT_XER]); 178 err |= __get_user(regs->xer, &sc->gp_regs[PT_XER]);
179 err |= __get_user(regs->ccr, &sc->gp_regs[PT_CCR]); 179 err |= __get_user(regs->ccr, &sc->gp_regs[PT_CCR]);
180 /* skip SOFTE */ 180 /* skip SOFTE */
181 err |= __get_user(regs->trap, &sc->gp_regs[PT_TRAP]); 181 regs->trap = 0;
182 err |= __get_user(regs->dar, &sc->gp_regs[PT_DAR]); 182 err |= __get_user(regs->dar, &sc->gp_regs[PT_DAR]);
183 err |= __get_user(regs->dsisr, &sc->gp_regs[PT_DSISR]); 183 err |= __get_user(regs->dsisr, &sc->gp_regs[PT_DSISR]);
184 err |= __get_user(regs->result, &sc->gp_regs[PT_RESULT]); 184 err |= __get_user(regs->result, &sc->gp_regs[PT_RESULT]);
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index a61b3ddd7bb3..0008bc58e826 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -427,11 +427,11 @@ int __cpuinit __cpu_up(unsigned int cpu)
427#endif 427#endif
428 428
429 if (!cpu_callin_map[cpu]) { 429 if (!cpu_callin_map[cpu]) {
430 printk("Processor %u is stuck.\n", cpu); 430 printk(KERN_ERR "Processor %u is stuck.\n", cpu);
431 return -ENOENT; 431 return -ENOENT;
432 } 432 }
433 433
434 printk("Processor %u found.\n", cpu); 434 DBG("Processor %u found.\n", cpu);
435 435
436 if (smp_ops->give_timebase) 436 if (smp_ops->give_timebase)
437 smp_ops->give_timebase(); 437 smp_ops->give_timebase();
diff --git a/arch/powerpc/kernel/sys_ppc32.c b/arch/powerpc/kernel/sys_ppc32.c
index 20fd701a686a..b1b6043a56c4 100644
--- a/arch/powerpc/kernel/sys_ppc32.c
+++ b/arch/powerpc/kernel/sys_ppc32.c
@@ -616,3 +616,11 @@ asmlinkage long compat_sys_sync_file_range2(int fd, unsigned int flags,
616 616
617 return sys_sync_file_range(fd, offset, nbytes, flags); 617 return sys_sync_file_range(fd, offset, nbytes, flags);
618} 618}
619
620asmlinkage long compat_sys_fanotify_mark(int fanotify_fd, unsigned int flags,
621 unsigned mask_hi, unsigned mask_lo,
622 int dfd, const char __user *pathname)
623{
624 u64 mask = ((u64)mask_hi << 32) | mask_lo;
625 return sys_fanotify_mark(fanotify_fd, flags, mask, dfd, pathname);
626}
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index ce53dfa7130d..8533b3b83f5d 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -577,20 +577,11 @@ void timer_interrupt(struct pt_regs * regs)
577 * some CPUs will continuue to take decrementer exceptions */ 577 * some CPUs will continuue to take decrementer exceptions */
578 set_dec(DECREMENTER_MAX); 578 set_dec(DECREMENTER_MAX);
579 579
580#ifdef CONFIG_PPC32 580#if defined(CONFIG_PPC32) && defined(CONFIG_PMAC)
581 if (atomic_read(&ppc_n_lost_interrupts) != 0) 581 if (atomic_read(&ppc_n_lost_interrupts) != 0)
582 do_IRQ(regs); 582 do_IRQ(regs);
583#endif 583#endif
584 584
585 now = get_tb_or_rtc();
586 if (now < decrementer->next_tb) {
587 /* not time for this event yet */
588 now = decrementer->next_tb - now;
589 if (now <= DECREMENTER_MAX)
590 set_dec((int)now);
591 trace_timer_interrupt_exit(regs);
592 return;
593 }
594 old_regs = set_irq_regs(regs); 585 old_regs = set_irq_regs(regs);
595 irq_enter(); 586 irq_enter();
596 587
@@ -606,8 +597,16 @@ void timer_interrupt(struct pt_regs * regs)
606 get_lppaca()->int_dword.fields.decr_int = 0; 597 get_lppaca()->int_dword.fields.decr_int = 0;
607#endif 598#endif
608 599
609 if (evt->event_handler) 600 now = get_tb_or_rtc();
610 evt->event_handler(evt); 601 if (now >= decrementer->next_tb) {
602 decrementer->next_tb = ~(u64)0;
603 if (evt->event_handler)
604 evt->event_handler(evt);
605 } else {
606 now = decrementer->next_tb - now;
607 if (now <= DECREMENTER_MAX)
608 set_dec((int)now);
609 }
611 610
612#ifdef CONFIG_PPC_ISERIES 611#ifdef CONFIG_PPC_ISERIES
613 if (firmware_has_feature(FW_FEATURE_ISERIES) && hvlpevent_is_pending()) 612 if (firmware_has_feature(FW_FEATURE_ISERIES) && hvlpevent_is_pending())
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index 00b9436f7652..fa3469ddaef8 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -1059,7 +1059,7 @@ static struct iommu_table *vio_build_iommu_table(struct vio_dev *dev)
1059 if (!dma_window) 1059 if (!dma_window)
1060 return NULL; 1060 return NULL;
1061 1061
1062 tbl = kmalloc(sizeof(*tbl), GFP_KERNEL); 1062 tbl = kzalloc(sizeof(*tbl), GFP_KERNEL);
1063 if (tbl == NULL) 1063 if (tbl == NULL)
1064 return NULL; 1064 return NULL;
1065 1065
@@ -1072,6 +1072,7 @@ static struct iommu_table *vio_build_iommu_table(struct vio_dev *dev)
1072 tbl->it_offset = offset >> IOMMU_PAGE_SHIFT; 1072 tbl->it_offset = offset >> IOMMU_PAGE_SHIFT;
1073 tbl->it_busno = 0; 1073 tbl->it_busno = 0;
1074 tbl->it_type = TCE_VB; 1074 tbl->it_type = TCE_VB;
1075 tbl->it_blocksize = 16;
1075 1076
1076 return iommu_init_table(tbl, -1); 1077 return iommu_init_table(tbl, -1);
1077} 1078}
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
index 71f1415e2472..ace85fa74b29 100644
--- a/arch/powerpc/mm/init_64.c
+++ b/arch/powerpc/mm/init_64.c
@@ -79,7 +79,9 @@
79#endif /* CONFIG_PPC_STD_MMU_64 */ 79#endif /* CONFIG_PPC_STD_MMU_64 */
80 80
81phys_addr_t memstart_addr = ~0; 81phys_addr_t memstart_addr = ~0;
82EXPORT_SYMBOL_GPL(memstart_addr);
82phys_addr_t kernstart_addr; 83phys_addr_t kernstart_addr;
84EXPORT_SYMBOL_GPL(kernstart_addr);
83 85
84void free_initmem(void) 86void free_initmem(void)
85{ 87{
diff --git a/arch/powerpc/mm/tlb_nohash_low.S b/arch/powerpc/mm/tlb_nohash_low.S
index cfa768203d08..b9d9fed8f36e 100644
--- a/arch/powerpc/mm/tlb_nohash_low.S
+++ b/arch/powerpc/mm/tlb_nohash_low.S
@@ -200,6 +200,7 @@ _GLOBAL(_tlbivax_bcast)
200 rlwimi r5,r4,0,16,31 200 rlwimi r5,r4,0,16,31
201 wrteei 0 201 wrteei 0
202 mtspr SPRN_MMUCR,r5 202 mtspr SPRN_MMUCR,r5
203 isync
203/* tlbivax 0,r3 - use .long to avoid binutils deps */ 204/* tlbivax 0,r3 - use .long to avoid binutils deps */
204 .long 0x7c000624 | (r3 << 11) 205 .long 0x7c000624 | (r3 << 11)
205 isync 206 isync
diff --git a/arch/powerpc/platforms/512x/clock.c b/arch/powerpc/platforms/512x/clock.c
index 5b243bd3eb3b..3dc2a8d262b8 100644
--- a/arch/powerpc/platforms/512x/clock.c
+++ b/arch/powerpc/platforms/512x/clock.c
@@ -57,7 +57,7 @@ static struct clk *mpc5121_clk_get(struct device *dev, const char *id)
57 int id_match = 0; 57 int id_match = 0;
58 58
59 if (dev == NULL || id == NULL) 59 if (dev == NULL || id == NULL)
60 return NULL; 60 return clk;
61 61
62 mutex_lock(&clocks_mutex); 62 mutex_lock(&clocks_mutex);
63 list_for_each_entry(p, &clocks, node) { 63 list_for_each_entry(p, &clocks, node) {
diff --git a/arch/powerpc/platforms/52xx/efika.c b/arch/powerpc/platforms/52xx/efika.c
index 45c0cb9b67e6..18c104820198 100644
--- a/arch/powerpc/platforms/52xx/efika.c
+++ b/arch/powerpc/platforms/52xx/efika.c
@@ -99,7 +99,7 @@ static void __init efika_pcisetup(void)
99 if (bus_range == NULL || len < 2 * sizeof(int)) { 99 if (bus_range == NULL || len < 2 * sizeof(int)) {
100 printk(KERN_WARNING EFIKA_PLATFORM_NAME 100 printk(KERN_WARNING EFIKA_PLATFORM_NAME
101 ": Can't get bus-range for %s\n", pcictrl->full_name); 101 ": Can't get bus-range for %s\n", pcictrl->full_name);
102 return; 102 goto out_put;
103 } 103 }
104 104
105 if (bus_range[1] == bus_range[0]) 105 if (bus_range[1] == bus_range[0])
@@ -111,12 +111,12 @@ static void __init efika_pcisetup(void)
111 printk(" controlled by %s\n", pcictrl->full_name); 111 printk(" controlled by %s\n", pcictrl->full_name);
112 printk("\n"); 112 printk("\n");
113 113
114 hose = pcibios_alloc_controller(of_node_get(pcictrl)); 114 hose = pcibios_alloc_controller(pcictrl);
115 if (!hose) { 115 if (!hose) {
116 printk(KERN_WARNING EFIKA_PLATFORM_NAME 116 printk(KERN_WARNING EFIKA_PLATFORM_NAME
117 ": Can't allocate PCI controller structure for %s\n", 117 ": Can't allocate PCI controller structure for %s\n",
118 pcictrl->full_name); 118 pcictrl->full_name);
119 return; 119 goto out_put;
120 } 120 }
121 121
122 hose->first_busno = bus_range[0]; 122 hose->first_busno = bus_range[0];
@@ -124,6 +124,9 @@ static void __init efika_pcisetup(void)
124 hose->ops = &rtas_pci_ops; 124 hose->ops = &rtas_pci_ops;
125 125
126 pci_process_bridge_OF_ranges(hose, pcictrl, 0); 126 pci_process_bridge_OF_ranges(hose, pcictrl, 0);
127 return;
128out_put:
129 of_node_put(pcictrl);
127} 130}
128 131
129#else 132#else
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_common.c b/arch/powerpc/platforms/52xx/mpc52xx_common.c
index 6e905314ad5d..41f3a7eda1de 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_common.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_common.c
@@ -325,12 +325,16 @@ int mpc5200_psc_ac97_gpio_reset(int psc_number)
325 clrbits32(&simple_gpio->simple_dvo, sync | out); 325 clrbits32(&simple_gpio->simple_dvo, sync | out);
326 clrbits8(&wkup_gpio->wkup_dvo, reset); 326 clrbits8(&wkup_gpio->wkup_dvo, reset);
327 327
328 /* wait at lease 1 us */ 328 /* wait for 1 us */
329 udelay(2); 329 udelay(1);
330 330
331 /* Deassert reset */ 331 /* Deassert reset */
332 setbits8(&wkup_gpio->wkup_dvo, reset); 332 setbits8(&wkup_gpio->wkup_dvo, reset);
333 333
334 /* wait at least 200ns */
335 /* 7 ~= (200ns * timebase) / ns2sec */
336 __delay(7);
337
334 /* Restore pin-muxing */ 338 /* Restore pin-muxing */
335 out_be32(&simple_gpio->port_config, mux); 339 out_be32(&simple_gpio->port_config, mux);
336 340
diff --git a/arch/powerpc/platforms/83xx/mpc837x_mds.c b/arch/powerpc/platforms/83xx/mpc837x_mds.c
index f9751c8905be..83068322abd1 100644
--- a/arch/powerpc/platforms/83xx/mpc837x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc837x_mds.c
@@ -48,8 +48,10 @@ static int mpc837xmds_usb_cfg(void)
48 return -1; 48 return -1;
49 49
50 np = of_find_node_by_name(NULL, "usb"); 50 np = of_find_node_by_name(NULL, "usb");
51 if (!np) 51 if (!np) {
52 return -ENODEV; 52 ret = -ENODEV;
53 goto out;
54 }
53 phy_type = of_get_property(np, "phy_type", NULL); 55 phy_type = of_get_property(np, "phy_type", NULL);
54 if (phy_type && !strcmp(phy_type, "ulpi")) { 56 if (phy_type && !strcmp(phy_type, "ulpi")) {
55 clrbits8(bcsr_regs + 12, BCSR12_USB_SER_PIN); 57 clrbits8(bcsr_regs + 12, BCSR12_USB_SER_PIN);
@@ -65,8 +67,9 @@ static int mpc837xmds_usb_cfg(void)
65 } 67 }
66 68
67 of_node_put(np); 69 of_node_put(np);
70out:
68 iounmap(bcsr_regs); 71 iounmap(bcsr_regs);
69 return 0; 72 return ret;
70} 73}
71 74
72/* ************************************************************************ 75/* ************************************************************************
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index da64be19d099..aa34cac4eb5c 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -357,6 +357,7 @@ static void __init mpc85xx_mds_setup_arch(void)
357{ 357{
358#ifdef CONFIG_PCI 358#ifdef CONFIG_PCI
359 struct pci_controller *hose; 359 struct pci_controller *hose;
360 struct device_node *np;
360#endif 361#endif
361 dma_addr_t max = 0xffffffff; 362 dma_addr_t max = 0xffffffff;
362 363
diff --git a/arch/powerpc/platforms/85xx/p1022_ds.c b/arch/powerpc/platforms/85xx/p1022_ds.c
index e984d4ea351a..e15afdf12343 100644
--- a/arch/powerpc/platforms/85xx/p1022_ds.c
+++ b/arch/powerpc/platforms/85xx/p1022_ds.c
@@ -18,7 +18,6 @@
18 18
19#include <linux/pci.h> 19#include <linux/pci.h>
20#include <linux/of_platform.h> 20#include <linux/of_platform.h>
21#include <linux/lmb.h>
22#include <linux/memblock.h> 21#include <linux/memblock.h>
23#include <asm/div64.h> 22#include <asm/div64.h>
24#include <asm/mpic.h> 23#include <asm/mpic.h>
@@ -305,7 +304,7 @@ static void __init p1022_ds_setup_arch(void)
305#endif 304#endif
306 305
307#ifdef CONFIG_SWIOTLB 306#ifdef CONFIG_SWIOTLB
308 if (lmb_end_of_DRAM() > max) { 307 if (memblock_end_of_DRAM() > max) {
309 ppc_swiotlb_enable = 1; 308 ppc_swiotlb_enable = 1;
310 set_pci_dma_ops(&swiotlb_dma_ops); 309 set_pci_dma_ops(&swiotlb_dma_ops);
311 ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb; 310 ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
index d1663db7810f..81c9208025fa 100644
--- a/arch/powerpc/platforms/Kconfig
+++ b/arch/powerpc/platforms/Kconfig
@@ -106,8 +106,7 @@ config MMIO_NVRAM
106 106
107config MPIC_U3_HT_IRQS 107config MPIC_U3_HT_IRQS
108 bool 108 bool
109 depends on PPC_MAPLE 109 default n
110 default y
111 110
112config MPIC_BROKEN_REGREAD 111config MPIC_BROKEN_REGREAD
113 bool 112 bool
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
index 58b13ce3847e..26a067122a54 100644
--- a/arch/powerpc/platforms/cell/iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
@@ -477,7 +477,7 @@ cell_iommu_setup_window(struct cbe_iommu *iommu, struct device_node *np,
477 477
478 ioid = cell_iommu_get_ioid(np); 478 ioid = cell_iommu_get_ioid(np);
479 479
480 window = kmalloc_node(sizeof(*window), GFP_KERNEL, iommu->nid); 480 window = kzalloc_node(sizeof(*window), GFP_KERNEL, iommu->nid);
481 BUG_ON(window == NULL); 481 BUG_ON(window == NULL);
482 482
483 window->offset = offset; 483 window->offset = offset;
diff --git a/arch/powerpc/platforms/iseries/iommu.c b/arch/powerpc/platforms/iseries/iommu.c
index ce61cea0afb5..d8b76335bd13 100644
--- a/arch/powerpc/platforms/iseries/iommu.c
+++ b/arch/powerpc/platforms/iseries/iommu.c
@@ -184,7 +184,7 @@ static void pci_dma_dev_setup_iseries(struct pci_dev *pdev)
184 184
185 BUG_ON(lsn == NULL); 185 BUG_ON(lsn == NULL);
186 186
187 tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL); 187 tbl = kzalloc(sizeof(struct iommu_table), GFP_KERNEL);
188 188
189 iommu_table_getparms_iSeries(pdn->busno, *lsn, 0, tbl); 189 iommu_table_getparms_iSeries(pdn->busno, *lsn, 0, tbl);
190 190
diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c
index 39df6ab1735a..df423993f175 100644
--- a/arch/powerpc/platforms/powermac/feature.c
+++ b/arch/powerpc/platforms/powermac/feature.c
@@ -2873,12 +2873,11 @@ set_initial_features(void)
2873 2873
2874 /* Switch airport off */ 2874 /* Switch airport off */
2875 for_each_node_by_name(np, "radio") { 2875 for_each_node_by_name(np, "radio") {
2876 if (np && np->parent == macio_chips[0].of_node) { 2876 if (np->parent == macio_chips[0].of_node) {
2877 macio_chips[0].flags |= MACIO_FLAG_AIRPORT_ON; 2877 macio_chips[0].flags |= MACIO_FLAG_AIRPORT_ON;
2878 core99_airport_enable(np, 0, 0); 2878 core99_airport_enable(np, 0, 0);
2879 } 2879 }
2880 } 2880 }
2881 of_node_put(np);
2882 } 2881 }
2883 2882
2884 /* On all machines that support sound PM, switch sound off */ 2883 /* On all machines that support sound PM, switch sound off */
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c
index ab2027cdf893..3bc075c788ef 100644
--- a/arch/powerpc/platforms/powermac/pci.c
+++ b/arch/powerpc/platforms/powermac/pci.c
@@ -1155,13 +1155,11 @@ void __init pmac_pcibios_after_init(void)
1155 pmac_call_feature(PMAC_FTR_1394_CABLE_POWER, nd, 0, 0); 1155 pmac_call_feature(PMAC_FTR_1394_CABLE_POWER, nd, 0, 0);
1156 } 1156 }
1157 } 1157 }
1158 of_node_put(nd);
1159 for_each_node_by_name(nd, "ethernet") { 1158 for_each_node_by_name(nd, "ethernet") {
1160 if (nd->parent && of_device_is_compatible(nd, "gmac") 1159 if (nd->parent && of_device_is_compatible(nd, "gmac")
1161 && of_device_is_compatible(nd->parent, "uni-north")) 1160 && of_device_is_compatible(nd->parent, "uni-north"))
1162 pmac_call_feature(PMAC_FTR_GMAC_ENABLE, nd, 0, 0); 1161 pmac_call_feature(PMAC_FTR_GMAC_ENABLE, nd, 0, 0);
1163 } 1162 }
1164 of_node_put(nd);
1165} 1163}
1166 1164
1167void pmac_pci_fixup_cardbus(struct pci_dev* dev) 1165void pmac_pci_fixup_cardbus(struct pci_dev* dev)
diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c
index 227c1c3d585e..72d8054fa739 100644
--- a/arch/powerpc/platforms/pseries/dlpar.c
+++ b/arch/powerpc/platforms/pseries/dlpar.c
@@ -129,20 +129,35 @@ struct device_node *dlpar_configure_connector(u32 drc_index)
129 struct property *property; 129 struct property *property;
130 struct property *last_property = NULL; 130 struct property *last_property = NULL;
131 struct cc_workarea *ccwa; 131 struct cc_workarea *ccwa;
132 char *data_buf;
132 int cc_token; 133 int cc_token;
133 int rc; 134 int rc = -1;
134 135
135 cc_token = rtas_token("ibm,configure-connector"); 136 cc_token = rtas_token("ibm,configure-connector");
136 if (cc_token == RTAS_UNKNOWN_SERVICE) 137 if (cc_token == RTAS_UNKNOWN_SERVICE)
137 return NULL; 138 return NULL;
138 139
139 spin_lock(&rtas_data_buf_lock); 140 data_buf = kzalloc(RTAS_DATA_BUF_SIZE, GFP_KERNEL);
140 ccwa = (struct cc_workarea *)&rtas_data_buf[0]; 141 if (!data_buf)
142 return NULL;
143
144 ccwa = (struct cc_workarea *)&data_buf[0];
141 ccwa->drc_index = drc_index; 145 ccwa->drc_index = drc_index;
142 ccwa->zero = 0; 146 ccwa->zero = 0;
143 147
144 rc = rtas_call(cc_token, 2, 1, NULL, rtas_data_buf, NULL); 148 do {
145 while (rc) { 149 /* Since we release the rtas_data_buf lock between configure
150 * connector calls we want to re-populate the rtas_data_buffer
151 * with the contents of the previous call.
152 */
153 spin_lock(&rtas_data_buf_lock);
154
155 memcpy(rtas_data_buf, data_buf, RTAS_DATA_BUF_SIZE);
156 rc = rtas_call(cc_token, 2, 1, NULL, rtas_data_buf, NULL);
157 memcpy(data_buf, rtas_data_buf, RTAS_DATA_BUF_SIZE);
158
159 spin_unlock(&rtas_data_buf_lock);
160
146 switch (rc) { 161 switch (rc) {
147 case NEXT_SIBLING: 162 case NEXT_SIBLING:
148 dn = dlpar_parse_cc_node(ccwa); 163 dn = dlpar_parse_cc_node(ccwa);
@@ -197,18 +212,19 @@ struct device_node *dlpar_configure_connector(u32 drc_index)
197 "returned from configure-connector\n", rc); 212 "returned from configure-connector\n", rc);
198 goto cc_error; 213 goto cc_error;
199 } 214 }
215 } while (rc);
200 216
201 rc = rtas_call(cc_token, 2, 1, NULL, rtas_data_buf, NULL); 217cc_error:
218 kfree(data_buf);
219
220 if (rc) {
221 if (first_dn)
222 dlpar_free_cc_nodes(first_dn);
223
224 return NULL;
202 } 225 }
203 226
204 spin_unlock(&rtas_data_buf_lock);
205 return first_dn; 227 return first_dn;
206
207cc_error:
208 if (first_dn)
209 dlpar_free_cc_nodes(first_dn);
210 spin_unlock(&rtas_data_buf_lock);
211 return NULL;
212} 228}
213 229
214static struct device_node *derive_parent(const char *path) 230static struct device_node *derive_parent(const char *path)
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index 395848e30c52..a77bcaed80af 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -403,7 +403,7 @@ static void pci_dma_bus_setup_pSeries(struct pci_bus *bus)
403 pci->phb->dma_window_size = 0x8000000ul; 403 pci->phb->dma_window_size = 0x8000000ul;
404 pci->phb->dma_window_base_cur = 0x8000000ul; 404 pci->phb->dma_window_base_cur = 0x8000000ul;
405 405
406 tbl = kmalloc_node(sizeof(struct iommu_table), GFP_KERNEL, 406 tbl = kzalloc_node(sizeof(struct iommu_table), GFP_KERNEL,
407 pci->phb->node); 407 pci->phb->node);
408 408
409 iommu_table_setparms(pci->phb, dn, tbl); 409 iommu_table_setparms(pci->phb, dn, tbl);
@@ -448,7 +448,7 @@ static void pci_dma_bus_setup_pSeriesLP(struct pci_bus *bus)
448 pdn->full_name, ppci->iommu_table); 448 pdn->full_name, ppci->iommu_table);
449 449
450 if (!ppci->iommu_table) { 450 if (!ppci->iommu_table) {
451 tbl = kmalloc_node(sizeof(struct iommu_table), GFP_KERNEL, 451 tbl = kzalloc_node(sizeof(struct iommu_table), GFP_KERNEL,
452 ppci->phb->node); 452 ppci->phb->node);
453 iommu_table_setparms_lpar(ppci->phb, pdn, tbl, dma_window, 453 iommu_table_setparms_lpar(ppci->phb, pdn, tbl, dma_window,
454 bus->number); 454 bus->number);
@@ -478,7 +478,7 @@ static void pci_dma_dev_setup_pSeries(struct pci_dev *dev)
478 struct pci_controller *phb = PCI_DN(dn)->phb; 478 struct pci_controller *phb = PCI_DN(dn)->phb;
479 479
480 pr_debug(" --> first child, no bridge. Allocating iommu table.\n"); 480 pr_debug(" --> first child, no bridge. Allocating iommu table.\n");
481 tbl = kmalloc_node(sizeof(struct iommu_table), GFP_KERNEL, 481 tbl = kzalloc_node(sizeof(struct iommu_table), GFP_KERNEL,
482 phb->node); 482 phb->node);
483 iommu_table_setparms(phb, dn, tbl); 483 iommu_table_setparms(phb, dn, tbl);
484 PCI_DN(dn)->iommu_table = iommu_init_table(tbl, phb->node); 484 PCI_DN(dn)->iommu_table = iommu_init_table(tbl, phb->node);
@@ -544,7 +544,7 @@ static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev)
544 544
545 pci = PCI_DN(pdn); 545 pci = PCI_DN(pdn);
546 if (!pci->iommu_table) { 546 if (!pci->iommu_table) {
547 tbl = kmalloc_node(sizeof(struct iommu_table), GFP_KERNEL, 547 tbl = kzalloc_node(sizeof(struct iommu_table), GFP_KERNEL,
548 pci->phb->node); 548 pci->phb->node);
549 iommu_table_setparms_lpar(pci->phb, pdn, tbl, dma_window, 549 iommu_table_setparms_lpar(pci->phb, pdn, tbl, dma_window,
550 pci->phb->bus->number); 550 pci->phb->bus->number);
diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c
index 3b1bf61c45be..0317cce877c6 100644
--- a/arch/powerpc/platforms/pseries/smp.c
+++ b/arch/powerpc/platforms/pseries/smp.c
@@ -182,10 +182,13 @@ static int smp_pSeries_cpu_bootable(unsigned int nr)
182 /* Special case - we inhibit secondary thread startup 182 /* Special case - we inhibit secondary thread startup
183 * during boot if the user requests it. 183 * during boot if the user requests it.
184 */ 184 */
185 if (system_state < SYSTEM_RUNNING && 185 if (system_state < SYSTEM_RUNNING && cpu_has_feature(CPU_FTR_SMT)) {
186 cpu_has_feature(CPU_FTR_SMT) && 186 if (!smt_enabled_at_boot && cpu_thread_in_core(nr) != 0)
187 !smt_enabled_at_boot && cpu_thread_in_core(nr) != 0) 187 return 0;
188 return 0; 188 if (smt_enabled_at_boot
189 && cpu_thread_in_core(nr) >= smt_enabled_at_boot)
190 return 0;
191 }
189 192
190 return 1; 193 return 1;
191} 194}
diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c
index 5b22b07c8f67..93834b0d8272 100644
--- a/arch/powerpc/platforms/pseries/xics.c
+++ b/arch/powerpc/platforms/pseries/xics.c
@@ -928,8 +928,10 @@ void xics_migrate_irqs_away(void)
928 if (xics_status[0] != hw_cpu) 928 if (xics_status[0] != hw_cpu)
929 goto unlock; 929 goto unlock;
930 930
931 printk(KERN_WARNING "IRQ %u affinity broken off cpu %u\n", 931 /* This is expected during cpu offline. */
932 virq, cpu); 932 if (cpu_online(cpu))
933 printk(KERN_WARNING "IRQ %u affinity broken off cpu %u\n",
934 virq, cpu);
933 935
934 /* Reset affinity to all cpus */ 936 /* Reset affinity to all cpus */
935 cpumask_setall(irq_to_desc(virq)->affinity); 937 cpumask_setall(irq_to_desc(virq)->affinity);
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 209384b6e039..4ae933225251 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -399,6 +399,8 @@ DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P1013E, quirk_fsl_pcie_header);
399DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P1013, quirk_fsl_pcie_header); 399DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P1013, quirk_fsl_pcie_header);
400DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P1020E, quirk_fsl_pcie_header); 400DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P1020E, quirk_fsl_pcie_header);
401DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P1020, quirk_fsl_pcie_header); 401DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P1020, quirk_fsl_pcie_header);
402DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P1021E, quirk_fsl_pcie_header);
403DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P1021, quirk_fsl_pcie_header);
402DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P1022E, quirk_fsl_pcie_header); 404DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P1022E, quirk_fsl_pcie_header);
403DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P1022, quirk_fsl_pcie_header); 405DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P1022, quirk_fsl_pcie_header);
404DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P2010E, quirk_fsl_pcie_header); 406DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P2010E, quirk_fsl_pcie_header);
diff --git a/arch/powerpc/sysdev/fsl_rio.c b/arch/powerpc/sysdev/fsl_rio.c
index 6425abe5b7db..3017532319c8 100644
--- a/arch/powerpc/sysdev/fsl_rio.c
+++ b/arch/powerpc/sysdev/fsl_rio.c
@@ -240,12 +240,13 @@ struct rio_priv {
240 240
241static void __iomem *rio_regs_win; 241static void __iomem *rio_regs_win;
242 242
243#ifdef CONFIG_E500
243static int (*saved_mcheck_exception)(struct pt_regs *regs); 244static int (*saved_mcheck_exception)(struct pt_regs *regs);
244 245
245static int fsl_rio_mcheck_exception(struct pt_regs *regs) 246static int fsl_rio_mcheck_exception(struct pt_regs *regs)
246{ 247{
247 const struct exception_table_entry *entry = NULL; 248 const struct exception_table_entry *entry = NULL;
248 unsigned long reason = (mfspr(SPRN_MCSR) & MCSR_MASK); 249 unsigned long reason = mfspr(SPRN_MCSR);
249 250
250 if (reason & MCSR_BUS_RBERR) { 251 if (reason & MCSR_BUS_RBERR) {
251 reason = in_be32((u32 *)(rio_regs_win + RIO_LTLEDCSR)); 252 reason = in_be32((u32 *)(rio_regs_win + RIO_LTLEDCSR));
@@ -269,6 +270,7 @@ static int fsl_rio_mcheck_exception(struct pt_regs *regs)
269 else 270 else
270 return cur_cpu_spec->machine_check(regs); 271 return cur_cpu_spec->machine_check(regs);
271} 272}
273#endif
272 274
273/** 275/**
274 * fsl_rio_doorbell_send - Send a MPC85xx doorbell message 276 * fsl_rio_doorbell_send - Send a MPC85xx doorbell message
@@ -1517,8 +1519,10 @@ int fsl_rio_setup(struct platform_device *dev)
1517 fsl_rio_doorbell_init(port); 1519 fsl_rio_doorbell_init(port);
1518 fsl_rio_port_write_init(port); 1520 fsl_rio_port_write_init(port);
1519 1521
1522#ifdef CONFIG_E500
1520 saved_mcheck_exception = ppc_md.machine_check_exception; 1523 saved_mcheck_exception = ppc_md.machine_check_exception;
1521 ppc_md.machine_check_exception = fsl_rio_mcheck_exception; 1524 ppc_md.machine_check_exception = fsl_rio_mcheck_exception;
1525#endif
1522 /* Ensure that RFXE is set */ 1526 /* Ensure that RFXE is set */
1523 mtspr(SPRN_HID1, (mfspr(SPRN_HID1) | 0x20000)); 1527 mtspr(SPRN_HID1, (mfspr(SPRN_HID1) | 0x20000));
1524 1528
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c
index 3da8014931c9..90020de4dcf2 100644
--- a/arch/powerpc/sysdev/qe_lib/qe.c
+++ b/arch/powerpc/sysdev/qe_lib/qe.c
@@ -640,6 +640,7 @@ unsigned int qe_get_num_of_snums(void)
640 if ((num_of_snums < 28) || (num_of_snums > QE_NUM_OF_SNUM)) { 640 if ((num_of_snums < 28) || (num_of_snums > QE_NUM_OF_SNUM)) {
641 /* No QE ever has fewer than 28 SNUMs */ 641 /* No QE ever has fewer than 28 SNUMs */
642 pr_err("QE: number of snum is invalid\n"); 642 pr_err("QE: number of snum is invalid\n");
643 of_node_put(qe);
643 return -EINVAL; 644 return -EINVAL;
644 } 645 }
645 } 646 }
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 0554445200bf..d17d04cfb2cd 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -2880,15 +2880,14 @@ static void xmon_init(int enable)
2880} 2880}
2881 2881
2882#ifdef CONFIG_MAGIC_SYSRQ 2882#ifdef CONFIG_MAGIC_SYSRQ
2883static void sysrq_handle_xmon(int key, struct tty_struct *tty) 2883static void sysrq_handle_xmon(int key)
2884{ 2884{
2885 /* ensure xmon is enabled */ 2885 /* ensure xmon is enabled */
2886 xmon_init(1); 2886 xmon_init(1);
2887 debugger(get_irq_regs()); 2887 debugger(get_irq_regs());
2888} 2888}
2889 2889
2890static struct sysrq_key_op sysrq_xmon_op = 2890static struct sysrq_key_op sysrq_xmon_op = {
2891{
2892 .handler = sysrq_handle_xmon, 2891 .handler = sysrq_handle_xmon,
2893 .help_msg = "Xmon", 2892 .help_msg = "Xmon",
2894 .action_msg = "Entering xmon", 2893 .action_msg = "Entering xmon",