aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/smtc.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/kernel/smtc.c')
-rw-r--r--arch/mips/kernel/smtc.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/arch/mips/kernel/smtc.c b/arch/mips/kernel/smtc.c
index 24630fd8ef60..a95dea5459c4 100644
--- a/arch/mips/kernel/smtc.c
+++ b/arch/mips/kernel/smtc.c
@@ -25,6 +25,8 @@
25#include <linux/interrupt.h> 25#include <linux/interrupt.h>
26#include <linux/kernel_stat.h> 26#include <linux/kernel_stat.h>
27#include <linux/module.h> 27#include <linux/module.h>
28#include <linux/ftrace.h>
29#include <linux/slab.h>
28 30
29#include <asm/cpu.h> 31#include <asm/cpu.h>
30#include <asm/processor.h> 32#include <asm/processor.h>
@@ -180,7 +182,7 @@ static int vpemask[2][8] = {
180 {0, 0, 0, 0, 0, 0, 0, 1} 182 {0, 0, 0, 0, 0, 0, 0, 1}
181}; 183};
182int tcnoprog[NR_CPUS]; 184int tcnoprog[NR_CPUS];
183static atomic_t idle_hook_initialized = {0}; 185static atomic_t idle_hook_initialized = ATOMIC_INIT(0);
184static int clock_hang_reported[NR_CPUS]; 186static int clock_hang_reported[NR_CPUS];
185 187
186#endif /* CONFIG_SMTC_IDLE_HOOK_DEBUG */ 188#endif /* CONFIG_SMTC_IDLE_HOOK_DEBUG */
@@ -939,23 +941,29 @@ static void ipi_call_interrupt(void)
939 941
940DECLARE_PER_CPU(struct clock_event_device, mips_clockevent_device); 942DECLARE_PER_CPU(struct clock_event_device, mips_clockevent_device);
941 943
942void ipi_decode(struct smtc_ipi *pipi) 944static void __irq_entry smtc_clock_tick_interrupt(void)
943{ 945{
944 unsigned int cpu = smp_processor_id(); 946 unsigned int cpu = smp_processor_id();
945 struct clock_event_device *cd; 947 struct clock_event_device *cd;
948 int irq = MIPS_CPU_IRQ_BASE + 1;
949
950 irq_enter();
951 kstat_incr_irqs_this_cpu(irq, irq_to_desc(irq));
952 cd = &per_cpu(mips_clockevent_device, cpu);
953 cd->event_handler(cd);
954 irq_exit();
955}
956
957void ipi_decode(struct smtc_ipi *pipi)
958{
946 void *arg_copy = pipi->arg; 959 void *arg_copy = pipi->arg;
947 int type_copy = pipi->type; 960 int type_copy = pipi->type;
948 int irq = MIPS_CPU_IRQ_BASE + 1;
949 961
950 smtc_ipi_nq(&freeIPIq, pipi); 962 smtc_ipi_nq(&freeIPIq, pipi);
951 963
952 switch (type_copy) { 964 switch (type_copy) {
953 case SMTC_CLOCK_TICK: 965 case SMTC_CLOCK_TICK:
954 irq_enter(); 966 smtc_clock_tick_interrupt();
955 kstat_incr_irqs_this_cpu(irq, irq_to_desc(irq));
956 cd = &per_cpu(mips_clockevent_device, cpu);
957 cd->event_handler(cd);
958 irq_exit();
959 break; 967 break;
960 968
961 case LINUX_SMP_IPI: 969 case LINUX_SMP_IPI:
@@ -1331,7 +1339,7 @@ void smtc_get_new_mmu_context(struct mm_struct *mm, unsigned long cpu)
1331 if (!((asid += ASID_INC) & ASID_MASK) ) { 1339 if (!((asid += ASID_INC) & ASID_MASK) ) {
1332 if (cpu_has_vtag_icache) 1340 if (cpu_has_vtag_icache)
1333 flush_icache_all(); 1341 flush_icache_all();
1334 /* Traverse all online CPUs (hack requires contigous range) */ 1342 /* Traverse all online CPUs (hack requires contiguous range) */
1335 for_each_online_cpu(i) { 1343 for_each_online_cpu(i) {
1336 /* 1344 /*
1337 * We don't need to worry about our own CPU, nor those of 1345 * We don't need to worry about our own CPU, nor those of