aboutsummaryrefslogtreecommitdiffstats
path: root/arch/tile/kernel/smp.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/tile/kernel/smp.c')
-rw-r--r--arch/tile/kernel/smp.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/arch/tile/kernel/smp.c b/arch/tile/kernel/smp.c
index cbc73a8b8fe1..01e8ab29f43a 100644
--- a/arch/tile/kernel/smp.c
+++ b/arch/tile/kernel/smp.c
@@ -20,8 +20,13 @@
20#include <linux/irq.h> 20#include <linux/irq.h>
21#include <linux/module.h> 21#include <linux/module.h>
22#include <asm/cacheflush.h> 22#include <asm/cacheflush.h>
23#include <asm/homecache.h>
23 24
24HV_Topology smp_topology __write_once; 25/*
26 * We write to width and height with a single store in head_NN.S,
27 * so make the variable aligned to "long".
28 */
29HV_Topology smp_topology __write_once __aligned(sizeof(long));
25EXPORT_SYMBOL(smp_topology); 30EXPORT_SYMBOL(smp_topology);
26 31
27#if CHIP_HAS_IPI() 32#if CHIP_HAS_IPI()
@@ -100,8 +105,8 @@ static void smp_start_cpu_interrupt(void)
100/* Handler to stop the current cpu. */ 105/* Handler to stop the current cpu. */
101static void smp_stop_cpu_interrupt(void) 106static void smp_stop_cpu_interrupt(void)
102{ 107{
103 set_cpu_online(smp_processor_id(), 0);
104 arch_local_irq_disable_all(); 108 arch_local_irq_disable_all();
109 set_cpu_online(smp_processor_id(), 0);
105 for (;;) 110 for (;;)
106 asm("nap; nop"); 111 asm("nap; nop");
107} 112}
@@ -167,9 +172,16 @@ static void ipi_flush_icache_range(void *info)
167void flush_icache_range(unsigned long start, unsigned long end) 172void flush_icache_range(unsigned long start, unsigned long end)
168{ 173{
169 struct ipi_flush flush = { start, end }; 174 struct ipi_flush flush = { start, end };
170 preempt_disable(); 175
171 on_each_cpu(ipi_flush_icache_range, &flush, 1); 176 /* If invoked with irqs disabled, we can not issue IPIs. */
172 preempt_enable(); 177 if (irqs_disabled())
178 flush_remote(0, HV_FLUSH_EVICT_L1I, NULL, 0, 0, 0,
179 NULL, NULL, 0);
180 else {
181 preempt_disable();
182 on_each_cpu(ipi_flush_icache_range, &flush, 1);
183 preempt_enable();
184 }
173} 185}
174 186
175 187