diff options
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r-- | arch/powerpc/platforms/85xx/mpc85xx_mds.c | 3 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/smp.c | 21 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/coredump.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/iseries/vio.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/dlpar.c | 18 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/xics.c | 28 |
6 files changed, 44 insertions, 30 deletions
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c index 21f61b8c445b..cc29c0f5300d 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c | |||
@@ -338,7 +338,8 @@ static void __init mpc85xx_mds_pic_init(void) | |||
338 | } | 338 | } |
339 | 339 | ||
340 | mpic = mpic_alloc(np, r.start, | 340 | mpic = mpic_alloc(np, r.start, |
341 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, | 341 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN | |
342 | MPIC_BROKEN_FRR_NIRQS, | ||
342 | 0, 256, " OpenPIC "); | 343 | 0, 256, " OpenPIC "); |
343 | BUG_ON(mpic == NULL); | 344 | BUG_ON(mpic == NULL); |
344 | of_node_put(np); | 345 | of_node_put(np); |
diff --git a/arch/powerpc/platforms/85xx/smp.c b/arch/powerpc/platforms/85xx/smp.c index 04160a4cc699..a15f582300d8 100644 --- a/arch/powerpc/platforms/85xx/smp.c +++ b/arch/powerpc/platforms/85xx/smp.c | |||
@@ -46,6 +46,7 @@ smp_85xx_kick_cpu(int nr) | |||
46 | __iomem u32 *bptr_vaddr; | 46 | __iomem u32 *bptr_vaddr; |
47 | struct device_node *np; | 47 | struct device_node *np; |
48 | int n = 0; | 48 | int n = 0; |
49 | int ioremappable; | ||
49 | 50 | ||
50 | WARN_ON (nr < 0 || nr >= NR_CPUS); | 51 | WARN_ON (nr < 0 || nr >= NR_CPUS); |
51 | 52 | ||
@@ -59,21 +60,37 @@ smp_85xx_kick_cpu(int nr) | |||
59 | return; | 60 | return; |
60 | } | 61 | } |
61 | 62 | ||
63 | /* | ||
64 | * A secondary core could be in a spinloop in the bootpage | ||
65 | * (0xfffff000), somewhere in highmem, or somewhere in lowmem. | ||
66 | * The bootpage and highmem can be accessed via ioremap(), but | ||
67 | * we need to directly access the spinloop if its in lowmem. | ||
68 | */ | ||
69 | ioremappable = *cpu_rel_addr > virt_to_phys(high_memory); | ||
70 | |||
62 | /* Map the spin table */ | 71 | /* Map the spin table */ |
63 | bptr_vaddr = ioremap(*cpu_rel_addr, SIZE_BOOT_ENTRY); | 72 | if (ioremappable) |
73 | bptr_vaddr = ioremap(*cpu_rel_addr, SIZE_BOOT_ENTRY); | ||
74 | else | ||
75 | bptr_vaddr = phys_to_virt(*cpu_rel_addr); | ||
64 | 76 | ||
65 | local_irq_save(flags); | 77 | local_irq_save(flags); |
66 | 78 | ||
67 | out_be32(bptr_vaddr + BOOT_ENTRY_PIR, nr); | 79 | out_be32(bptr_vaddr + BOOT_ENTRY_PIR, nr); |
68 | out_be32(bptr_vaddr + BOOT_ENTRY_ADDR_LOWER, __pa(__early_start)); | 80 | out_be32(bptr_vaddr + BOOT_ENTRY_ADDR_LOWER, __pa(__early_start)); |
69 | 81 | ||
82 | if (!ioremappable) | ||
83 | flush_dcache_range((ulong)bptr_vaddr, | ||
84 | (ulong)(bptr_vaddr + SIZE_BOOT_ENTRY)); | ||
85 | |||
70 | /* Wait a bit for the CPU to ack. */ | 86 | /* Wait a bit for the CPU to ack. */ |
71 | while ((__secondary_hold_acknowledge != nr) && (++n < 1000)) | 87 | while ((__secondary_hold_acknowledge != nr) && (++n < 1000)) |
72 | mdelay(1); | 88 | mdelay(1); |
73 | 89 | ||
74 | local_irq_restore(flags); | 90 | local_irq_restore(flags); |
75 | 91 | ||
76 | iounmap(bptr_vaddr); | 92 | if (ioremappable) |
93 | iounmap(bptr_vaddr); | ||
77 | 94 | ||
78 | pr_debug("waited %d msecs for CPU #%d.\n", n, nr); | 95 | pr_debug("waited %d msecs for CPU #%d.\n", n, nr); |
79 | } | 96 | } |
diff --git a/arch/powerpc/platforms/cell/spufs/coredump.c b/arch/powerpc/platforms/cell/spufs/coredump.c index c4d4a19235e0..eea120229cdb 100644 --- a/arch/powerpc/platforms/cell/spufs/coredump.c +++ b/arch/powerpc/platforms/cell/spufs/coredump.c | |||
@@ -54,7 +54,7 @@ static ssize_t do_coredump_read(int num, struct spu_context *ctx, void *buffer, | |||
54 | */ | 54 | */ |
55 | static int spufs_dump_write(struct file *file, const void *addr, int nr, loff_t *foffset) | 55 | static int spufs_dump_write(struct file *file, const void *addr, int nr, loff_t *foffset) |
56 | { | 56 | { |
57 | unsigned long limit = current->signal->rlim[RLIMIT_CORE].rlim_cur; | 57 | unsigned long limit = rlimit(RLIMIT_CORE); |
58 | ssize_t written; | 58 | ssize_t written; |
59 | 59 | ||
60 | if (*foffset + nr > limit) | 60 | if (*foffset + nr > limit) |
diff --git a/arch/powerpc/platforms/iseries/vio.c b/arch/powerpc/platforms/iseries/vio.c index 657b72f68493..2aa8b5631beb 100644 --- a/arch/powerpc/platforms/iseries/vio.c +++ b/arch/powerpc/platforms/iseries/vio.c | |||
@@ -474,6 +474,8 @@ static void __init get_viotape_info(struct device_node *vio_root) | |||
474 | struct vio_waitevent we; | 474 | struct vio_waitevent we; |
475 | int ret; | 475 | int ret; |
476 | 476 | ||
477 | init_completion(&we.com); | ||
478 | |||
477 | ret = viopath_open(viopath_hostLp, viomajorsubtype_tape, 2); | 479 | ret = viopath_open(viopath_hostLp, viomajorsubtype_tape, 2); |
478 | if (ret) { | 480 | if (ret) { |
479 | printk(KERN_WARNING "get_viotape_info: " | 481 | printk(KERN_WARNING "get_viotape_info: " |
diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c index 67b7a10f9fce..37bce52526da 100644 --- a/arch/powerpc/platforms/pseries/dlpar.c +++ b/arch/powerpc/platforms/pseries/dlpar.c | |||
@@ -236,7 +236,9 @@ static struct device_node *derive_parent(const char *path) | |||
236 | 236 | ||
237 | int dlpar_attach_node(struct device_node *dn) | 237 | int dlpar_attach_node(struct device_node *dn) |
238 | { | 238 | { |
239 | #ifdef CONFIG_PROC_DEVICETREE | ||
239 | struct proc_dir_entry *ent; | 240 | struct proc_dir_entry *ent; |
241 | #endif | ||
240 | int rc; | 242 | int rc; |
241 | 243 | ||
242 | of_node_set_flag(dn, OF_DYNAMIC); | 244 | of_node_set_flag(dn, OF_DYNAMIC); |
@@ -267,10 +269,10 @@ int dlpar_attach_node(struct device_node *dn) | |||
267 | 269 | ||
268 | int dlpar_detach_node(struct device_node *dn) | 270 | int dlpar_detach_node(struct device_node *dn) |
269 | { | 271 | { |
272 | #ifdef CONFIG_PROC_DEVICETREE | ||
270 | struct device_node *parent = dn->parent; | 273 | struct device_node *parent = dn->parent; |
271 | struct property *prop = dn->properties; | 274 | struct property *prop = dn->properties; |
272 | 275 | ||
273 | #ifdef CONFIG_PROC_DEVICETREE | ||
274 | while (prop) { | 276 | while (prop) { |
275 | remove_proc_entry(prop->name, dn->pde); | 277 | remove_proc_entry(prop->name, dn->pde); |
276 | prop = prop->next; | 278 | prop = prop->next; |
@@ -344,20 +346,6 @@ int dlpar_release_drc(u32 drc_index) | |||
344 | 346 | ||
345 | #ifdef CONFIG_ARCH_CPU_PROBE_RELEASE | 347 | #ifdef CONFIG_ARCH_CPU_PROBE_RELEASE |
346 | 348 | ||
347 | static DEFINE_MUTEX(pseries_cpu_hotplug_mutex); | ||
348 | |||
349 | void cpu_hotplug_driver_lock(void) | ||
350 | __acquires(pseries_cpu_hotplug_mutex) | ||
351 | { | ||
352 | mutex_lock(&pseries_cpu_hotplug_mutex); | ||
353 | } | ||
354 | |||
355 | void cpu_hotplug_driver_unlock(void) | ||
356 | __releases(pseries_cpu_hotplug_mutex) | ||
357 | { | ||
358 | mutex_unlock(&pseries_cpu_hotplug_mutex); | ||
359 | } | ||
360 | |||
361 | static int dlpar_online_cpu(struct device_node *dn) | 349 | static int dlpar_online_cpu(struct device_node *dn) |
362 | { | 350 | { |
363 | int rc = 0; | 351 | int rc = 0; |
diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c index b9b9e11609ec..f5f79196721c 100644 --- a/arch/powerpc/platforms/pseries/xics.c +++ b/arch/powerpc/platforms/pseries/xics.c | |||
@@ -163,14 +163,13 @@ static inline void lpar_qirr_info(int n_cpu , u8 value) | |||
163 | /* Interface to generic irq subsystem */ | 163 | /* Interface to generic irq subsystem */ |
164 | 164 | ||
165 | #ifdef CONFIG_SMP | 165 | #ifdef CONFIG_SMP |
166 | static int get_irq_server(unsigned int virq, unsigned int strict_check) | 166 | static int get_irq_server(unsigned int virq, cpumask_t cpumask, |
167 | unsigned int strict_check) | ||
167 | { | 168 | { |
168 | int server; | 169 | int server; |
169 | /* For the moment only implement delivery to all cpus or one cpu */ | 170 | /* For the moment only implement delivery to all cpus or one cpu */ |
170 | cpumask_t cpumask; | ||
171 | cpumask_t tmp = CPU_MASK_NONE; | 171 | cpumask_t tmp = CPU_MASK_NONE; |
172 | 172 | ||
173 | cpumask_copy(&cpumask, irq_to_desc(virq)->affinity); | ||
174 | if (!distribute_irqs) | 173 | if (!distribute_irqs) |
175 | return default_server; | 174 | return default_server; |
176 | 175 | ||
@@ -192,10 +191,7 @@ static int get_irq_server(unsigned int virq, unsigned int strict_check) | |||
192 | return default_server; | 191 | return default_server; |
193 | } | 192 | } |
194 | #else | 193 | #else |
195 | static int get_irq_server(unsigned int virq, unsigned int strict_check) | 194 | #define get_irq_server(virq, cpumask, strict_check) (default_server) |
196 | { | ||
197 | return default_server; | ||
198 | } | ||
199 | #endif | 195 | #endif |
200 | 196 | ||
201 | static void xics_unmask_irq(unsigned int virq) | 197 | static void xics_unmask_irq(unsigned int virq) |
@@ -211,7 +207,7 @@ static void xics_unmask_irq(unsigned int virq) | |||
211 | if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS) | 207 | if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS) |
212 | return; | 208 | return; |
213 | 209 | ||
214 | server = get_irq_server(virq, 0); | 210 | server = get_irq_server(virq, *(irq_to_desc(virq)->affinity), 0); |
215 | 211 | ||
216 | call_status = rtas_call(ibm_set_xive, 3, 1, NULL, irq, server, | 212 | call_status = rtas_call(ibm_set_xive, 3, 1, NULL, irq, server, |
217 | DEFAULT_PRIORITY); | 213 | DEFAULT_PRIORITY); |
@@ -405,7 +401,7 @@ static int xics_set_affinity(unsigned int virq, const struct cpumask *cpumask) | |||
405 | * For the moment only implement delivery to all cpus or one cpu. | 401 | * For the moment only implement delivery to all cpus or one cpu. |
406 | * Get current irq_server for the given irq | 402 | * Get current irq_server for the given irq |
407 | */ | 403 | */ |
408 | irq_server = get_irq_server(virq, 1); | 404 | irq_server = get_irq_server(virq, *cpumask, 1); |
409 | if (irq_server == -1) { | 405 | if (irq_server == -1) { |
410 | char cpulist[128]; | 406 | char cpulist[128]; |
411 | cpumask_scnprintf(cpulist, sizeof(cpulist), cpumask); | 407 | cpumask_scnprintf(cpulist, sizeof(cpulist), cpumask); |
@@ -788,9 +784,13 @@ static void xics_set_cpu_priority(unsigned char cppr) | |||
788 | { | 784 | { |
789 | struct xics_cppr *os_cppr = &__get_cpu_var(xics_cppr); | 785 | struct xics_cppr *os_cppr = &__get_cpu_var(xics_cppr); |
790 | 786 | ||
791 | BUG_ON(os_cppr->index != 0); | 787 | /* |
788 | * we only really want to set the priority when there's | ||
789 | * just one cppr value on the stack | ||
790 | */ | ||
791 | WARN_ON(os_cppr->index != 0); | ||
792 | 792 | ||
793 | os_cppr->stack[os_cppr->index] = cppr; | 793 | os_cppr->stack[0] = cppr; |
794 | 794 | ||
795 | if (firmware_has_feature(FW_FEATURE_LPAR)) | 795 | if (firmware_has_feature(FW_FEATURE_LPAR)) |
796 | lpar_cppr_info(cppr); | 796 | lpar_cppr_info(cppr); |
@@ -825,8 +825,14 @@ void xics_setup_cpu(void) | |||
825 | 825 | ||
826 | void xics_teardown_cpu(void) | 826 | void xics_teardown_cpu(void) |
827 | { | 827 | { |
828 | struct xics_cppr *os_cppr = &__get_cpu_var(xics_cppr); | ||
828 | int cpu = smp_processor_id(); | 829 | int cpu = smp_processor_id(); |
829 | 830 | ||
831 | /* | ||
832 | * we have to reset the cppr index to 0 because we're | ||
833 | * not going to return from the IPI | ||
834 | */ | ||
835 | os_cppr->index = 0; | ||
830 | xics_set_cpu_priority(0); | 836 | xics_set_cpu_priority(0); |
831 | 837 | ||
832 | /* Clear any pending IPI request */ | 838 | /* Clear any pending IPI request */ |