aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
authorRich Felker <dalias@libc.org>2016-02-12 17:05:11 -0500
committerRich Felker <dalias@libc.org>2016-03-17 15:46:09 -0400
commit45624ac38926c8c2f1a63b4a39e7b1997743e1b3 (patch)
tree75b4a24dd31fc8a6101985f5f7d6ba865de00e54 /arch/sh
parent5f2cb34d034fab41dfaabb4403af6e83e04f30df (diff)
sh: remove arch-specific localtimer and use generic one
The code being removed was copied from arm, where the corresponding code was removed in 2013. The only functional change should be that the rating of the dummy local timer changes from 400 to 100. Signed-off-by: Rich Felker <dalias@libc.org>
Diffstat (limited to 'arch/sh')
-rw-r--r--arch/sh/Kconfig1
-rw-r--r--arch/sh/kernel/Makefile1
-rw-r--r--arch/sh/kernel/localtimer.c60
-rw-r--r--arch/sh/kernel/smp.c16
4 files changed, 8 insertions, 70 deletions
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index e13da05505dc..9aabc96aed03 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -1,5 +1,6 @@
1config SUPERH 1config SUPERH
2 def_bool y 2 def_bool y
3 select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
3 select ARCH_MIGHT_HAVE_PC_PARPORT 4 select ARCH_MIGHT_HAVE_PC_PARPORT
4 select HAVE_PATA_PLATFORM 5 select HAVE_PATA_PLATFORM
5 select CLKDEV_LOOKUP 6 select CLKDEV_LOOKUP
diff --git a/arch/sh/kernel/Makefile b/arch/sh/kernel/Makefile
index 2ccf36c824c6..09040fd07d2e 100644
--- a/arch/sh/kernel/Makefile
+++ b/arch/sh/kernel/Makefile
@@ -46,6 +46,5 @@ obj-$(CONFIG_DWARF_UNWINDER) += dwarf.o
46obj-$(CONFIG_PERF_EVENTS) += perf_event.o perf_callchain.o 46obj-$(CONFIG_PERF_EVENTS) += perf_event.o perf_callchain.o
47 47
48obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o 48obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o
49obj-$(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST) += localtimer.o
50 49
51ccflags-y := -Werror 50ccflags-y := -Werror
diff --git a/arch/sh/kernel/localtimer.c b/arch/sh/kernel/localtimer.c
deleted file mode 100644
index cbb7d4636ec0..000000000000
--- a/arch/sh/kernel/localtimer.c
+++ /dev/null
@@ -1,60 +0,0 @@
1/*
2 * Dummy local timer
3 *
4 * Copyright (C) 2008 Paul Mundt
5 *
6 * cloned from:
7 *
8 * linux/arch/arm/mach-realview/localtimer.c
9 *
10 * Copyright (C) 2002 ARM Ltd.
11 * All Rights Reserved
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License version 2 as
15 * published by the Free Software Foundation.
16 */
17#include <linux/init.h>
18#include <linux/kernel.h>
19#include <linux/delay.h>
20#include <linux/device.h>
21#include <linux/smp.h>
22#include <linux/jiffies.h>
23#include <linux/percpu.h>
24#include <linux/clockchips.h>
25#include <linux/hardirq.h>
26#include <linux/irq.h>
27
28static DEFINE_PER_CPU(struct clock_event_device, local_clockevent);
29
30/*
31 * Used on SMP for either the local timer or SMP_MSG_TIMER
32 */
33void local_timer_interrupt(void)
34{
35 struct clock_event_device *clk = this_cpu_ptr(&local_clockevent);
36
37 irq_enter();
38 clk->event_handler(clk);
39 irq_exit();
40}
41
42void local_timer_setup(unsigned int cpu)
43{
44 struct clock_event_device *clk = &per_cpu(local_clockevent, cpu);
45
46 clk->name = "dummy_timer";
47 clk->features = CLOCK_EVT_FEAT_ONESHOT |
48 CLOCK_EVT_FEAT_PERIODIC |
49 CLOCK_EVT_FEAT_DUMMY;
50 clk->rating = 400;
51 clk->mult = 1;
52 clk->broadcast = smp_timer_broadcast;
53 clk->cpumask = cpumask_of(cpu);
54
55 clockevents_register_device(clk);
56}
57
58void local_timer_stop(unsigned int cpu)
59{
60}
diff --git a/arch/sh/kernel/smp.c b/arch/sh/kernel/smp.c
index a66f2aa53dac..cbfb98802378 100644
--- a/arch/sh/kernel/smp.c
+++ b/arch/sh/kernel/smp.c
@@ -22,6 +22,7 @@
22#include <linux/interrupt.h> 22#include <linux/interrupt.h>
23#include <linux/sched.h> 23#include <linux/sched.h>
24#include <linux/atomic.h> 24#include <linux/atomic.h>
25#include <linux/clockchips.h>
25#include <asm/processor.h> 26#include <asm/processor.h>
26#include <asm/mmu_context.h> 27#include <asm/mmu_context.h>
27#include <asm/smp.h> 28#include <asm/smp.h>
@@ -141,11 +142,6 @@ int __cpu_disable(void)
141 migrate_irqs(); 142 migrate_irqs();
142 143
143 /* 144 /*
144 * Stop the local timer for this CPU.
145 */
146 local_timer_stop(cpu);
147
148 /*
149 * Flush user cache and TLB mappings, and then remove this CPU 145 * Flush user cache and TLB mappings, and then remove this CPU
150 * from the vm mask set of all processes. 146 * from the vm mask set of all processes.
151 */ 147 */
@@ -198,8 +194,6 @@ asmlinkage void start_secondary(void)
198 194
199 local_irq_enable(); 195 local_irq_enable();
200 196
201 /* Enable local timers */
202 local_timer_setup(cpu);
203 calibrate_delay(); 197 calibrate_delay();
204 198
205 smp_store_cpu_info(cpu); 199 smp_store_cpu_info(cpu);
@@ -289,7 +283,8 @@ void arch_send_call_function_single_ipi(int cpu)
289 mp_ops->send_ipi(cpu, SMP_MSG_FUNCTION_SINGLE); 283 mp_ops->send_ipi(cpu, SMP_MSG_FUNCTION_SINGLE);
290} 284}
291 285
292void smp_timer_broadcast(const struct cpumask *mask) 286#ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
287void tick_broadcast(const struct cpumask *mask)
293{ 288{
294 int cpu; 289 int cpu;
295 290
@@ -300,9 +295,10 @@ void smp_timer_broadcast(const struct cpumask *mask)
300static void ipi_timer(void) 295static void ipi_timer(void)
301{ 296{
302 irq_enter(); 297 irq_enter();
303 local_timer_interrupt(); 298 tick_receive_broadcast();
304 irq_exit(); 299 irq_exit();
305} 300}
301#endif
306 302
307void smp_message_recv(unsigned int msg) 303void smp_message_recv(unsigned int msg)
308{ 304{
@@ -316,9 +312,11 @@ void smp_message_recv(unsigned int msg)
316 case SMP_MSG_FUNCTION_SINGLE: 312 case SMP_MSG_FUNCTION_SINGLE:
317 generic_smp_call_function_single_interrupt(); 313 generic_smp_call_function_single_interrupt();
318 break; 314 break;
315#ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
319 case SMP_MSG_TIMER: 316 case SMP_MSG_TIMER:
320 ipi_timer(); 317 ipi_timer();
321 break; 318 break;
319#endif
322 default: 320 default:
323 printk(KERN_WARNING "SMP %d: %s(): unknown IPI %d\n", 321 printk(KERN_WARNING "SMP %d: %s(): unknown IPI %d\n",
324 smp_processor_id(), __func__, msg); 322 smp_processor_id(), __func__, msg);