aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r--arch/powerpc/platforms/512x/clock.c6
-rw-r--r--arch/powerpc/platforms/512x/mpc5121_ads.c3
-rw-r--r--arch/powerpc/platforms/512x/mpc5121_ads_cpld.c2
-rw-r--r--arch/powerpc/platforms/512x/mpc5121_generic.c3
-rw-r--r--arch/powerpc/platforms/512x/mpc512x.h3
-rw-r--r--arch/powerpc/platforms/512x/mpc512x_shared.c43
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_mds.c3
-rw-r--r--arch/powerpc/platforms/85xx/socrates_fpga_pic.c2
-rw-r--r--arch/powerpc/platforms/85xx/stx_gp3.c2
-rw-r--r--arch/powerpc/platforms/cell/beat_htab.c24
-rw-r--r--arch/powerpc/platforms/cell/beat_interrupt.c20
-rw-r--r--arch/powerpc/platforms/cell/interrupt.c4
-rw-r--r--arch/powerpc/platforms/cell/spider-pic.c2
-rw-r--r--arch/powerpc/platforms/iseries/irq.c2
-rw-r--r--arch/powerpc/platforms/iseries/proc.c2
-rw-r--r--arch/powerpc/platforms/iseries/setup.c2
-rw-r--r--arch/powerpc/platforms/powermac/bootx_init.c4
-rw-r--r--arch/powerpc/platforms/powermac/feature.c6
-rw-r--r--arch/powerpc/platforms/powermac/nvram.c14
-rw-r--r--arch/powerpc/platforms/powermac/pfunc_base.c24
-rw-r--r--arch/powerpc/platforms/powermac/pic.c40
-rw-r--r--arch/powerpc/platforms/pseries/eeh.c18
-rw-r--r--arch/powerpc/platforms/pseries/eeh_driver.c10
-rw-r--r--arch/powerpc/platforms/pseries/eeh_event.c2
-rw-r--r--arch/powerpc/platforms/pseries/hotplug-cpu.c22
-rw-r--r--arch/powerpc/platforms/pseries/hvCall_inst.c4
-rw-r--r--arch/powerpc/platforms/pseries/pci_dlpar.c2
-rw-r--r--arch/powerpc/platforms/pseries/phyp_dump.c6
-rw-r--r--arch/powerpc/platforms/pseries/smp.c4
-rw-r--r--arch/powerpc/platforms/pseries/xics.c32
30 files changed, 171 insertions, 140 deletions
diff --git a/arch/powerpc/platforms/512x/clock.c b/arch/powerpc/platforms/512x/clock.c
index 84544d072043..4c42246b86a7 100644
--- a/arch/powerpc/platforms/512x/clock.c
+++ b/arch/powerpc/platforms/512x/clock.c
@@ -698,8 +698,7 @@ static struct clk_interface mpc5121_clk_functions = {
698 .clk_get_parent = NULL, 698 .clk_get_parent = NULL,
699}; 699};
700 700
701static int 701int __init mpc5121_clk_init(void)
702mpc5121_clk_init(void)
703{ 702{
704 struct device_node *np; 703 struct device_node *np;
705 704
@@ -724,6 +723,3 @@ mpc5121_clk_init(void)
724 clk_functions = mpc5121_clk_functions; 723 clk_functions = mpc5121_clk_functions;
725 return 0; 724 return 0;
726} 725}
727
728
729arch_initcall(mpc5121_clk_init);
diff --git a/arch/powerpc/platforms/512x/mpc5121_ads.c b/arch/powerpc/platforms/512x/mpc5121_ads.c
index 441abc488851..ee6ae129c25c 100644
--- a/arch/powerpc/platforms/512x/mpc5121_ads.c
+++ b/arch/powerpc/platforms/512x/mpc5121_ads.c
@@ -64,8 +64,9 @@ define_machine(mpc5121_ads) {
64 .name = "MPC5121 ADS", 64 .name = "MPC5121 ADS",
65 .probe = mpc5121_ads_probe, 65 .probe = mpc5121_ads_probe,
66 .setup_arch = mpc5121_ads_setup_arch, 66 .setup_arch = mpc5121_ads_setup_arch,
67 .init = mpc512x_declare_of_platform_devices, 67 .init = mpc512x_init,
68 .init_IRQ = mpc5121_ads_init_IRQ, 68 .init_IRQ = mpc5121_ads_init_IRQ,
69 .get_irq = ipic_get_irq, 69 .get_irq = ipic_get_irq,
70 .calibrate_decr = generic_calibrate_decr, 70 .calibrate_decr = generic_calibrate_decr,
71 .restart = mpc512x_restart,
71}; 72};
diff --git a/arch/powerpc/platforms/512x/mpc5121_ads_cpld.c b/arch/powerpc/platforms/512x/mpc5121_ads_cpld.c
index da9b20a63769..4ecf4cf9a51b 100644
--- a/arch/powerpc/platforms/512x/mpc5121_ads_cpld.c
+++ b/arch/powerpc/platforms/512x/mpc5121_ads_cpld.c
@@ -79,7 +79,7 @@ cpld_unmask_irq(unsigned int irq)
79} 79}
80 80
81static struct irq_chip cpld_pic = { 81static struct irq_chip cpld_pic = {
82 .name = " CPLD PIC ", 82 .name = "CPLD PIC",
83 .mask = cpld_mask_irq, 83 .mask = cpld_mask_irq,
84 .ack = cpld_mask_irq, 84 .ack = cpld_mask_irq,
85 .unmask = cpld_unmask_irq, 85 .unmask = cpld_unmask_irq,
diff --git a/arch/powerpc/platforms/512x/mpc5121_generic.c b/arch/powerpc/platforms/512x/mpc5121_generic.c
index 2479de9e2d12..a6c0e3a2615d 100644
--- a/arch/powerpc/platforms/512x/mpc5121_generic.c
+++ b/arch/powerpc/platforms/512x/mpc5121_generic.c
@@ -51,8 +51,9 @@ static int __init mpc5121_generic_probe(void)
51define_machine(mpc5121_generic) { 51define_machine(mpc5121_generic) {
52 .name = "MPC5121 generic", 52 .name = "MPC5121 generic",
53 .probe = mpc5121_generic_probe, 53 .probe = mpc5121_generic_probe,
54 .init = mpc512x_declare_of_platform_devices, 54 .init = mpc512x_init,
55 .init_IRQ = mpc512x_init_IRQ, 55 .init_IRQ = mpc512x_init_IRQ,
56 .get_irq = ipic_get_irq, 56 .get_irq = ipic_get_irq,
57 .calibrate_decr = generic_calibrate_decr, 57 .calibrate_decr = generic_calibrate_decr,
58 .restart = mpc512x_restart,
58}; 59};
diff --git a/arch/powerpc/platforms/512x/mpc512x.h b/arch/powerpc/platforms/512x/mpc512x.h
index 22a5352407e0..b2daca0d1488 100644
--- a/arch/powerpc/platforms/512x/mpc512x.h
+++ b/arch/powerpc/platforms/512x/mpc512x.h
@@ -12,5 +12,8 @@
12#ifndef __MPC512X_H__ 12#ifndef __MPC512X_H__
13#define __MPC512X_H__ 13#define __MPC512X_H__
14extern void __init mpc512x_init_IRQ(void); 14extern void __init mpc512x_init_IRQ(void);
15extern void __init mpc512x_init(void);
16extern int __init mpc5121_clk_init(void);
15void __init mpc512x_declare_of_platform_devices(void); 17void __init mpc512x_declare_of_platform_devices(void);
18extern void mpc512x_restart(char *cmd);
16#endif /* __MPC512X_H__ */ 19#endif /* __MPC512X_H__ */
diff --git a/arch/powerpc/platforms/512x/mpc512x_shared.c b/arch/powerpc/platforms/512x/mpc512x_shared.c
index 434d683df5a0..b7f518a60f03 100644
--- a/arch/powerpc/platforms/512x/mpc512x_shared.c
+++ b/arch/powerpc/platforms/512x/mpc512x_shared.c
@@ -21,9 +21,38 @@
21#include <asm/ipic.h> 21#include <asm/ipic.h>
22#include <asm/prom.h> 22#include <asm/prom.h>
23#include <asm/time.h> 23#include <asm/time.h>
24#include <asm/mpc5121.h>
24 25
25#include "mpc512x.h" 26#include "mpc512x.h"
26 27
28static struct mpc512x_reset_module __iomem *reset_module_base;
29
30static void __init mpc512x_restart_init(void)
31{
32 struct device_node *np;
33
34 np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-reset");
35 if (!np)
36 return;
37
38 reset_module_base = of_iomap(np, 0);
39 of_node_put(np);
40}
41
42void mpc512x_restart(char *cmd)
43{
44 if (reset_module_base) {
45 /* Enable software reset "RSTE" */
46 out_be32(&reset_module_base->rpr, 0x52535445);
47 /* Set software hard reset */
48 out_be32(&reset_module_base->rcr, 0x2);
49 } else {
50 pr_err("Restart module not mapped.\n");
51 }
52 for (;;)
53 ;
54}
55
27void __init mpc512x_init_IRQ(void) 56void __init mpc512x_init_IRQ(void)
28{ 57{
29 struct device_node *np; 58 struct device_node *np;
@@ -53,8 +82,22 @@ static struct of_device_id __initdata of_bus_ids[] = {
53 82
54void __init mpc512x_declare_of_platform_devices(void) 83void __init mpc512x_declare_of_platform_devices(void)
55{ 84{
85 struct device_node *np;
86
56 if (of_platform_bus_probe(NULL, of_bus_ids, NULL)) 87 if (of_platform_bus_probe(NULL, of_bus_ids, NULL))
57 printk(KERN_ERR __FILE__ ": " 88 printk(KERN_ERR __FILE__ ": "
58 "Error while probing of_platform bus\n"); 89 "Error while probing of_platform bus\n");
90
91 np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-nfc");
92 if (np) {
93 of_platform_device_create(np, NULL, NULL);
94 of_node_put(np);
95 }
59} 96}
60 97
98void __init mpc512x_init(void)
99{
100 mpc512x_declare_of_platform_devices();
101 mpc5121_clk_init();
102 mpc512x_restart_init();
103}
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index cc29c0f5300d..04d105d689f1 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -302,11 +302,14 @@ static struct of_device_id mpc85xx_ids[] = {
302 { .compatible = "gianfar", }, 302 { .compatible = "gianfar", },
303 { .compatible = "fsl,rapidio-delta", }, 303 { .compatible = "fsl,rapidio-delta", },
304 { .compatible = "fsl,mpc8548-guts", }, 304 { .compatible = "fsl,mpc8548-guts", },
305 { .compatible = "gpio-leds", },
305 {}, 306 {},
306}; 307};
307 308
308static int __init mpc85xx_publish_devices(void) 309static int __init mpc85xx_publish_devices(void)
309{ 310{
311 if (machine_is(mpc8568_mds))
312 simple_gpiochip_init("fsl,mpc8568mds-bcsr-gpio");
310 if (machine_is(mpc8569_mds)) 313 if (machine_is(mpc8569_mds))
311 simple_gpiochip_init("fsl,mpc8569mds-bcsr-gpio"); 314 simple_gpiochip_init("fsl,mpc8569mds-bcsr-gpio");
312 315
diff --git a/arch/powerpc/platforms/85xx/socrates_fpga_pic.c b/arch/powerpc/platforms/85xx/socrates_fpga_pic.c
index e5da5f62b24a..42e87f08aa01 100644
--- a/arch/powerpc/platforms/85xx/socrates_fpga_pic.c
+++ b/arch/powerpc/platforms/85xx/socrates_fpga_pic.c
@@ -232,7 +232,7 @@ static int socrates_fpga_pic_set_type(unsigned int virq,
232} 232}
233 233
234static struct irq_chip socrates_fpga_pic_chip = { 234static struct irq_chip socrates_fpga_pic_chip = {
235 .name = " FPGA-PIC ", 235 .name = "FPGA-PIC",
236 .ack = socrates_fpga_pic_ack, 236 .ack = socrates_fpga_pic_ack,
237 .mask = socrates_fpga_pic_mask, 237 .mask = socrates_fpga_pic_mask,
238 .mask_ack = socrates_fpga_pic_mask_ack, 238 .mask_ack = socrates_fpga_pic_mask_ack,
diff --git a/arch/powerpc/platforms/85xx/stx_gp3.c b/arch/powerpc/platforms/85xx/stx_gp3.c
index f559918f3c6f..bc33d1859ae7 100644
--- a/arch/powerpc/platforms/85xx/stx_gp3.c
+++ b/arch/powerpc/platforms/85xx/stx_gp3.c
@@ -134,7 +134,7 @@ static void stx_gp3_show_cpuinfo(struct seq_file *m)
134 pvid = mfspr(SPRN_PVR); 134 pvid = mfspr(SPRN_PVR);
135 svid = mfspr(SPRN_SVR); 135 svid = mfspr(SPRN_SVR);
136 136
137 seq_printf(m, "Vendor\t\t: RPC Electronics STx \n"); 137 seq_printf(m, "Vendor\t\t: RPC Electronics STx\n");
138 seq_printf(m, "PVR\t\t: 0x%x\n", pvid); 138 seq_printf(m, "PVR\t\t: 0x%x\n", pvid);
139 seq_printf(m, "SVR\t\t: 0x%x\n", svid); 139 seq_printf(m, "SVR\t\t: 0x%x\n", svid);
140 140
diff --git a/arch/powerpc/platforms/cell/beat_htab.c b/arch/powerpc/platforms/cell/beat_htab.c
index 35b1ec492715..2516c1cf8467 100644
--- a/arch/powerpc/platforms/cell/beat_htab.c
+++ b/arch/powerpc/platforms/cell/beat_htab.c
@@ -40,7 +40,7 @@
40#define DBG_LOW(fmt...) do { } while (0) 40#define DBG_LOW(fmt...) do { } while (0)
41#endif 41#endif
42 42
43static DEFINE_SPINLOCK(beat_htab_lock); 43static DEFINE_RAW_SPINLOCK(beat_htab_lock);
44 44
45static inline unsigned int beat_read_mask(unsigned hpte_group) 45static inline unsigned int beat_read_mask(unsigned hpte_group)
46{ 46{
@@ -114,18 +114,18 @@ static long beat_lpar_hpte_insert(unsigned long hpte_group,
114 if (rflags & _PAGE_NO_CACHE) 114 if (rflags & _PAGE_NO_CACHE)
115 hpte_r &= ~_PAGE_COHERENT; 115 hpte_r &= ~_PAGE_COHERENT;
116 116
117 spin_lock(&beat_htab_lock); 117 raw_spin_lock(&beat_htab_lock);
118 lpar_rc = beat_read_mask(hpte_group); 118 lpar_rc = beat_read_mask(hpte_group);
119 if (lpar_rc == 0) { 119 if (lpar_rc == 0) {
120 if (!(vflags & HPTE_V_BOLTED)) 120 if (!(vflags & HPTE_V_BOLTED))
121 DBG_LOW(" full\n"); 121 DBG_LOW(" full\n");
122 spin_unlock(&beat_htab_lock); 122 raw_spin_unlock(&beat_htab_lock);
123 return -1; 123 return -1;
124 } 124 }
125 125
126 lpar_rc = beat_insert_htab_entry(0, hpte_group, lpar_rc << 48, 126 lpar_rc = beat_insert_htab_entry(0, hpte_group, lpar_rc << 48,
127 hpte_v, hpte_r, &slot); 127 hpte_v, hpte_r, &slot);
128 spin_unlock(&beat_htab_lock); 128 raw_spin_unlock(&beat_htab_lock);
129 129
130 /* 130 /*
131 * Since we try and ioremap PHBs we don't own, the pte insert 131 * Since we try and ioremap PHBs we don't own, the pte insert
@@ -198,17 +198,17 @@ static long beat_lpar_hpte_updatepp(unsigned long slot,
198 "avpnv=%016lx, slot=%016lx, psize: %d, newpp %016lx ... ", 198 "avpnv=%016lx, slot=%016lx, psize: %d, newpp %016lx ... ",
199 want_v & HPTE_V_AVPN, slot, psize, newpp); 199 want_v & HPTE_V_AVPN, slot, psize, newpp);
200 200
201 spin_lock(&beat_htab_lock); 201 raw_spin_lock(&beat_htab_lock);
202 dummy0 = beat_lpar_hpte_getword0(slot); 202 dummy0 = beat_lpar_hpte_getword0(slot);
203 if ((dummy0 & ~0x7FUL) != (want_v & ~0x7FUL)) { 203 if ((dummy0 & ~0x7FUL) != (want_v & ~0x7FUL)) {
204 DBG_LOW("not found !\n"); 204 DBG_LOW("not found !\n");
205 spin_unlock(&beat_htab_lock); 205 raw_spin_unlock(&beat_htab_lock);
206 return -1; 206 return -1;
207 } 207 }
208 208
209 lpar_rc = beat_write_htab_entry(0, slot, 0, newpp, 0, 7, &dummy0, 209 lpar_rc = beat_write_htab_entry(0, slot, 0, newpp, 0, 7, &dummy0,
210 &dummy1); 210 &dummy1);
211 spin_unlock(&beat_htab_lock); 211 raw_spin_unlock(&beat_htab_lock);
212 if (lpar_rc != 0 || dummy0 == 0) { 212 if (lpar_rc != 0 || dummy0 == 0) {
213 DBG_LOW("not found !\n"); 213 DBG_LOW("not found !\n");
214 return -1; 214 return -1;
@@ -262,13 +262,13 @@ static void beat_lpar_hpte_updateboltedpp(unsigned long newpp,
262 vsid = get_kernel_vsid(ea, MMU_SEGSIZE_256M); 262 vsid = get_kernel_vsid(ea, MMU_SEGSIZE_256M);
263 va = (vsid << 28) | (ea & 0x0fffffff); 263 va = (vsid << 28) | (ea & 0x0fffffff);
264 264
265 spin_lock(&beat_htab_lock); 265 raw_spin_lock(&beat_htab_lock);
266 slot = beat_lpar_hpte_find(va, psize); 266 slot = beat_lpar_hpte_find(va, psize);
267 BUG_ON(slot == -1); 267 BUG_ON(slot == -1);
268 268
269 lpar_rc = beat_write_htab_entry(0, slot, 0, newpp, 0, 7, 269 lpar_rc = beat_write_htab_entry(0, slot, 0, newpp, 0, 7,
270 &dummy0, &dummy1); 270 &dummy0, &dummy1);
271 spin_unlock(&beat_htab_lock); 271 raw_spin_unlock(&beat_htab_lock);
272 272
273 BUG_ON(lpar_rc != 0); 273 BUG_ON(lpar_rc != 0);
274} 274}
@@ -285,18 +285,18 @@ static void beat_lpar_hpte_invalidate(unsigned long slot, unsigned long va,
285 slot, va, psize, local); 285 slot, va, psize, local);
286 want_v = hpte_encode_v(va, psize, MMU_SEGSIZE_256M); 286 want_v = hpte_encode_v(va, psize, MMU_SEGSIZE_256M);
287 287
288 spin_lock_irqsave(&beat_htab_lock, flags); 288 raw_spin_lock_irqsave(&beat_htab_lock, flags);
289 dummy1 = beat_lpar_hpte_getword0(slot); 289 dummy1 = beat_lpar_hpte_getword0(slot);
290 290
291 if ((dummy1 & ~0x7FUL) != (want_v & ~0x7FUL)) { 291 if ((dummy1 & ~0x7FUL) != (want_v & ~0x7FUL)) {
292 DBG_LOW("not found !\n"); 292 DBG_LOW("not found !\n");
293 spin_unlock_irqrestore(&beat_htab_lock, flags); 293 raw_spin_unlock_irqrestore(&beat_htab_lock, flags);
294 return; 294 return;
295 } 295 }
296 296
297 lpar_rc = beat_write_htab_entry(0, slot, 0, 0, HPTE_V_VALID, 0, 297 lpar_rc = beat_write_htab_entry(0, slot, 0, 0, HPTE_V_VALID, 0,
298 &dummy1, &dummy2); 298 &dummy1, &dummy2);
299 spin_unlock_irqrestore(&beat_htab_lock, flags); 299 raw_spin_unlock_irqrestore(&beat_htab_lock, flags);
300 300
301 BUG_ON(lpar_rc != 0); 301 BUG_ON(lpar_rc != 0);
302} 302}
diff --git a/arch/powerpc/platforms/cell/beat_interrupt.c b/arch/powerpc/platforms/cell/beat_interrupt.c
index 36052a9ebcda..682af97321a8 100644
--- a/arch/powerpc/platforms/cell/beat_interrupt.c
+++ b/arch/powerpc/platforms/cell/beat_interrupt.c
@@ -30,7 +30,7 @@
30#include "beat_wrapper.h" 30#include "beat_wrapper.h"
31 31
32#define MAX_IRQS NR_IRQS 32#define MAX_IRQS NR_IRQS
33static DEFINE_SPINLOCK(beatic_irq_mask_lock); 33static DEFINE_RAW_SPINLOCK(beatic_irq_mask_lock);
34static uint64_t beatic_irq_mask_enable[(MAX_IRQS+255)/64]; 34static uint64_t beatic_irq_mask_enable[(MAX_IRQS+255)/64];
35static uint64_t beatic_irq_mask_ack[(MAX_IRQS+255)/64]; 35static uint64_t beatic_irq_mask_ack[(MAX_IRQS+255)/64];
36 36
@@ -65,30 +65,30 @@ static void beatic_mask_irq(unsigned int irq_plug)
65{ 65{
66 unsigned long flags; 66 unsigned long flags;
67 67
68 spin_lock_irqsave(&beatic_irq_mask_lock, flags); 68 raw_spin_lock_irqsave(&beatic_irq_mask_lock, flags);
69 beatic_irq_mask_enable[irq_plug/64] &= ~(1UL << (63 - (irq_plug%64))); 69 beatic_irq_mask_enable[irq_plug/64] &= ~(1UL << (63 - (irq_plug%64)));
70 beatic_update_irq_mask(irq_plug); 70 beatic_update_irq_mask(irq_plug);
71 spin_unlock_irqrestore(&beatic_irq_mask_lock, flags); 71 raw_spin_unlock_irqrestore(&beatic_irq_mask_lock, flags);
72} 72}
73 73
74static void beatic_unmask_irq(unsigned int irq_plug) 74static void beatic_unmask_irq(unsigned int irq_plug)
75{ 75{
76 unsigned long flags; 76 unsigned long flags;
77 77
78 spin_lock_irqsave(&beatic_irq_mask_lock, flags); 78 raw_spin_lock_irqsave(&beatic_irq_mask_lock, flags);
79 beatic_irq_mask_enable[irq_plug/64] |= 1UL << (63 - (irq_plug%64)); 79 beatic_irq_mask_enable[irq_plug/64] |= 1UL << (63 - (irq_plug%64));
80 beatic_update_irq_mask(irq_plug); 80 beatic_update_irq_mask(irq_plug);
81 spin_unlock_irqrestore(&beatic_irq_mask_lock, flags); 81 raw_spin_unlock_irqrestore(&beatic_irq_mask_lock, flags);
82} 82}
83 83
84static void beatic_ack_irq(unsigned int irq_plug) 84static void beatic_ack_irq(unsigned int irq_plug)
85{ 85{
86 unsigned long flags; 86 unsigned long flags;
87 87
88 spin_lock_irqsave(&beatic_irq_mask_lock, flags); 88 raw_spin_lock_irqsave(&beatic_irq_mask_lock, flags);
89 beatic_irq_mask_ack[irq_plug/64] &= ~(1UL << (63 - (irq_plug%64))); 89 beatic_irq_mask_ack[irq_plug/64] &= ~(1UL << (63 - (irq_plug%64)));
90 beatic_update_irq_mask(irq_plug); 90 beatic_update_irq_mask(irq_plug);
91 spin_unlock_irqrestore(&beatic_irq_mask_lock, flags); 91 raw_spin_unlock_irqrestore(&beatic_irq_mask_lock, flags);
92} 92}
93 93
94static void beatic_end_irq(unsigned int irq_plug) 94static void beatic_end_irq(unsigned int irq_plug)
@@ -103,14 +103,14 @@ static void beatic_end_irq(unsigned int irq_plug)
103 103
104 printk(KERN_ERR "IRQ over-downcounted, plug %d\n", irq_plug); 104 printk(KERN_ERR "IRQ over-downcounted, plug %d\n", irq_plug);
105 } 105 }
106 spin_lock_irqsave(&beatic_irq_mask_lock, flags); 106 raw_spin_lock_irqsave(&beatic_irq_mask_lock, flags);
107 beatic_irq_mask_ack[irq_plug/64] |= 1UL << (63 - (irq_plug%64)); 107 beatic_irq_mask_ack[irq_plug/64] |= 1UL << (63 - (irq_plug%64));
108 beatic_update_irq_mask(irq_plug); 108 beatic_update_irq_mask(irq_plug);
109 spin_unlock_irqrestore(&beatic_irq_mask_lock, flags); 109 raw_spin_unlock_irqrestore(&beatic_irq_mask_lock, flags);
110} 110}
111 111
112static struct irq_chip beatic_pic = { 112static struct irq_chip beatic_pic = {
113 .name = " CELL-BEAT ", 113 .name = "CELL-BEAT",
114 .unmask = beatic_unmask_irq, 114 .unmask = beatic_unmask_irq,
115 .mask = beatic_mask_irq, 115 .mask = beatic_mask_irq,
116 .eoi = beatic_end_irq, 116 .eoi = beatic_end_irq,
diff --git a/arch/powerpc/platforms/cell/interrupt.c b/arch/powerpc/platforms/cell/interrupt.c
index 6829cf7e2bda..10eb1a443626 100644
--- a/arch/powerpc/platforms/cell/interrupt.c
+++ b/arch/powerpc/platforms/cell/interrupt.c
@@ -88,7 +88,7 @@ static void iic_eoi(unsigned int irq)
88} 88}
89 89
90static struct irq_chip iic_chip = { 90static struct irq_chip iic_chip = {
91 .name = " CELL-IIC ", 91 .name = "CELL-IIC",
92 .mask = iic_mask, 92 .mask = iic_mask,
93 .unmask = iic_unmask, 93 .unmask = iic_unmask,
94 .eoi = iic_eoi, 94 .eoi = iic_eoi,
@@ -133,7 +133,7 @@ static void iic_ioexc_cascade(unsigned int irq, struct irq_desc *desc)
133 133
134 134
135static struct irq_chip iic_ioexc_chip = { 135static struct irq_chip iic_ioexc_chip = {
136 .name = " CELL-IOEX", 136 .name = "CELL-IOEX",
137 .mask = iic_mask, 137 .mask = iic_mask,
138 .unmask = iic_unmask, 138 .unmask = iic_unmask,
139 .eoi = iic_ioexc_eoi, 139 .eoi = iic_ioexc_eoi,
diff --git a/arch/powerpc/platforms/cell/spider-pic.c b/arch/powerpc/platforms/cell/spider-pic.c
index 01244f254a11..5876e888e412 100644
--- a/arch/powerpc/platforms/cell/spider-pic.c
+++ b/arch/powerpc/platforms/cell/spider-pic.c
@@ -168,7 +168,7 @@ static int spider_set_irq_type(unsigned int virq, unsigned int type)
168} 168}
169 169
170static struct irq_chip spider_pic = { 170static struct irq_chip spider_pic = {
171 .name = " SPIDER ", 171 .name = "SPIDER",
172 .unmask = spider_unmask_irq, 172 .unmask = spider_unmask_irq,
173 .mask = spider_mask_irq, 173 .mask = spider_mask_irq,
174 .ack = spider_ack_irq, 174 .ack = spider_ack_irq,
diff --git a/arch/powerpc/platforms/iseries/irq.c b/arch/powerpc/platforms/iseries/irq.c
index 86c4b29eea89..ba446bf355a9 100644
--- a/arch/powerpc/platforms/iseries/irq.c
+++ b/arch/powerpc/platforms/iseries/irq.c
@@ -273,7 +273,7 @@ static void iseries_end_IRQ(unsigned int irq)
273} 273}
274 274
275static struct irq_chip iseries_pic = { 275static struct irq_chip iseries_pic = {
276 .name = "iSeries irq controller", 276 .name = "iSeries",
277 .startup = iseries_startup_IRQ, 277 .startup = iseries_startup_IRQ,
278 .shutdown = iseries_shutdown_IRQ, 278 .shutdown = iseries_shutdown_IRQ,
279 .unmask = iseries_enable_IRQ, 279 .unmask = iseries_enable_IRQ,
diff --git a/arch/powerpc/platforms/iseries/proc.c b/arch/powerpc/platforms/iseries/proc.c
index 91f4c6cd4b99..06763682db47 100644
--- a/arch/powerpc/platforms/iseries/proc.c
+++ b/arch/powerpc/platforms/iseries/proc.c
@@ -85,7 +85,7 @@ static int proc_titantod_show(struct seq_file *m, void *v)
85 85
86 seq_printf(m, " titan elapsed = %lu uSec\n", titan_usec); 86 seq_printf(m, " titan elapsed = %lu uSec\n", titan_usec);
87 seq_printf(m, " tb elapsed = %lu ticks\n", tb_ticks); 87 seq_printf(m, " tb elapsed = %lu ticks\n", tb_ticks);
88 seq_printf(m, " titan jiffies = %lu.%04lu \n", titan_jiffies, 88 seq_printf(m, " titan jiffies = %lu.%04lu\n", titan_jiffies,
89 titan_jiff_rem_usec); 89 titan_jiff_rem_usec);
90 seq_printf(m, " tb jiffies = %lu.%04lu\n", tb_jiffies, 90 seq_printf(m, " tb jiffies = %lu.%04lu\n", tb_jiffies,
91 tb_jiff_rem_usec); 91 tb_jiff_rem_usec);
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index a6cd3394feaa..b0863410517f 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -256,7 +256,7 @@ static unsigned long iSeries_process_mainstore_vpd(struct MemoryBlock *mb_array,
256 mem_blocks = iSeries_process_Condor_mainstore_vpd(mb_array, 256 mem_blocks = iSeries_process_Condor_mainstore_vpd(mb_array,
257 max_entries); 257 max_entries);
258 258
259 printk("Mainstore_VPD: numMemoryBlocks = %ld \n", mem_blocks); 259 printk("Mainstore_VPD: numMemoryBlocks = %ld\n", mem_blocks);
260 for (i = 0; i < mem_blocks; ++i) { 260 for (i = 0; i < mem_blocks; ++i) {
261 printk("Mainstore_VPD: block %3ld logical chunks %016lx - %016lx\n" 261 printk("Mainstore_VPD: block %3ld logical chunks %016lx - %016lx\n"
262 " abs chunks %016lx - %016lx\n", 262 " abs chunks %016lx - %016lx\n",
diff --git a/arch/powerpc/platforms/powermac/bootx_init.c b/arch/powerpc/platforms/powermac/bootx_init.c
index 9dd789a7370d..84d7fd9bcc69 100644
--- a/arch/powerpc/platforms/powermac/bootx_init.c
+++ b/arch/powerpc/platforms/powermac/bootx_init.c
@@ -539,7 +539,7 @@ void __init bootx_init(unsigned long r3, unsigned long r4)
539 if (model 539 if (model
540 && (strcmp(model, "iMac,1") == 0 540 && (strcmp(model, "iMac,1") == 0
541 || strcmp(model, "PowerMac1,1") == 0)) { 541 || strcmp(model, "PowerMac1,1") == 0)) {
542 bootx_printf("iMac,1 detected, shutting down USB \n"); 542 bootx_printf("iMac,1 detected, shutting down USB\n");
543 out_le32((unsigned __iomem *)0x80880008, 1); /* XXX */ 543 out_le32((unsigned __iomem *)0x80880008, 1); /* XXX */
544 } 544 }
545 } 545 }
@@ -554,7 +554,7 @@ void __init bootx_init(unsigned long r3, unsigned long r4)
554 } else 554 } else
555 space = bi->totalParamsSize; 555 space = bi->totalParamsSize;
556 556
557 bootx_printf("Total space used by parameters & ramdisk: 0x%x \n", space); 557 bootx_printf("Total space used by parameters & ramdisk: 0x%x\n", space);
558 558
559 /* New BootX will have flushed all TLBs and enters kernel with 559 /* New BootX will have flushed all TLBs and enters kernel with
560 * MMU switched OFF, so this should not be useful anymore. 560 * MMU switched OFF, so this should not be useful anymore.
diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c
index 33e815f4466c..9e1b9fd75206 100644
--- a/arch/powerpc/platforms/powermac/feature.c
+++ b/arch/powerpc/platforms/powermac/feature.c
@@ -59,10 +59,10 @@ extern struct device_node *k2_skiplist[2];
59 * We use a single global lock to protect accesses. Each driver has 59 * We use a single global lock to protect accesses. Each driver has
60 * to take care of its own locking 60 * to take care of its own locking
61 */ 61 */
62DEFINE_SPINLOCK(feature_lock); 62DEFINE_RAW_SPINLOCK(feature_lock);
63 63
64#define LOCK(flags) spin_lock_irqsave(&feature_lock, flags); 64#define LOCK(flags) raw_spin_lock_irqsave(&feature_lock, flags);
65#define UNLOCK(flags) spin_unlock_irqrestore(&feature_lock, flags); 65#define UNLOCK(flags) raw_spin_unlock_irqrestore(&feature_lock, flags);
66 66
67 67
68/* 68/*
diff --git a/arch/powerpc/platforms/powermac/nvram.c b/arch/powerpc/platforms/powermac/nvram.c
index c6f0f9e738e5..80a5258d0364 100644
--- a/arch/powerpc/platforms/powermac/nvram.c
+++ b/arch/powerpc/platforms/powermac/nvram.c
@@ -80,7 +80,7 @@ static int is_core_99;
80static int core99_bank = 0; 80static int core99_bank = 0;
81static int nvram_partitions[3]; 81static int nvram_partitions[3];
82// XXX Turn that into a sem 82// XXX Turn that into a sem
83static DEFINE_SPINLOCK(nv_lock); 83static DEFINE_RAW_SPINLOCK(nv_lock);
84 84
85static int (*core99_write_bank)(int bank, u8* datas); 85static int (*core99_write_bank)(int bank, u8* datas);
86static int (*core99_erase_bank)(int bank); 86static int (*core99_erase_bank)(int bank);
@@ -165,10 +165,10 @@ static unsigned char indirect_nvram_read_byte(int addr)
165 unsigned char val; 165 unsigned char val;
166 unsigned long flags; 166 unsigned long flags;
167 167
168 spin_lock_irqsave(&nv_lock, flags); 168 raw_spin_lock_irqsave(&nv_lock, flags);
169 out_8(nvram_addr, addr >> 5); 169 out_8(nvram_addr, addr >> 5);
170 val = in_8(&nvram_data[(addr & 0x1f) << 4]); 170 val = in_8(&nvram_data[(addr & 0x1f) << 4]);
171 spin_unlock_irqrestore(&nv_lock, flags); 171 raw_spin_unlock_irqrestore(&nv_lock, flags);
172 172
173 return val; 173 return val;
174} 174}
@@ -177,10 +177,10 @@ static void indirect_nvram_write_byte(int addr, unsigned char val)
177{ 177{
178 unsigned long flags; 178 unsigned long flags;
179 179
180 spin_lock_irqsave(&nv_lock, flags); 180 raw_spin_lock_irqsave(&nv_lock, flags);
181 out_8(nvram_addr, addr >> 5); 181 out_8(nvram_addr, addr >> 5);
182 out_8(&nvram_data[(addr & 0x1f) << 4], val); 182 out_8(&nvram_data[(addr & 0x1f) << 4], val);
183 spin_unlock_irqrestore(&nv_lock, flags); 183 raw_spin_unlock_irqrestore(&nv_lock, flags);
184} 184}
185 185
186 186
@@ -481,7 +481,7 @@ static void core99_nvram_sync(void)
481 if (!is_core_99 || !nvram_data || !nvram_image) 481 if (!is_core_99 || !nvram_data || !nvram_image)
482 return; 482 return;
483 483
484 spin_lock_irqsave(&nv_lock, flags); 484 raw_spin_lock_irqsave(&nv_lock, flags);
485 if (!memcmp(nvram_image, (u8*)nvram_data + core99_bank*NVRAM_SIZE, 485 if (!memcmp(nvram_image, (u8*)nvram_data + core99_bank*NVRAM_SIZE,
486 NVRAM_SIZE)) 486 NVRAM_SIZE))
487 goto bail; 487 goto bail;
@@ -503,7 +503,7 @@ static void core99_nvram_sync(void)
503 if (core99_write_bank(core99_bank, nvram_image)) 503 if (core99_write_bank(core99_bank, nvram_image))
504 printk("nvram: Error writing bank %d\n", core99_bank); 504 printk("nvram: Error writing bank %d\n", core99_bank);
505 bail: 505 bail:
506 spin_unlock_irqrestore(&nv_lock, flags); 506 raw_spin_unlock_irqrestore(&nv_lock, flags);
507 507
508#ifdef DEBUG 508#ifdef DEBUG
509 mdelay(2000); 509 mdelay(2000);
diff --git a/arch/powerpc/platforms/powermac/pfunc_base.c b/arch/powerpc/platforms/powermac/pfunc_base.c
index db20de512f3e..f5e3cda6660e 100644
--- a/arch/powerpc/platforms/powermac/pfunc_base.c
+++ b/arch/powerpc/platforms/powermac/pfunc_base.c
@@ -50,13 +50,13 @@ static int macio_do_gpio_write(PMF_STD_ARGS, u8 value, u8 mask)
50 value = ~value; 50 value = ~value;
51 51
52 /* Toggle the GPIO */ 52 /* Toggle the GPIO */
53 spin_lock_irqsave(&feature_lock, flags); 53 raw_spin_lock_irqsave(&feature_lock, flags);
54 tmp = readb(addr); 54 tmp = readb(addr);
55 tmp = (tmp & ~mask) | (value & mask); 55 tmp = (tmp & ~mask) | (value & mask);
56 DBG("Do write 0x%02x to GPIO %s (%p)\n", 56 DBG("Do write 0x%02x to GPIO %s (%p)\n",
57 tmp, func->node->full_name, addr); 57 tmp, func->node->full_name, addr);
58 writeb(tmp, addr); 58 writeb(tmp, addr);
59 spin_unlock_irqrestore(&feature_lock, flags); 59 raw_spin_unlock_irqrestore(&feature_lock, flags);
60 60
61 return 0; 61 return 0;
62} 62}
@@ -145,9 +145,9 @@ static int macio_do_write_reg32(PMF_STD_ARGS, u32 offset, u32 value, u32 mask)
145 struct macio_chip *macio = func->driver_data; 145 struct macio_chip *macio = func->driver_data;
146 unsigned long flags; 146 unsigned long flags;
147 147
148 spin_lock_irqsave(&feature_lock, flags); 148 raw_spin_lock_irqsave(&feature_lock, flags);
149 MACIO_OUT32(offset, (MACIO_IN32(offset) & ~mask) | (value & mask)); 149 MACIO_OUT32(offset, (MACIO_IN32(offset) & ~mask) | (value & mask));
150 spin_unlock_irqrestore(&feature_lock, flags); 150 raw_spin_unlock_irqrestore(&feature_lock, flags);
151 return 0; 151 return 0;
152} 152}
153 153
@@ -168,9 +168,9 @@ static int macio_do_write_reg8(PMF_STD_ARGS, u32 offset, u8 value, u8 mask)
168 struct macio_chip *macio = func->driver_data; 168 struct macio_chip *macio = func->driver_data;
169 unsigned long flags; 169 unsigned long flags;
170 170
171 spin_lock_irqsave(&feature_lock, flags); 171 raw_spin_lock_irqsave(&feature_lock, flags);
172 MACIO_OUT8(offset, (MACIO_IN8(offset) & ~mask) | (value & mask)); 172 MACIO_OUT8(offset, (MACIO_IN8(offset) & ~mask) | (value & mask));
173 spin_unlock_irqrestore(&feature_lock, flags); 173 raw_spin_unlock_irqrestore(&feature_lock, flags);
174 return 0; 174 return 0;
175} 175}
176 176
@@ -223,12 +223,12 @@ static int macio_do_write_reg32_slm(PMF_STD_ARGS, u32 offset, u32 shift,
223 if (args == NULL || args->count == 0) 223 if (args == NULL || args->count == 0)
224 return -EINVAL; 224 return -EINVAL;
225 225
226 spin_lock_irqsave(&feature_lock, flags); 226 raw_spin_lock_irqsave(&feature_lock, flags);
227 tmp = MACIO_IN32(offset); 227 tmp = MACIO_IN32(offset);
228 val = args->u[0].v << shift; 228 val = args->u[0].v << shift;
229 tmp = (tmp & ~mask) | (val & mask); 229 tmp = (tmp & ~mask) | (val & mask);
230 MACIO_OUT32(offset, tmp); 230 MACIO_OUT32(offset, tmp);
231 spin_unlock_irqrestore(&feature_lock, flags); 231 raw_spin_unlock_irqrestore(&feature_lock, flags);
232 return 0; 232 return 0;
233} 233}
234 234
@@ -243,12 +243,12 @@ static int macio_do_write_reg8_slm(PMF_STD_ARGS, u32 offset, u32 shift,
243 if (args == NULL || args->count == 0) 243 if (args == NULL || args->count == 0)
244 return -EINVAL; 244 return -EINVAL;
245 245
246 spin_lock_irqsave(&feature_lock, flags); 246 raw_spin_lock_irqsave(&feature_lock, flags);
247 tmp = MACIO_IN8(offset); 247 tmp = MACIO_IN8(offset);
248 val = args->u[0].v << shift; 248 val = args->u[0].v << shift;
249 tmp = (tmp & ~mask) | (val & mask); 249 tmp = (tmp & ~mask) | (val & mask);
250 MACIO_OUT8(offset, tmp); 250 MACIO_OUT8(offset, tmp);
251 spin_unlock_irqrestore(&feature_lock, flags); 251 raw_spin_unlock_irqrestore(&feature_lock, flags);
252 return 0; 252 return 0;
253} 253}
254 254
@@ -278,12 +278,12 @@ static int unin_do_write_reg32(PMF_STD_ARGS, u32 offset, u32 value, u32 mask)
278{ 278{
279 unsigned long flags; 279 unsigned long flags;
280 280
281 spin_lock_irqsave(&feature_lock, flags); 281 raw_spin_lock_irqsave(&feature_lock, flags);
282 /* This is fairly bogus in darwin, but it should work for our needs 282 /* This is fairly bogus in darwin, but it should work for our needs
283 * implemeted that way: 283 * implemeted that way:
284 */ 284 */
285 UN_OUT(offset, (UN_IN(offset) & ~mask) | (value & mask)); 285 UN_OUT(offset, (UN_IN(offset) & ~mask) | (value & mask));
286 spin_unlock_irqrestore(&feature_lock, flags); 286 raw_spin_unlock_irqrestore(&feature_lock, flags);
287 return 0; 287 return 0;
288} 288}
289 289
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c
index 09e827296276..630a533d0e59 100644
--- a/arch/powerpc/platforms/powermac/pic.c
+++ b/arch/powerpc/platforms/powermac/pic.c
@@ -57,7 +57,7 @@ static int max_irqs;
57static int max_real_irqs; 57static int max_real_irqs;
58static u32 level_mask[4]; 58static u32 level_mask[4];
59 59
60static DEFINE_SPINLOCK(pmac_pic_lock); 60static DEFINE_RAW_SPINLOCK(pmac_pic_lock);
61 61
62#define NR_MASK_WORDS ((NR_IRQS + 31) / 32) 62#define NR_MASK_WORDS ((NR_IRQS + 31) / 32)
63static unsigned long ppc_lost_interrupts[NR_MASK_WORDS]; 63static unsigned long ppc_lost_interrupts[NR_MASK_WORDS];
@@ -85,7 +85,7 @@ static void pmac_mask_and_ack_irq(unsigned int virq)
85 int i = src >> 5; 85 int i = src >> 5;
86 unsigned long flags; 86 unsigned long flags;
87 87
88 spin_lock_irqsave(&pmac_pic_lock, flags); 88 raw_spin_lock_irqsave(&pmac_pic_lock, flags);
89 __clear_bit(src, ppc_cached_irq_mask); 89 __clear_bit(src, ppc_cached_irq_mask);
90 if (__test_and_clear_bit(src, ppc_lost_interrupts)) 90 if (__test_and_clear_bit(src, ppc_lost_interrupts))
91 atomic_dec(&ppc_n_lost_interrupts); 91 atomic_dec(&ppc_n_lost_interrupts);
@@ -97,7 +97,7 @@ static void pmac_mask_and_ack_irq(unsigned int virq)
97 mb(); 97 mb();
98 } while((in_le32(&pmac_irq_hw[i]->enable) & bit) 98 } while((in_le32(&pmac_irq_hw[i]->enable) & bit)
99 != (ppc_cached_irq_mask[i] & bit)); 99 != (ppc_cached_irq_mask[i] & bit));
100 spin_unlock_irqrestore(&pmac_pic_lock, flags); 100 raw_spin_unlock_irqrestore(&pmac_pic_lock, flags);
101} 101}
102 102
103static void pmac_ack_irq(unsigned int virq) 103static void pmac_ack_irq(unsigned int virq)
@@ -107,12 +107,12 @@ static void pmac_ack_irq(unsigned int virq)
107 int i = src >> 5; 107 int i = src >> 5;
108 unsigned long flags; 108 unsigned long flags;
109 109
110 spin_lock_irqsave(&pmac_pic_lock, flags); 110 raw_spin_lock_irqsave(&pmac_pic_lock, flags);
111 if (__test_and_clear_bit(src, ppc_lost_interrupts)) 111 if (__test_and_clear_bit(src, ppc_lost_interrupts))
112 atomic_dec(&ppc_n_lost_interrupts); 112 atomic_dec(&ppc_n_lost_interrupts);
113 out_le32(&pmac_irq_hw[i]->ack, bit); 113 out_le32(&pmac_irq_hw[i]->ack, bit);
114 (void)in_le32(&pmac_irq_hw[i]->ack); 114 (void)in_le32(&pmac_irq_hw[i]->ack);
115 spin_unlock_irqrestore(&pmac_pic_lock, flags); 115 raw_spin_unlock_irqrestore(&pmac_pic_lock, flags);
116} 116}
117 117
118static void __pmac_set_irq_mask(unsigned int irq_nr, int nokicklost) 118static void __pmac_set_irq_mask(unsigned int irq_nr, int nokicklost)
@@ -152,12 +152,12 @@ static unsigned int pmac_startup_irq(unsigned int virq)
152 unsigned long bit = 1UL << (src & 0x1f); 152 unsigned long bit = 1UL << (src & 0x1f);
153 int i = src >> 5; 153 int i = src >> 5;
154 154
155 spin_lock_irqsave(&pmac_pic_lock, flags); 155 raw_spin_lock_irqsave(&pmac_pic_lock, flags);
156 if ((irq_to_desc(virq)->status & IRQ_LEVEL) == 0) 156 if ((irq_to_desc(virq)->status & IRQ_LEVEL) == 0)
157 out_le32(&pmac_irq_hw[i]->ack, bit); 157 out_le32(&pmac_irq_hw[i]->ack, bit);
158 __set_bit(src, ppc_cached_irq_mask); 158 __set_bit(src, ppc_cached_irq_mask);
159 __pmac_set_irq_mask(src, 0); 159 __pmac_set_irq_mask(src, 0);
160 spin_unlock_irqrestore(&pmac_pic_lock, flags); 160 raw_spin_unlock_irqrestore(&pmac_pic_lock, flags);
161 161
162 return 0; 162 return 0;
163} 163}
@@ -167,10 +167,10 @@ static void pmac_mask_irq(unsigned int virq)
167 unsigned long flags; 167 unsigned long flags;
168 unsigned int src = irq_map[virq].hwirq; 168 unsigned int src = irq_map[virq].hwirq;
169 169
170 spin_lock_irqsave(&pmac_pic_lock, flags); 170 raw_spin_lock_irqsave(&pmac_pic_lock, flags);
171 __clear_bit(src, ppc_cached_irq_mask); 171 __clear_bit(src, ppc_cached_irq_mask);
172 __pmac_set_irq_mask(src, 1); 172 __pmac_set_irq_mask(src, 1);
173 spin_unlock_irqrestore(&pmac_pic_lock, flags); 173 raw_spin_unlock_irqrestore(&pmac_pic_lock, flags);
174} 174}
175 175
176static void pmac_unmask_irq(unsigned int virq) 176static void pmac_unmask_irq(unsigned int virq)
@@ -178,24 +178,24 @@ static void pmac_unmask_irq(unsigned int virq)
178 unsigned long flags; 178 unsigned long flags;
179 unsigned int src = irq_map[virq].hwirq; 179 unsigned int src = irq_map[virq].hwirq;
180 180
181 spin_lock_irqsave(&pmac_pic_lock, flags); 181 raw_spin_lock_irqsave(&pmac_pic_lock, flags);
182 __set_bit(src, ppc_cached_irq_mask); 182 __set_bit(src, ppc_cached_irq_mask);
183 __pmac_set_irq_mask(src, 0); 183 __pmac_set_irq_mask(src, 0);
184 spin_unlock_irqrestore(&pmac_pic_lock, flags); 184 raw_spin_unlock_irqrestore(&pmac_pic_lock, flags);
185} 185}
186 186
187static int pmac_retrigger(unsigned int virq) 187static int pmac_retrigger(unsigned int virq)
188{ 188{
189 unsigned long flags; 189 unsigned long flags;
190 190
191 spin_lock_irqsave(&pmac_pic_lock, flags); 191 raw_spin_lock_irqsave(&pmac_pic_lock, flags);
192 __pmac_retrigger(irq_map[virq].hwirq); 192 __pmac_retrigger(irq_map[virq].hwirq);
193 spin_unlock_irqrestore(&pmac_pic_lock, flags); 193 raw_spin_unlock_irqrestore(&pmac_pic_lock, flags);
194 return 1; 194 return 1;
195} 195}
196 196
197static struct irq_chip pmac_pic = { 197static struct irq_chip pmac_pic = {
198 .name = " PMAC-PIC ", 198 .name = "PMAC-PIC",
199 .startup = pmac_startup_irq, 199 .startup = pmac_startup_irq,
200 .mask = pmac_mask_irq, 200 .mask = pmac_mask_irq,
201 .ack = pmac_ack_irq, 201 .ack = pmac_ack_irq,
@@ -210,7 +210,7 @@ static irqreturn_t gatwick_action(int cpl, void *dev_id)
210 int irq, bits; 210 int irq, bits;
211 int rc = IRQ_NONE; 211 int rc = IRQ_NONE;
212 212
213 spin_lock_irqsave(&pmac_pic_lock, flags); 213 raw_spin_lock_irqsave(&pmac_pic_lock, flags);
214 for (irq = max_irqs; (irq -= 32) >= max_real_irqs; ) { 214 for (irq = max_irqs; (irq -= 32) >= max_real_irqs; ) {
215 int i = irq >> 5; 215 int i = irq >> 5;
216 bits = in_le32(&pmac_irq_hw[i]->event) | ppc_lost_interrupts[i]; 216 bits = in_le32(&pmac_irq_hw[i]->event) | ppc_lost_interrupts[i];
@@ -220,12 +220,12 @@ static irqreturn_t gatwick_action(int cpl, void *dev_id)
220 if (bits == 0) 220 if (bits == 0)
221 continue; 221 continue;
222 irq += __ilog2(bits); 222 irq += __ilog2(bits);
223 spin_unlock_irqrestore(&pmac_pic_lock, flags); 223 raw_spin_unlock_irqrestore(&pmac_pic_lock, flags);
224 generic_handle_irq(irq); 224 generic_handle_irq(irq);
225 spin_lock_irqsave(&pmac_pic_lock, flags); 225 raw_spin_lock_irqsave(&pmac_pic_lock, flags);
226 rc = IRQ_HANDLED; 226 rc = IRQ_HANDLED;
227 } 227 }
228 spin_unlock_irqrestore(&pmac_pic_lock, flags); 228 raw_spin_unlock_irqrestore(&pmac_pic_lock, flags);
229 return rc; 229 return rc;
230} 230}
231 231
@@ -244,7 +244,7 @@ static unsigned int pmac_pic_get_irq(void)
244 return NO_IRQ_IGNORE; /* ignore, already handled */ 244 return NO_IRQ_IGNORE; /* ignore, already handled */
245 } 245 }
246#endif /* CONFIG_SMP */ 246#endif /* CONFIG_SMP */
247 spin_lock_irqsave(&pmac_pic_lock, flags); 247 raw_spin_lock_irqsave(&pmac_pic_lock, flags);
248 for (irq = max_real_irqs; (irq -= 32) >= 0; ) { 248 for (irq = max_real_irqs; (irq -= 32) >= 0; ) {
249 int i = irq >> 5; 249 int i = irq >> 5;
250 bits = in_le32(&pmac_irq_hw[i]->event) | ppc_lost_interrupts[i]; 250 bits = in_le32(&pmac_irq_hw[i]->event) | ppc_lost_interrupts[i];
@@ -256,7 +256,7 @@ static unsigned int pmac_pic_get_irq(void)
256 irq += __ilog2(bits); 256 irq += __ilog2(bits);
257 break; 257 break;
258 } 258 }
259 spin_unlock_irqrestore(&pmac_pic_lock, flags); 259 raw_spin_unlock_irqrestore(&pmac_pic_lock, flags);
260 if (unlikely(irq < 0)) 260 if (unlikely(irq < 0))
261 return NO_IRQ; 261 return NO_IRQ;
262 return irq_linear_revmap(pmac_pic_host, irq); 262 return irq_linear_revmap(pmac_pic_host, irq);
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c
index ccd8dd03b8c9..7df7fbb7cacb 100644
--- a/arch/powerpc/platforms/pseries/eeh.c
+++ b/arch/powerpc/platforms/pseries/eeh.c
@@ -100,7 +100,7 @@ int eeh_subsystem_enabled;
100EXPORT_SYMBOL(eeh_subsystem_enabled); 100EXPORT_SYMBOL(eeh_subsystem_enabled);
101 101
102/* Lock to avoid races due to multiple reports of an error */ 102/* Lock to avoid races due to multiple reports of an error */
103static DEFINE_SPINLOCK(confirm_error_lock); 103static DEFINE_RAW_SPINLOCK(confirm_error_lock);
104 104
105/* Buffer for reporting slot-error-detail rtas calls. Its here 105/* Buffer for reporting slot-error-detail rtas calls. Its here
106 * in BSS, and not dynamically alloced, so that it ends up in 106 * in BSS, and not dynamically alloced, so that it ends up in
@@ -436,7 +436,7 @@ static void __eeh_clear_slot(struct device_node *parent, int mode_flag)
436void eeh_clear_slot (struct device_node *dn, int mode_flag) 436void eeh_clear_slot (struct device_node *dn, int mode_flag)
437{ 437{
438 unsigned long flags; 438 unsigned long flags;
439 spin_lock_irqsave(&confirm_error_lock, flags); 439 raw_spin_lock_irqsave(&confirm_error_lock, flags);
440 440
441 dn = find_device_pe (dn); 441 dn = find_device_pe (dn);
442 442
@@ -447,7 +447,7 @@ void eeh_clear_slot (struct device_node *dn, int mode_flag)
447 PCI_DN(dn)->eeh_mode &= ~mode_flag; 447 PCI_DN(dn)->eeh_mode &= ~mode_flag;
448 PCI_DN(dn)->eeh_check_count = 0; 448 PCI_DN(dn)->eeh_check_count = 0;
449 __eeh_clear_slot(dn, mode_flag); 449 __eeh_clear_slot(dn, mode_flag);
450 spin_unlock_irqrestore(&confirm_error_lock, flags); 450 raw_spin_unlock_irqrestore(&confirm_error_lock, flags);
451} 451}
452 452
453/** 453/**
@@ -491,7 +491,7 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
491 pdn->eeh_mode & EEH_MODE_NOCHECK) { 491 pdn->eeh_mode & EEH_MODE_NOCHECK) {
492 ignored_check++; 492 ignored_check++;
493 pr_debug("EEH: Ignored check (%x) for %s %s\n", 493 pr_debug("EEH: Ignored check (%x) for %s %s\n",
494 pdn->eeh_mode, pci_name (dev), dn->full_name); 494 pdn->eeh_mode, eeh_pci_name(dev), dn->full_name);
495 return 0; 495 return 0;
496 } 496 }
497 497
@@ -506,7 +506,7 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
506 * in one slot might report errors simultaneously, and we 506 * in one slot might report errors simultaneously, and we
507 * only want one error recovery routine running. 507 * only want one error recovery routine running.
508 */ 508 */
509 spin_lock_irqsave(&confirm_error_lock, flags); 509 raw_spin_lock_irqsave(&confirm_error_lock, flags);
510 rc = 1; 510 rc = 1;
511 if (pdn->eeh_mode & EEH_MODE_ISOLATED) { 511 if (pdn->eeh_mode & EEH_MODE_ISOLATED) {
512 pdn->eeh_check_count ++; 512 pdn->eeh_check_count ++;
@@ -515,7 +515,7 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
515 printk (KERN_ERR "EEH: %d reads ignored for recovering device at " 515 printk (KERN_ERR "EEH: %d reads ignored for recovering device at "
516 "location=%s driver=%s pci addr=%s\n", 516 "location=%s driver=%s pci addr=%s\n",
517 pdn->eeh_check_count, location, 517 pdn->eeh_check_count, location,
518 dev->driver->name, pci_name(dev)); 518 dev->driver->name, eeh_pci_name(dev));
519 printk (KERN_ERR "EEH: Might be infinite loop in %s driver\n", 519 printk (KERN_ERR "EEH: Might be infinite loop in %s driver\n",
520 dev->driver->name); 520 dev->driver->name);
521 dump_stack(); 521 dump_stack();
@@ -575,7 +575,7 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
575 * with other functions on this device, and functions under 575 * with other functions on this device, and functions under
576 * bridges. */ 576 * bridges. */
577 eeh_mark_slot (dn, EEH_MODE_ISOLATED); 577 eeh_mark_slot (dn, EEH_MODE_ISOLATED);
578 spin_unlock_irqrestore(&confirm_error_lock, flags); 578 raw_spin_unlock_irqrestore(&confirm_error_lock, flags);
579 579
580 eeh_send_failure_event (dn, dev); 580 eeh_send_failure_event (dn, dev);
581 581
@@ -586,7 +586,7 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
586 return 1; 586 return 1;
587 587
588dn_unlock: 588dn_unlock:
589 spin_unlock_irqrestore(&confirm_error_lock, flags); 589 raw_spin_unlock_irqrestore(&confirm_error_lock, flags);
590 return rc; 590 return rc;
591} 591}
592 592
@@ -1064,7 +1064,7 @@ void __init eeh_init(void)
1064 struct device_node *phb, *np; 1064 struct device_node *phb, *np;
1065 struct eeh_early_enable_info info; 1065 struct eeh_early_enable_info info;
1066 1066
1067 spin_lock_init(&confirm_error_lock); 1067 raw_spin_lock_init(&confirm_error_lock);
1068 spin_lock_init(&slot_errbuf_lock); 1068 spin_lock_init(&slot_errbuf_lock);
1069 1069
1070 np = of_find_node_by_path("/rtas"); 1070 np = of_find_node_by_path("/rtas");
diff --git a/arch/powerpc/platforms/pseries/eeh_driver.c b/arch/powerpc/platforms/pseries/eeh_driver.c
index ef8e45448480..b8d70f5d9aa9 100644
--- a/arch/powerpc/platforms/pseries/eeh_driver.c
+++ b/arch/powerpc/platforms/pseries/eeh_driver.c
@@ -337,7 +337,7 @@ struct pci_dn * handle_eeh_events (struct eeh_event *event)
337 location = location ? location : "unknown"; 337 location = location ? location : "unknown";
338 printk(KERN_ERR "EEH: Error: Cannot find partition endpoint " 338 printk(KERN_ERR "EEH: Error: Cannot find partition endpoint "
339 "for location=%s pci addr=%s\n", 339 "for location=%s pci addr=%s\n",
340 location, pci_name(event->dev)); 340 location, eeh_pci_name(event->dev));
341 return NULL; 341 return NULL;
342 } 342 }
343 343
@@ -368,7 +368,7 @@ struct pci_dn * handle_eeh_events (struct eeh_event *event)
368 pci_str = pci_name (frozen_pdn->pcidev); 368 pci_str = pci_name (frozen_pdn->pcidev);
369 drv_str = pcid_name (frozen_pdn->pcidev); 369 drv_str = pcid_name (frozen_pdn->pcidev);
370 } else { 370 } else {
371 pci_str = pci_name (event->dev); 371 pci_str = eeh_pci_name(event->dev);
372 drv_str = pcid_name (event->dev); 372 drv_str = pcid_name (event->dev);
373 } 373 }
374 374
@@ -478,9 +478,9 @@ excess_failures:
478 * due to actual, failed cards. 478 * due to actual, failed cards.
479 */ 479 */
480 printk(KERN_ERR 480 printk(KERN_ERR
481 "EEH: PCI device at location=%s driver=%s pci addr=%s \n" 481 "EEH: PCI device at location=%s driver=%s pci addr=%s\n"
482 "has failed %d times in the last hour " 482 "has failed %d times in the last hour "
483 "and has been permanently disabled. \n" 483 "and has been permanently disabled.\n"
484 "Please try reseating this device or replacing it.\n", 484 "Please try reseating this device or replacing it.\n",
485 location, drv_str, pci_str, frozen_pdn->eeh_freeze_count); 485 location, drv_str, pci_str, frozen_pdn->eeh_freeze_count);
486 goto perm_error; 486 goto perm_error;
@@ -488,7 +488,7 @@ excess_failures:
488hard_fail: 488hard_fail:
489 printk(KERN_ERR 489 printk(KERN_ERR
490 "EEH: Unable to recover from failure of PCI device " 490 "EEH: Unable to recover from failure of PCI device "
491 "at location=%s driver=%s pci addr=%s \n" 491 "at location=%s driver=%s pci addr=%s\n"
492 "Please try reseating this device or replacing it.\n", 492 "Please try reseating this device or replacing it.\n",
493 location, drv_str, pci_str); 493 location, drv_str, pci_str);
494 494
diff --git a/arch/powerpc/platforms/pseries/eeh_event.c b/arch/powerpc/platforms/pseries/eeh_event.c
index ddb80f5d850b..ec5df8f519c7 100644
--- a/arch/powerpc/platforms/pseries/eeh_event.c
+++ b/arch/powerpc/platforms/pseries/eeh_event.c
@@ -80,7 +80,7 @@ static int eeh_event_handler(void * dummy)
80 eeh_mark_slot(event->dn, EEH_MODE_RECOVERING); 80 eeh_mark_slot(event->dn, EEH_MODE_RECOVERING);
81 81
82 printk(KERN_INFO "EEH: Detected PCI bus error on device %s\n", 82 printk(KERN_INFO "EEH: Detected PCI bus error on device %s\n",
83 pci_name(event->dev)); 83 eeh_pci_name(event->dev));
84 84
85 pdn = handle_eeh_events(event); 85 pdn = handle_eeh_events(event);
86 86
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index 6ea4698d9176..d1b124e44d77 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -387,24 +387,12 @@ static char cede_parameters[CEDE_LATENCY_PARAM_MAX_LENGTH];
387 387
388static int parse_cede_parameters(void) 388static int parse_cede_parameters(void)
389{ 389{
390 int call_status;
391
392 memset(cede_parameters, 0, CEDE_LATENCY_PARAM_MAX_LENGTH); 390 memset(cede_parameters, 0, CEDE_LATENCY_PARAM_MAX_LENGTH);
393 call_status = rtas_call(rtas_token("ibm,get-system-parameter"), 3, 1, 391 return rtas_call(rtas_token("ibm,get-system-parameter"), 3, 1,
394 NULL, 392 NULL,
395 CEDE_LATENCY_TOKEN, 393 CEDE_LATENCY_TOKEN,
396 __pa(cede_parameters), 394 __pa(cede_parameters),
397 CEDE_LATENCY_PARAM_MAX_LENGTH); 395 CEDE_LATENCY_PARAM_MAX_LENGTH);
398
399 if (call_status != 0)
400 printk(KERN_INFO "CEDE_LATENCY: \
401 %s %s Error calling get-system-parameter(0x%x)\n",
402 __FILE__, __func__, call_status);
403 else
404 printk(KERN_INFO "CEDE_LATENCY: \
405 get-system-parameter successful.\n");
406
407 return call_status;
408} 396}
409 397
410static int __init pseries_cpu_hotplug_init(void) 398static int __init pseries_cpu_hotplug_init(void)
diff --git a/arch/powerpc/platforms/pseries/hvCall_inst.c b/arch/powerpc/platforms/pseries/hvCall_inst.c
index 2f58c71b7259..1fefae76e295 100644
--- a/arch/powerpc/platforms/pseries/hvCall_inst.c
+++ b/arch/powerpc/platforms/pseries/hvCall_inst.c
@@ -124,8 +124,8 @@ static void probe_hcall_exit(unsigned long opcode, unsigned long retval,
124 124
125 h = &__get_cpu_var(hcall_stats)[opcode / 4]; 125 h = &__get_cpu_var(hcall_stats)[opcode / 4];
126 h->num_calls++; 126 h->num_calls++;
127 h->tb_total = mftb() - h->tb_start; 127 h->tb_total += mftb() - h->tb_start;
128 h->purr_total = mfspr(SPRN_PURR) - h->purr_start; 128 h->purr_total += mfspr(SPRN_PURR) - h->purr_start;
129 129
130 put_cpu_var(hcall_stats); 130 put_cpu_var(hcall_stats);
131} 131}
diff --git a/arch/powerpc/platforms/pseries/pci_dlpar.c b/arch/powerpc/platforms/pseries/pci_dlpar.c
index b6fa3e4b51b5..4b7a062dee15 100644
--- a/arch/powerpc/platforms/pseries/pci_dlpar.c
+++ b/arch/powerpc/platforms/pseries/pci_dlpar.c
@@ -165,7 +165,7 @@ int remove_phb_dynamic(struct pci_controller *phb)
165 struct resource *res; 165 struct resource *res;
166 int rc, i; 166 int rc, i;
167 167
168 pr_debug("PCI: Removing PHB %04x:%02x... \n", 168 pr_debug("PCI: Removing PHB %04x:%02x...\n",
169 pci_domain_nr(b), b->number); 169 pci_domain_nr(b), b->number);
170 170
171 /* We cannot to remove a root bus that has children */ 171 /* We cannot to remove a root bus that has children */
diff --git a/arch/powerpc/platforms/pseries/phyp_dump.c b/arch/powerpc/platforms/pseries/phyp_dump.c
index 15eb6107bcd2..225a50ab14be 100644
--- a/arch/powerpc/platforms/pseries/phyp_dump.c
+++ b/arch/powerpc/platforms/pseries/phyp_dump.c
@@ -150,7 +150,7 @@ static void print_dump_header(const struct phyp_dump_header *ph)
150 printk(KERN_INFO "Max auto time= %d\n", ph->maxtime_to_auto); 150 printk(KERN_INFO "Max auto time= %d\n", ph->maxtime_to_auto);
151 151
152 /*set cpu state and hpte states as well scratch pad area */ 152 /*set cpu state and hpte states as well scratch pad area */
153 printk(KERN_INFO " CPU AREA \n"); 153 printk(KERN_INFO " CPU AREA\n");
154 printk(KERN_INFO "cpu dump_flags =%d\n", ph->cpu_data.dump_flags); 154 printk(KERN_INFO "cpu dump_flags =%d\n", ph->cpu_data.dump_flags);
155 printk(KERN_INFO "cpu source_type =%d\n", ph->cpu_data.source_type); 155 printk(KERN_INFO "cpu source_type =%d\n", ph->cpu_data.source_type);
156 printk(KERN_INFO "cpu error_flags =%d\n", ph->cpu_data.error_flags); 156 printk(KERN_INFO "cpu error_flags =%d\n", ph->cpu_data.error_flags);
@@ -161,7 +161,7 @@ static void print_dump_header(const struct phyp_dump_header *ph)
161 printk(KERN_INFO "cpu length_copied =%llx\n", 161 printk(KERN_INFO "cpu length_copied =%llx\n",
162 ph->cpu_data.length_copied); 162 ph->cpu_data.length_copied);
163 163
164 printk(KERN_INFO " HPTE AREA \n"); 164 printk(KERN_INFO " HPTE AREA\n");
165 printk(KERN_INFO "HPTE dump_flags =%d\n", ph->hpte_data.dump_flags); 165 printk(KERN_INFO "HPTE dump_flags =%d\n", ph->hpte_data.dump_flags);
166 printk(KERN_INFO "HPTE source_type =%d\n", ph->hpte_data.source_type); 166 printk(KERN_INFO "HPTE source_type =%d\n", ph->hpte_data.source_type);
167 printk(KERN_INFO "HPTE error_flags =%d\n", ph->hpte_data.error_flags); 167 printk(KERN_INFO "HPTE error_flags =%d\n", ph->hpte_data.error_flags);
@@ -172,7 +172,7 @@ static void print_dump_header(const struct phyp_dump_header *ph)
172 printk(KERN_INFO "HPTE length_copied =%llx\n", 172 printk(KERN_INFO "HPTE length_copied =%llx\n",
173 ph->hpte_data.length_copied); 173 ph->hpte_data.length_copied);
174 174
175 printk(KERN_INFO " SRSD AREA \n"); 175 printk(KERN_INFO " SRSD AREA\n");
176 printk(KERN_INFO "SRSD dump_flags =%d\n", ph->kernel_data.dump_flags); 176 printk(KERN_INFO "SRSD dump_flags =%d\n", ph->kernel_data.dump_flags);
177 printk(KERN_INFO "SRSD source_type =%d\n", ph->kernel_data.source_type); 177 printk(KERN_INFO "SRSD source_type =%d\n", ph->kernel_data.source_type);
178 printk(KERN_INFO "SRSD error_flags =%d\n", ph->kernel_data.error_flags); 178 printk(KERN_INFO "SRSD error_flags =%d\n", ph->kernel_data.error_flags);
diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c
index b4886635972c..4e7f89a84561 100644
--- a/arch/powerpc/platforms/pseries/smp.c
+++ b/arch/powerpc/platforms/pseries/smp.c
@@ -144,8 +144,8 @@ static void __devinit smp_pSeries_kick_cpu(int nr)
144 hcpuid = get_hard_smp_processor_id(nr); 144 hcpuid = get_hard_smp_processor_id(nr);
145 rc = plpar_hcall_norets(H_PROD, hcpuid); 145 rc = plpar_hcall_norets(H_PROD, hcpuid);
146 if (rc != H_SUCCESS) 146 if (rc != H_SUCCESS)
147 printk(KERN_ERR "Error: Prod to wake up processor %d\ 147 printk(KERN_ERR "Error: Prod to wake up processor %d "
148 Ret= %ld\n", nr, rc); 148 "Ret= %ld\n", nr, rc);
149 } 149 }
150} 150}
151 151
diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c
index f5f79196721c..4ca641042ec3 100644
--- a/arch/powerpc/platforms/pseries/xics.c
+++ b/arch/powerpc/platforms/pseries/xics.c
@@ -127,7 +127,7 @@ static inline unsigned int lpar_xirr_info_get(void)
127 127
128 lpar_rc = plpar_xirr(&return_value); 128 lpar_rc = plpar_xirr(&return_value);
129 if (lpar_rc != H_SUCCESS) 129 if (lpar_rc != H_SUCCESS)
130 panic(" bad return code xirr - rc = %lx \n", lpar_rc); 130 panic(" bad return code xirr - rc = %lx\n", lpar_rc);
131 return (unsigned int)return_value; 131 return (unsigned int)return_value;
132} 132}
133 133
@@ -424,7 +424,7 @@ static int xics_set_affinity(unsigned int virq, const struct cpumask *cpumask)
424} 424}
425 425
426static struct irq_chip xics_pic_direct = { 426static struct irq_chip xics_pic_direct = {
427 .name = " XICS ", 427 .name = "XICS",
428 .startup = xics_startup, 428 .startup = xics_startup,
429 .mask = xics_mask_irq, 429 .mask = xics_mask_irq,
430 .unmask = xics_unmask_irq, 430 .unmask = xics_unmask_irq,
@@ -433,7 +433,7 @@ static struct irq_chip xics_pic_direct = {
433}; 433};
434 434
435static struct irq_chip xics_pic_lpar = { 435static struct irq_chip xics_pic_lpar = {
436 .name = " XICS ", 436 .name = "XICS",
437 .startup = xics_startup, 437 .startup = xics_startup,
438 .mask = xics_mask_irq, 438 .mask = xics_mask_irq,
439 .unmask = xics_unmask_irq, 439 .unmask = xics_unmask_irq,
@@ -510,15 +510,13 @@ static void __init xics_init_host(void)
510/* 510/*
511 * XICS only has a single IPI, so encode the messages per CPU 511 * XICS only has a single IPI, so encode the messages per CPU
512 */ 512 */
513struct xics_ipi_struct { 513static DEFINE_PER_CPU_SHARED_ALIGNED(unsigned long, xics_ipi_message);
514 unsigned long value;
515 } ____cacheline_aligned;
516
517static struct xics_ipi_struct xics_ipi_message[NR_CPUS] __cacheline_aligned;
518 514
519static inline void smp_xics_do_message(int cpu, int msg) 515static inline void smp_xics_do_message(int cpu, int msg)
520{ 516{
521 set_bit(msg, &xics_ipi_message[cpu].value); 517 unsigned long *tgt = &per_cpu(xics_ipi_message, cpu);
518
519 set_bit(msg, tgt);
522 mb(); 520 mb();
523 if (firmware_has_feature(FW_FEATURE_LPAR)) 521 if (firmware_has_feature(FW_FEATURE_LPAR))
524 lpar_qirr_info(cpu, IPI_PRIORITY); 522 lpar_qirr_info(cpu, IPI_PRIORITY);
@@ -544,25 +542,23 @@ void smp_xics_message_pass(int target, int msg)
544 542
545static irqreturn_t xics_ipi_dispatch(int cpu) 543static irqreturn_t xics_ipi_dispatch(int cpu)
546{ 544{
545 unsigned long *tgt = &per_cpu(xics_ipi_message, cpu);
546
547 WARN_ON(cpu_is_offline(cpu)); 547 WARN_ON(cpu_is_offline(cpu));
548 548
549 mb(); /* order mmio clearing qirr */ 549 mb(); /* order mmio clearing qirr */
550 while (xics_ipi_message[cpu].value) { 550 while (*tgt) {
551 if (test_and_clear_bit(PPC_MSG_CALL_FUNCTION, 551 if (test_and_clear_bit(PPC_MSG_CALL_FUNCTION, tgt)) {
552 &xics_ipi_message[cpu].value)) {
553 smp_message_recv(PPC_MSG_CALL_FUNCTION); 552 smp_message_recv(PPC_MSG_CALL_FUNCTION);
554 } 553 }
555 if (test_and_clear_bit(PPC_MSG_RESCHEDULE, 554 if (test_and_clear_bit(PPC_MSG_RESCHEDULE, tgt)) {
556 &xics_ipi_message[cpu].value)) {
557 smp_message_recv(PPC_MSG_RESCHEDULE); 555 smp_message_recv(PPC_MSG_RESCHEDULE);
558 } 556 }
559 if (test_and_clear_bit(PPC_MSG_CALL_FUNC_SINGLE, 557 if (test_and_clear_bit(PPC_MSG_CALL_FUNC_SINGLE, tgt)) {
560 &xics_ipi_message[cpu].value)) {
561 smp_message_recv(PPC_MSG_CALL_FUNC_SINGLE); 558 smp_message_recv(PPC_MSG_CALL_FUNC_SINGLE);
562 } 559 }
563#if defined(CONFIG_DEBUGGER) || defined(CONFIG_KEXEC) 560#if defined(CONFIG_DEBUGGER) || defined(CONFIG_KEXEC)
564 if (test_and_clear_bit(PPC_MSG_DEBUGGER_BREAK, 561 if (test_and_clear_bit(PPC_MSG_DEBUGGER_BREAK, tgt)) {
565 &xics_ipi_message[cpu].value)) {
566 smp_message_recv(PPC_MSG_DEBUGGER_BREAK); 562 smp_message_recv(PPC_MSG_DEBUGGER_BREAK);
567 } 563 }
568#endif 564#endif