sh: remove arch-specific localtimer and use generic one
authorRich Felker <dalias@libc.org>
Fri, 12 Feb 2016 22:05:11 +0000 (22:05 +0000)
committerRich Felker <dalias@libc.org>
Thu, 17 Mar 2016 19:46:09 +0000 (19:46 +0000)
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>
arch/sh/Kconfig
arch/sh/kernel/Makefile
arch/sh/kernel/localtimer.c [deleted file]
arch/sh/kernel/smp.c

index e13da05..9aabc96 100644 (file)
@@ -1,5 +1,6 @@
 config SUPERH
        def_bool y
+       select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
        select ARCH_MIGHT_HAVE_PC_PARPORT
        select HAVE_PATA_PLATFORM
        select CLKDEV_LOOKUP
index 2ccf36c..09040fd 100644 (file)
@@ -46,6 +46,5 @@ obj-$(CONFIG_DWARF_UNWINDER)  += dwarf.o
 obj-$(CONFIG_PERF_EVENTS)      += perf_event.o perf_callchain.o
 
 obj-$(CONFIG_HAVE_HW_BREAKPOINT)               += hw_breakpoint.o
-obj-$(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST)    += localtimer.o
 
 ccflags-y := -Werror
diff --git a/arch/sh/kernel/localtimer.c b/arch/sh/kernel/localtimer.c
deleted file mode 100644 (file)
index cbb7d46..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Dummy local timer
- *
- * Copyright (C) 2008  Paul Mundt
- *
- * cloned from:
- *
- *  linux/arch/arm/mach-realview/localtimer.c
- *
- *  Copyright (C) 2002 ARM Ltd.
- *  All Rights Reserved
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/delay.h>
-#include <linux/device.h>
-#include <linux/smp.h>
-#include <linux/jiffies.h>
-#include <linux/percpu.h>
-#include <linux/clockchips.h>
-#include <linux/hardirq.h>
-#include <linux/irq.h>
-
-static DEFINE_PER_CPU(struct clock_event_device, local_clockevent);
-
-/*
- * Used on SMP for either the local timer or SMP_MSG_TIMER
- */
-void local_timer_interrupt(void)
-{
-       struct clock_event_device *clk = this_cpu_ptr(&local_clockevent);
-
-       irq_enter();
-       clk->event_handler(clk);
-       irq_exit();
-}
-
-void local_timer_setup(unsigned int cpu)
-{
-       struct clock_event_device *clk = &per_cpu(local_clockevent, cpu);
-
-       clk->name               = "dummy_timer";
-       clk->features           = CLOCK_EVT_FEAT_ONESHOT |
-                                 CLOCK_EVT_FEAT_PERIODIC |
-                                 CLOCK_EVT_FEAT_DUMMY;
-       clk->rating             = 400;
-       clk->mult               = 1;
-       clk->broadcast          = smp_timer_broadcast;
-       clk->cpumask            = cpumask_of(cpu);
-
-       clockevents_register_device(clk);
-}
-
-void local_timer_stop(unsigned int cpu)
-{
-}
index a66f2aa..cbfb988 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/interrupt.h>
 #include <linux/sched.h>
 #include <linux/atomic.h>
+#include <linux/clockchips.h>
 #include <asm/processor.h>
 #include <asm/mmu_context.h>
 #include <asm/smp.h>
@@ -140,11 +141,6 @@ int __cpu_disable(void)
         */
        migrate_irqs();
 
-       /*
-        * Stop the local timer for this CPU.
-        */
-       local_timer_stop(cpu);
-
        /*
         * Flush user cache and TLB mappings, and then remove this CPU
         * from the vm mask set of all processes.
@@ -198,8 +194,6 @@ asmlinkage void start_secondary(void)
 
        local_irq_enable();
 
-       /* Enable local timers */
-       local_timer_setup(cpu);
        calibrate_delay();
 
        smp_store_cpu_info(cpu);
@@ -289,7 +283,8 @@ void arch_send_call_function_single_ipi(int cpu)
        mp_ops->send_ipi(cpu, SMP_MSG_FUNCTION_SINGLE);
 }
 
-void smp_timer_broadcast(const struct cpumask *mask)
+#ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
+void tick_broadcast(const struct cpumask *mask)
 {
        int cpu;
 
@@ -300,9 +295,10 @@ void smp_timer_broadcast(const struct cpumask *mask)
 static void ipi_timer(void)
 {
        irq_enter();
-       local_timer_interrupt();
+       tick_receive_broadcast();
        irq_exit();
 }
+#endif
 
 void smp_message_recv(unsigned int msg)
 {
@@ -316,9 +312,11 @@ void smp_message_recv(unsigned int msg)
        case SMP_MSG_FUNCTION_SINGLE:
                generic_smp_call_function_single_interrupt();
                break;
+#ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
        case SMP_MSG_TIMER:
                ipi_timer();
                break;
+#endif
        default:
                printk(KERN_WARNING "SMP %d: %s(): unknown IPI %d\n",
                       smp_processor_id(), __func__, msg);