Runtime registration for local timers
Subsystems (11)
v2 cover Runtime registration for local timers
This patches series switches the various local timers implementation (TWD, MCT, MSM timer) to be registered at runtime instead of being hardwired at compile time. In the process, TWD gets an OF binding that is used by highbank and imx6q.
Tested on EB11MP, OMAP4, Tegra and Exynos4. Based on Linus' tree as of some random point today.
Branch also available at:git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git local_timers-v3.3-rc0
* From initial version:
- Moved away from late_time_init, making the code even simpler
- Added a DEFINE_TWD_LOCAL_TIMER() macro to reduce the init cluter
- Updated TWD DT support to have separate nodes for timer and watchdog
- Added support for the new r8a7779 shmobile that suddenly appeared
- Fixed a tiny dts bug on imx6q
Marc Zyngier (15):
ARM: smp_twd: make local_timer_stop a symbol instead of a #define
ARM: local timers: introduce a new registration interface
ARM: smp_twd: add runtime registration support
ARM: smp_twd: add device tree support
ARM: OMAP4: convert to twd_local_timer_register() interface
ARM: plat-versatile: convert to twd_local_timer_register() interface
ARM: tegra: convert to twd_local_timer_register() interface
ARM: shmobile: convert to twd_local_timer_register() interface
ARM: ux500: convert to twd_local_timer_register() interface
ARM: highbank: convert to twd_local_timer_register() interface
ARM: imx6q: convert to twd_local_timer_register() interface
ARM: smp_twd: remove old local timer interface
ARM: local timers: convert exynos to runtime registration interface
ARM: local timers: convert MSM to runtime registration interface
ARM: local timers: make the runtime registration interface mandatory
Documentation/devicetree/bindings/arm/twd.txt | 48 +++++++++++ arch/arm/boot/dts/highbank.dts | 4 +- arch/arm/boot/dts/imx6q.dtsi | 6 +- arch/arm/include/asm/localtimer.h | 37 ++------- arch/arm/include/asm/smp_twd.h | 26 +++++- arch/arm/kernel/smp.c | 31 +++++++- arch/arm/kernel/smp_twd.c | 113 ++++++++++++++++++++----- arch/arm/mach-exynos/mct.c | 18 ++-- arch/arm/mach-highbank/Makefile | 1 - arch/arm/mach-highbank/highbank.c | 5 + arch/arm/mach-highbank/localtimer.c | 40 --------- arch/arm/mach-imx/Makefile | 1 - arch/arm/mach-imx/localtimer.c | 35 -------- arch/arm/mach-imx/mach-imx6q.c | 5 + arch/arm/mach-msm/timer.c | 79 ++++++++++-------- arch/arm/mach-omap2/Makefile | 1 - arch/arm/mach-omap2/timer-mpu.c | 39 --------- arch/arm/mach-omap2/timer.c | 22 ++++- arch/arm/mach-realview/realview_eb.c | 27 +++++-- arch/arm/mach-realview/realview_pb11mp.c | 21 ++++- arch/arm/mach-realview/realview_pbx.c | 20 ++++- arch/arm/mach-shmobile/Makefile | 1 - arch/arm/mach-shmobile/include/mach/common.h | 2 + arch/arm/mach-shmobile/localtimer.c | 26 ------ arch/arm/mach-shmobile/platsmp.c | 1 - arch/arm/mach-shmobile/smp-r8a7779.c | 8 +- arch/arm/mach-shmobile/smp-sh73a0.c | 8 +- arch/arm/mach-shmobile/timer.c | 10 ++ arch/arm/mach-tegra/Makefile | 2 +- arch/arm/mach-tegra/localtimer.c | 26 ------ arch/arm/mach-tegra/timer.c | 22 ++++- arch/arm/mach-ux500/Makefile | 1 - arch/arm/mach-ux500/cpu.c | 1 - arch/arm/mach-ux500/localtimer.c | 29 ------- arch/arm/mach-ux500/timer.c | 32 ++++++-- arch/arm/mach-vexpress/ct-ca9x4.c | 17 +++- arch/arm/plat-versatile/Makefile | 1 - arch/arm/plat-versatile/localtimer.c | 27 ------ 38 files changed, 412 insertions(+), 381 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/twd.txt delete mode 100644 arch/arm/mach-highbank/localtimer.c delete mode 100644 arch/arm/mach-imx/localtimer.c delete mode 100644 arch/arm/mach-omap2/timer-mpu.c delete mode 100644 arch/arm/mach-shmobile/localtimer.c delete mode 100644 arch/arm/mach-tegra/localtimer.c delete mode 100644 arch/arm/mach-ux500/localtimer.c delete mode 100644 arch/arm/plat-versatile/localtimer.c
Signature · 1 line
1.7.7.1
PATCH v2 1/15 ARM: smp_twd: make local_timer_stop a symbol instead of a #define
When CONFIG_HAVE_ARM_TWD is selected, local_timer_stop is a #define, while all other local timers are using a real function.
Convert it to an alias of twd_timer_stop, as it helps converting all local timers to another internal API in a sane way.
--- arch/arm/include/asm/localtimer.h | 6 +----- arch/arm/include/asm/smp_twd.h | 1 - arch/arm/kernel/smp_twd.c | 7 ++++++- 3 files changed, 7 insertions(+), 7 deletions(-)
arch/arm/include/asm/localtimer.h +1 -5
@@ -26,17 +26,13 @@ void percpu_timer_setup(void);#include "smp_twd.h" -#define local_timer_stop (c) twd_timer_stop((c)) - -#else +#endif /* * Stop the local timer */ void local_timer_stop (struct clock_event_device *); -#endif -/* * Setup a local timer interrupt for a CPU. */
arch/arm/include/asm/smp_twd.h +0 -1
@@ -23,6 +23,5 @@ struct clock_event_device;extern void __iomem *twd_base;void twd_timer_setup (struct clock_event_device *); -void twd_timer_stop (struct clock_event_device *);#endif
arch/arm/kernel/smp_twd.c +6 -1
@@ -87,12 +87,17 @@ int twd_timer_ack(void)return 0 ; } -void twd_timer_stop (struct clock_event_device *clk) +static void twd_timer_stop (struct clock_event_device *clk) {twd_set_mode (CLOCK_EVT_MODE_UNUSED , clk);disable_percpu_irq (clk->irq); } +/* Temporary hack to be removed when all TWD users are converted to +the new registration interface */ +void local_timer_stop (struct clock_event_device *clk) + __attribute__ ((alias ("twd_timer_stop" ))); +#ifdef CONFIG_CPU_FREQ /*
Signature · 1 line
1.7.7.1
PATCH v2 2/15 ARM: local timers: introduce a new registration interface
In reply to Marc ZyngierIn order to switch to a runtime selectable local timer, add a registration interface that timer drivers can use to register to the core.
local_timer_setup() and local_timer_stop() are made weak symbols in order not to break existing setups.
--- arch/arm/include/asm/localtimer.h | 15 +++++++++++++++ arch/arm/kernel/smp.c | 27 +++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 0 deletions(-)
arch/arm/include/asm/localtimer.h +15 -0
@@ -15,6 +15,11 @@struct clock_event_device ; +struct local_timer_ops { +int (*setup)(struct clock_event_device *); +void (*stop)(struct clock_event_device *); +}; +/* * Setup a per-cpu timer, whether it be a local timer or dummy broadcast */
@@ -38,6 +43,11 @@ void local_timer_stop(struct clock_event_device *);*/ int local_timer_setup (struct clock_event_device *); +/* +* Register a local timer driver +*/ +int local_timer_register (struct local_timer_ops *); +#else static inline int local_timer_setup (struct clock_event_device *evt)
@@ -48,6 +58,11 @@ static inline int local_timer_setup(struct clock_event_device *evt)static inline void local_timer_stop (struct clock_event_device *evt) { } + +static inline int local_timer_register (struct local_timer_ops *ops) +{ +return -ENXIO ; +}#endif #endif
arch/arm/kernel/smp.c +27 -0
@@ -475,6 +475,33 @@ static void __cpuinit broadcast_timer_setup(struct clock_event_device *evt)clockevents_register_device (evt); } +static struct local_timer_ops *lt_ops; + +#ifdef CONFIG_LOCAL_TIMERS +int local_timer_register (struct local_timer_ops *ops) +{ +if (lt_ops) +return -EBUSY ; + + lt_ops = ops; +return 0 ; +} +#endif + +int __attribute__ ((weak))local_timer_setup (struct clock_event_device *clk) +{ +if (lt_ops) +return lt_ops->setup (clk); + +return -ENXIO ; +} + +void __attribute__ ((weak))local_timer_stop (struct clock_event_device *clk) +{ +if (lt_ops) + lt_ops->stop (clk); +} +void __cpuinit percpu_timer_setup (void ) {unsigned int cpu =smp_processor_id ();
Signature · 1 line
1.7.7.1
PATCH v2 3/15 ARM: smp_twd: add runtime registration support
In reply to Marc ZyngierAdd support for the new registration interface to smp_twd. Platforms can populate a struct twd_local_timer with MMIO and IRQ resources, and then call twd_local_timer_register() to have the timer registered with the core.
--- arch/arm/include/asm/smp_twd.h | 18 +++++++++++++- arch/arm/kernel/smp_twd.c | 51 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 65 insertions(+), 4 deletions(-)
arch/arm/include/asm/smp_twd.h +17 -1
@@ -18,10 +18,26 @@#define TWD_TIMER_CONTROL_PERIODIC (1 << 1)#define TWD_TIMER_CONTROL_IT_ENABLE (1 << 2) +#include <linux/ioport.h> +struct clock_event_device ;extern void __iomem *twd_base; -void twd_timer_setup (struct clock_event_device *); +int twd_timer_setup (struct clock_event_device *); + +struct twd_local_timer { +struct resource res[2 ]; +}; + +#define DEFINE_TWD_LOCAL_TIMER (name,base,irq) \ +struct twd_local_timer name __initdata = { \ + .res = { \ + DEFINE_RES_MEM(base, 0x10), \ + DEFINE_RES_IRQ(irq), \ + }, \ +}; + +int twd_local_timer_register (struct twd_local_timer *);#endif
arch/arm/kernel/smp_twd.c +48 -3
85 lines not on this page · raw message
Signature · 1 line
1.7.7.1
PATCH v2 4/15 ARM: smp_twd: add device tree support
In reply to Marc ZyngierAdd bindings to support DT discovery of the ARM Timer Watchdog (aka TWD). Only the timer side is converted by this patch.
--- Documentation/devicetree/bindings/arm/twd.txt | 48 ++++++++++++++++++ arch/arm/include/asm/smp_twd.h | 9 +++ arch/arm/kernel/smp_twd.c | 67 ++++++++++++++++++++----- 3 files changed, 111 insertions(+), 13 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/twd.txt
Documentation/devicetree/bindings/arm/twd.txt new file +48 -0
@@ -0,0 +1,48 @@ +* ARM Timer Watchdog + +ARM 11MP, Cortex-A5 and Cortex-A9 are often associated with a per-core +Timer-Watchdog (aka TWD), which provides both a per-cpu local timer +and watchdog. + +The TWD is usually attached to a GIC to deliver its two per-processor +interrupts. + +** Timer node required properties: + +- compatible : Should be one of: + "arm,cortex-a9-twd-timer" + "arm,cortex-a5-twd-timer" + "arm,arm11mp-twd-timer" + +- interrupts : One interrupt to each core + +- reg : Specify the base address and the size of the TWD timer + register window. + +Example: + + twd-timer at 2c000600 { + compatible = "arm,arm11mp-twd-timer""; + reg = <0x2c000600 0x20>; + interrupts = <1 13 0xf01>; + }; + +** Watchdog node properties: + +- compatible : Should be one of: + "arm,cortex-a9-twd-wdt" + "arm,cortex-a5-twd-wdt" + "arm,arm11mp-twd-wdt" + +- interrupts : One interrupt to each core + +- reg : Specify the base address and the size of the TWD watchdog + register window. + +Example: + + twd-watchdog at 2c000620 { + compatible = "arm,arm11mp-twd-wdt"; + reg = <0x2c000620 0x20>; + interrupts = <1 14 0xf01>; + };
arch/arm/include/asm/smp_twd.h +9 -0
@@ -40,4 +40,13 @@ struct twd_local_timer name __initdata = { \int twd_local_timer_register (struct twd_local_timer *); +#if CONFIG_HAVE_ARM_TWD +int twd_local_timer_of_register (void ); +#else +static inline int twd_local_timer_of_register (void ) +{ +return 0 ; +} +#endif +#endif
arch/arm/kernel/smp_twd.c +54 -13
97 lines not on this page · raw message
Signature · 1 line
1.7.7.1
PATCH v2 5/15 ARM: OMAP4: convert to twd_local_timer_register() interface
In reply to Marc ZyngierAdd support for the new smp_twd runtime registration interface to the OMAP4 platforms, and remove the old compile-time support. Tested on Panda.
--- arch/arm/mach-omap2/Makefile | 1 - arch/arm/mach-omap2/timer-mpu.c | 39 --------------------------------------- arch/arm/mach-omap2/timer.c | 22 +++++++++++++++++----- 3 files changed, 17 insertions(+), 45 deletions(-) delete mode 100644 arch/arm/mach-omap2/timer-mpu.c
arch/arm/mach-omap2/Makefile +0 -1
@@ -23,7 +23,6 @@ obj-$(CONFIG_TWL4030_CORE) += omap_twl.o # SMP support ONLY available for OMAP4 obj-$(CONFIG_SMP) += omap-smp.o omap-headsmp.o -obj-$(CONFIG_LOCAL_TIMERS) += timer-mpu.o obj-$(CONFIG_HOTPLUG_CPU) += omap-hotplug.o obj-$(CONFIG_ARCH_OMAP4) += omap4-common.o omap-wakeupgen.o \ sleep44xx.o
arch/arm/mach-omap2/timer-mpu.c deleted +0 -39
@@ -1,39 +0,0 @@ -/* -* The MPU local timer source file. In OMAP4, both cortex-a9 cores have -* own timer in it's MPU domain. These timers will be driving the -* linux kernel SMP tick framework when active. These timers are not -* part of the wake up domain. -* -* Copyright (C) 2009 Texas Instruments, Inc. -* -* Author: -* Santosh Shilimkar <[email protected]> -* -* This file is based on arm realview smp platform file. -* Copyright (C) 2002 ARM Ltd. -* -* 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/smp.h> -#include <linux/clockchips.h> -#include <asm/irq.h> -#include <asm/smp_twd.h> -#include <asm/localtimer.h> - -/* -* Setup the local clock events for a CPU. -*/ -int __cpuinit local_timer_setup (struct clock_event_device *evt) -{ -/* Local timers are not supprted on OMAP4430 ES1.0 */ -if (omap_rev () ==OMAP4430_REV_ES1_0 ) -return -ENXIO ; - - evt->irq =OMAP44XX_IRQ_LOCALTIMER ; -twd_timer_setup (evt); -return 0 ; -} -
arch/arm/mach-omap2/timer.c +17 -5
@@ -39,7 +39,7 @@#include <asm/mach/time.h> #include <plat/dmtimer.h> -#include <asm/localtimer.h> +#include <asm/smp_twd.h> #include <asm/sched_clock.h> #include "common.h" #include <plat/omap_hwmod.h>
@@ -324,14 +324,26 @@ OMAP_SYS_TIMER(3_secure)#endif #ifdef CONFIG_ARCH_OMAP4 -static void __init omap4_timer_init (void ) -{#ifdef CONFIG_LOCAL_TIMERS - twd_base =ioremap (OMAP44XX_LOCAL_TWD_BASE ,SZ_256 ); -BUG_ON (!twd_base); +static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, + OMAP44XX_LOCAL_TWD_BASE, + OMAP44XX_IRQ_LOCALTIMER);#endif + +static void __init omap4_timer_init (void ) +{omap2_gp_clockevent_init (1 ,OMAP4_CLKEV_SOURCE );omap2_gp_clocksource_init (2 ,OMAP4_MPU_SOURCE ); +#ifdef CONFIG_LOCAL_TIMERS +/* Local timers are not supprted on OMAP4430 ES1.0 */ +if (omap_rev () !=OMAP4430_REV_ES1_0 ) { +int err; + + err =twd_local_timer_register (&twd_local_timer); +if (err) +pr_err ("twd_local_timer_register failed %d\n" , err); + } +#endif } OMAP_SYS_TIMER(4)#endif
Signature · 1 line
1.7.7.1
PATCH v2 6/15 ARM: plat-versatile: convert to twd_local_timer_register() interface
In reply to Marc ZyngierAdd support for the new smp_twd runtime registration interface to the RealView/VE platforms, and remove the old compile-time support. Tested on EB11MP.
--- arch/arm/mach-realview/realview_eb.c | 27 +++++++++++++++++++++------ arch/arm/mach-realview/realview_pb11mp.c | 21 +++++++++++++++++---- arch/arm/mach-realview/realview_pbx.c | 20 ++++++++++++++++---- arch/arm/mach-vexpress/ct-ca9x4.c | 17 ++++++++++++++--- arch/arm/plat-versatile/Makefile | 1 - arch/arm/plat-versatile/localtimer.c | 27 --------------------------- 6 files changed, 68 insertions(+), 45 deletions(-) delete mode 100644 arch/arm/plat-versatile/localtimer.c
arch/arm/mach-realview/realview_eb.c +21 -6
@@ -36,7 +36,7 @@#include <asm/pgtable.h> #include <asm/hardware/gic.h> #include <asm/hardware/cache-l2x0.h> -#include <asm/localtimer.h> +#include <asm/smp_twd.h> #include <asm/mach/arch.h> #include <asm/mach/map.h>
@@ -391,6 +391,23 @@ static void realview_eb11mp_fixup(void) realview_eb_isp1761_resources[1 ].end =IRQ_EB11MP_USB ; } +#ifdef CONFIG_HAVE_ARM_TWD +static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, + REALVIEW_EB11MP_TWD_BASE, + IRQ_LOCALTIMER); + +static void __init realview_eb_twd_init (void ) +{ +if (core_tile_eb11mp () ||core_tile_a9mp ()) { +int err =twd_local_timer_register (&twd_local_timer); +if (err) +pr_err ("twd_local_timer_register failed %d\n" , err); + } +} +#else +#define realview_eb_twd_init () do { } while(0) +#endif +static void __init realview_eb_timer_init (void ) {unsigned int timer_irq;
@@ -400,15 +417,13 @@ static void __init realview_eb_timer_init(void) timer2_va_base =__io_address (REALVIEW_EB_TIMER2_3_BASE ); timer3_va_base =__io_address (REALVIEW_EB_TIMER2_3_BASE ) +0x20 ; -if (core_tile_eb11mp () ||core_tile_a9mp ()) { -#ifdef CONFIG_LOCAL_TIMERS - twd_base =__io_address (REALVIEW_EB11MP_TWD_BASE ); -#endif +if (core_tile_eb11mp () ||core_tile_a9mp ()) timer_irq =IRQ_EB11MP_TIMER0_1 ; - }else +else timer_irq =IRQ_EB_TIMER0_1 ;realview_timer_init (timer_irq); +realview_eb_twd_init (); }static struct sys_timer realview_eb_timer = {
arch/arm/mach-realview/realview_pb11mp.c +17 -4
@@ -36,7 +36,7 @@#include <asm/pgtable.h> #include <asm/hardware/gic.h> #include <asm/hardware/cache-l2x0.h> -#include <asm/localtimer.h> +#include <asm/smp_twd.h> #include <asm/mach/arch.h> #include <asm/mach/flash.h>
@@ -298,6 +298,21 @@ static void __init gic_init_irq(void)gic_cascade_irq (1 ,IRQ_TC11MP_PB_IRQ1 ); } +#ifdef CONFIG_HAVE_ARM_TWD +static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, + REALVIEW_TC11MP_TWD_BASE, + IRQ_LOCALTIMER); + +static void __init realview_pb11mp_twd_init (void ) +{ +int err =twd_local_timer_register (&twd_local_timer); +if (err) +pr_err ("twd_local_timer_register failed %d\n" , err); +} +#else +#define realview_pb11mp_twd_init () do {} while(0) +#endif +static void __init realview_pb11mp_timer_init (void ) { timer0_va_base =__io_address (REALVIEW_PB11MP_TIMER0_1_BASE );
@@ -305,10 +320,8 @@ static void __init realview_pb11mp_timer_init(void) timer2_va_base =__io_address (REALVIEW_PB11MP_TIMER2_3_BASE ); timer3_va_base =__io_address (REALVIEW_PB11MP_TIMER2_3_BASE ) +0x20 ; -#ifdef CONFIG_LOCAL_TIMERS - twd_base =__io_address (REALVIEW_TC11MP_TWD_BASE ); -#endif realview_timer_init (IRQ_TC11MP_TIMER0_1 ); +realview_pb11mp_twd_init (); }static struct sys_timer realview_pb11mp_timer = {
arch/arm/mach-realview/realview_pbx.c +16 -4
@@ -301,6 +301,21 @@ static void __init gic_init_irq(void) } } +#ifdef CONFIG_HAVE_ARM_TWD +static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, + REALVIEW_PBX_TILE_TWD_BASE, + IRQ_LOCALTIMER); + +static void __init realview_pbx_twd_init (void ) +{ +int err =twd_local_timer_register (&twd_local_timer); +if (err) +pr_err ("twd_local_timer_register failed %d\n" , err); +} +#else +#define realview_pbx_twd_init () do { } while(0) +#endif +static void __init realview_pbx_timer_init (void ) { timer0_va_base =__io_address (REALVIEW_PBX_TIMER0_1_BASE );
@@ -308,11 +323,8 @@ static void __init realview_pbx_timer_init(void) timer2_va_base =__io_address (REALVIEW_PBX_TIMER2_3_BASE ); timer3_va_base =__io_address (REALVIEW_PBX_TIMER2_3_BASE ) +0x20 ; -#ifdef CONFIG_LOCAL_TIMERS -if (core_tile_pbx11mp () ||core_tile_pbxa9mp ()) - twd_base =__io_address (REALVIEW_PBX_TILE_TWD_BASE ); -#endif realview_timer_init (IRQ_PBX_TIMER0_1 ); +realview_pbx_twd_init (); }static struct sys_timer realview_pbx_timer = {
arch/arm/mach-vexpress/ct-ca9x4.c +14 -3
@@ -53,9 +53,6 @@ static struct map_desc ct_ca9x4_io_desc[] __initdata = {static void __init ct_ca9x4_map_io (void ) { -#ifdef CONFIG_LOCAL_TIMERS - twd_base =MMIO_P2V (A9_MPCORE_TWD ); -#endif iotable_init (ct_ca9x4_io_desc,ARRAY_SIZE (ct_ca9x4_io_desc)); }
@@ -191,9 +188,23 @@ static struct platform_device pmu_device = { .resource = pmu_resources, }; +#ifdef CONFIG_HAVE_ARM_TWD +static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, A9_MPCORE_TWD, IRQ_LOCALTIMER); + +static void __init ca9x4_twd_init (void ) +{ +int err =twd_local_timer_register (&twd_local_timer); +if (err) +pr_err ("twd_local_timer_register failed %d\n" , err); +} +#else +#define ca9x4_twd_init do {} while(0) +#endif +static void __init ct_ca9x4_init_early (void ) {clkdev_add_table (lookups,ARRAY_SIZE (lookups)); +ca9x4_twd_init (); }static void __init ct_ca9x4_init (void )
arch/arm/plat-versatile/Makefile +0 -1
@@ -1,5 +1,4 @@ obj-y := clock.o -obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o obj-$(CONFIG_PLAT_VERSATILE_CLCD) += clcd.o obj-$(CONFIG_PLAT_VERSATILE_FPGA_IRQ) += fpga-irq.o obj-$(CONFIG_PLAT_VERSATILE_LEDS) += leds.o
arch/arm/plat-versatile/localtimer.c deleted +0 -27
@@ -1,27 +0,0 @@ -/* -* linux/arch/arm/plat-versatile/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/smp.h> -#include <linux/clockchips.h> - -#include <asm/smp_twd.h> -#include <asm/localtimer.h> -#include <mach/irqs.h> - -/* -* Setup the local clock events for a CPU. -*/ -int __cpuinit local_timer_setup (struct clock_event_device *evt) -{ - evt->irq =IRQ_LOCALTIMER ; -twd_timer_setup (evt); -return 0 ; -}
Signature · 1 line
1.7.7.1
PATCH v2 7/15 ARM: tegra: convert to twd_local_timer_register() interface
In reply to Marc ZyngierAdd support for the new smp_twd runtime registration interface to the tegra platforms, and remove the old compile-time support. Tested on Harmony.
--- arch/arm/mach-tegra/Makefile | 2 +- arch/arm/mach-tegra/localtimer.c | 26 -------------------------- arch/arm/mach-tegra/timer.c | 22 +++++++++++++++++----- 3 files changed, 18 insertions(+), 32 deletions(-) delete mode 100644 arch/arm/mach-tegra/localtimer.c
arch/arm/mach-tegra/Makefile +1 -1
@@ -13,7 +13,7 @@ obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra2_emc.o obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += pinmux-tegra20-tables.o obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += pinmux-tegra30-tables.o obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += board-dt-tegra30.o -obj-$(CONFIG_SMP) += platsmp.o localtimer.o headsmp.o +obj-$(CONFIG_SMP) += platsmp.o headsmp.o obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o obj-$(CONFIG_TEGRA_SYSTEM_DMA) += dma.o obj-$(CONFIG_CPU_FREQ) += cpu-tegra.o
arch/arm/mach-tegra/localtimer.c deleted +0 -26
@@ -1,26 +0,0 @@ -/* -* arch/arm/mach-tegra/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/smp.h> -#include <linux/clockchips.h> -#include <asm/irq.h> -#include <asm/smp_twd.h> -#include <asm/localtimer.h> - -/* -* Setup the local clock events for a CPU. -*/ -int __cpuinit local_timer_setup (struct clock_event_device *evt) -{ - evt->irq =IRQ_LOCALTIMER ; -twd_timer_setup (evt); -return 0 ; -}
arch/arm/mach-tegra/timer.c +17 -5
@@ -28,7 +28,7 @@#include <linux/io.h> #include <asm/mach/time.h> -#include <asm/localtimer.h> +#include <asm/smp_twd.h> #include <asm/sched_clock.h> #include <mach/iomap.h>
@@ -162,6 +162,21 @@ static struct irqaction tegra_timer_irq = { .irq = INT_TMR3, }; +#ifdef CONFIG_HAVE_ARM_TWD +static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, + TEGRA_ARM_PERIF_BASE + 0x600, + IRQ_LOCALTIMER); + +static void __init tegra_twd_init (void ) +{ +int err =twd_local_timer_register (&twd_local_timer); +if (err) +pr_err ("twd_local_timer_register failed %d\n" , err); +} +#else +#define tegra_twd_init () do {} while(0) +#endif +static void __init tegra_init_timer (void ) {struct clk *clk;
@@ -188,10 +203,6 @@ static void __init tegra_init_timer(void)else clk_enable (clk); -#ifdef CONFIG_HAVE_ARM_TWD - twd_base =IO_ADDRESS (TEGRA_ARM_PERIF_BASE +0x600 ); -#endif -switch (rate) {case 12000000 :timer_writel (0x000b ,TIMERUS_USEC_CFG );
@@ -231,6 +242,7 @@ static void __init tegra_init_timer(void) tegra_clockevent.cpumask = cpu_all_mask; tegra_clockevent.irq = tegra_timer_irq.irq;clockevents_register_device (&tegra_clockevent); +tegra_twd_init (); }struct sys_timer tegra_timer = {
Signature · 1 line
1.7.7.1
PATCH v2 8/15 ARM: shmobile: convert to twd_local_timer_register() interface
In reply to Marc ZyngierAdd support for the new smp_twd runtime registration interface to the shmobile platforms, and remove the old compile-time support.
--- arch/arm/mach-shmobile/Makefile | 1 - arch/arm/mach-shmobile/include/mach/common.h | 2 ++ arch/arm/mach-shmobile/localtimer.c | 26 -------------------------- arch/arm/mach-shmobile/platsmp.c | 1 - arch/arm/mach-shmobile/smp-r8a7779.c | 8 +++----- arch/arm/mach-shmobile/smp-sh73a0.c | 8 +++----- arch/arm/mach-shmobile/timer.c | 10 ++++++++++ 7 files changed, 18 insertions(+), 38 deletions(-) delete mode 100644 arch/arm/mach-shmobile/localtimer.c
arch/arm/mach-shmobile/Makefile +0 -1
@@ -16,7 +16,6 @@ obj-$(CONFIG_ARCH_R8A7779) += setup-r8a7779.o clock-r8a7779.o intc-r8a7779.o # SMP objects smp-y := platsmp.o headsmp.o smp-$(CONFIG_HOTPLUG_CPU) += hotplug.o -smp-$(CONFIG_LOCAL_TIMERS) += localtimer.o smp-$(CONFIG_ARCH_SH73A0) += smp-sh73a0.o smp-$(CONFIG_ARCH_R8A7779) += smp-r8a7779.o
arch/arm/mach-shmobile/include/mach/common.h +2 -0
@@ -2,6 +2,8 @@#define __ARCH_MACH_COMMON_Hextern struct sys_timer shmobile_timer; +struct twd_local_timer ; +void shmobile_twd_init (struct twd_local_timer *twd_local_timer);extern void shmobile_setup_console (void );extern void shmobile_secondary_vector (void );extern int shmobile_platform_cpu_kill (unsigned int cpu);
arch/arm/mach-shmobile/localtimer.c deleted +0 -26
@@ -1,26 +0,0 @@ -/* -* SMP support for R-Mobile / SH-Mobile - local timer portion -* -* Copyright (C) 2010 Magnus Damm -* -* Based on vexpress, 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/smp.h> -#include <linux/clockchips.h> -#include <asm/smp_twd.h> -#include <asm/localtimer.h> - -/* -* Setup the local clock events for a CPU. -*/ -int __cpuinit local_timer_setup (struct clock_event_device *evt) -{ - evt->irq =29 ; -twd_timer_setup (evt); -return 0 ; -}
arch/arm/mach-shmobile/platsmp.c +0 -1
@@ -17,7 +17,6 @@#include <linux/smp.h> #include <linux/io.h> #include <asm/hardware/gic.h> -#include <asm/localtimer.h> #include <asm/mach-types.h> #include <mach/common.h>
arch/arm/mach-shmobile/smp-r8a7779.c +3 -5
@@ -63,6 +63,8 @@ static void __iomem *scu_base_addr(void)static DEFINE_SPINLOCK (scu_lock);static unsigned long tmp; +static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, 0xf0000600, 29); +static void modify_scu_cpu_psr (unsigned long set,unsigned long clr) {void __iomem *scu_base =scu_base_addr ();
@@ -81,11 +83,7 @@ unsigned int __init r8a7779_get_core_count(void) {void __iomem *scu_base =scu_base_addr (); -#ifdef CONFIG_HAVE_ARM_TWD -/* twd_base needs to be initialized before percpu_timer_setup() */ - twd_base = (void __iomem *)0xf0000600 ; -#endif - +sh73a0_twd_init (&twd_local_timer);return scu_get_core_count (scu_base); }
arch/arm/mach-shmobile/smp-sh73a0.c +3 -5
@@ -41,6 +41,8 @@ static void __iomem *scu_base_addr(void)static DEFINE_SPINLOCK (scu_lock);static unsigned long tmp; +static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, 0xf0000600, 29); +static void modify_scu_cpu_psr (unsigned long set,unsigned long clr) {void __iomem *scu_base =scu_base_addr ();
@@ -59,11 +61,7 @@ unsigned int __init sh73a0_get_core_count(void) {void __iomem *scu_base =scu_base_addr (); -#ifdef CONFIG_HAVE_ARM_TWD -/* twd_base needs to be initialized before percpu_timer_setup() */ - twd_base = (void __iomem *)0xf0000600 ; -#endif - +sh73a0_twd_init (&twd_local_timer);return scu_get_core_count (scu_base); }
arch/arm/mach-shmobile/timer.c +10 -0
@@ -20,6 +20,7 @@*/ #include <linux/platform_device.h> #include <asm/mach/time.h> +#include <asm/smp_twd.h> static void __init shmobile_late_time_init (void ) {
@@ -41,6 +42,15 @@ static void __init shmobile_timer_init(void) late_time_init = shmobile_late_time_init; } +void __init shmobile_twd_init (struct twd_local_timer *twd_local_timer) +{ +#ifdef CONFIG_HAVE_ARM_TWD +int err =twd_local_timer_register (twd_local_timer); +if (err) +pr_err ("twd_local_timer_register failed %d\n" , err); +#endif +} +struct sys_timer shmobile_timer = { .init = shmobile_timer_init, };
Signature · 1 line
1.7.7.1
PATCH v2 9/15 ARM: ux500: convert to twd_local_timer_register() interface
In reply to Marc ZyngierAdd support for the new smp_twd runtime registration interface to the ux500 platforms, and remove the old compile-time support.
--- arch/arm/mach-ux500/Makefile | 1 - arch/arm/mach-ux500/cpu.c | 1 - arch/arm/mach-ux500/localtimer.c | 29 ----------------------------- arch/arm/mach-ux500/timer.c | 32 +++++++++++++++++++++++++------- 4 files changed, 25 insertions(+), 38 deletions(-) delete mode 100644 arch/arm/mach-ux500/localtimer.c
arch/arm/mach-ux500/Makefile +0 -1
@@ -15,7 +15,6 @@ obj-$(CONFIG_MACH_U8500) += board-mop500.o board-mop500-sdi.o \ obj-$(CONFIG_MACH_U5500) += board-u5500.o board-u5500-sdi.o obj-$(CONFIG_SMP) += platsmp.o headsmp.o obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o -obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o obj-$(CONFIG_U5500_MODEM_IRQ) += modem-irq-db5500.o obj-$(CONFIG_U5500_MBOX) += mbox-db5500.o
arch/arm/mach-ux500/cpu.c +0 -1
@@ -14,7 +14,6 @@#include <asm/hardware/gic.h> #include <asm/mach/map.h> -#include <asm/localtimer.h> #include <mach/hardware.h> #include <mach/setup.h>
arch/arm/mach-ux500/localtimer.c deleted +0 -29
@@ -1,29 +0,0 @@ -/* -* Copyright (C) 2008-2009 ST-Ericsson -* Srinidhi Kasagar <[email protected]> -* -* This file is heavily based on relaview platform, almost a copy. -* -* Copyright (C) 2002 ARM Ltd. -* -* 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/smp.h> -#include <linux/clockchips.h> - -#include <asm/irq.h> -#include <asm/smp_twd.h> -#include <asm/localtimer.h> - -/* -* Setup the local clock events for a CPU. -*/ -int __cpuinit local_timer_setup (struct clock_event_device *evt) -{ - evt->irq =IRQ_LOCALTIMER ; -twd_timer_setup (evt); -return 0 ; -}
arch/arm/mach-ux500/timer.c +25 -7
@@ -8,27 +8,44 @@#include <linux/errno.h> #include <linux/clksrc-dbx500-prcmu.h> -#include <asm/localtimer.h> +#include <asm/smp_twd.h> #include <plat/mtu.h> #include <mach/setup.h> #include <mach/hardware.h> +#ifdef CONFIG_HAVE_ARM_TWD +static DEFINE_TWD_LOCAL_TIMER(u5500_twd_local_timer, + U5500_TWD_BASE, IRQ_LOCALTIMER); +static DEFINE_TWD_LOCAL_TIMER(u8500_twd_local_timer, + U8500_TWD_BASE, IRQ_LOCALTIMER); + +static void __init ux500_twd_init (void ) +{ +struct twd_local_timer *twd_local_timer; +int err; + + twd_local_timer =cpu_is_u5500 () ? &u5500_twd_local_timer : + &u8500_twd_local_timer; + + err =twd_local_timer_register (twd_local_timer); +if (err) +pr_err ("twd_local_timer_register failed %d\n" , err); +} +#else +#define ux500_twd_init () do { } while(0) +#endif +static void __init ux500_timer_init (void ) {void __iomem *prcmu_timer_base; +int err;if (cpu_is_u5500 ()) { -#ifdef CONFIG_LOCAL_TIMERS - twd_base =__io_address (U5500_TWD_BASE ); -#endif mtu_base =__io_address (U5500_MTU0_BASE ); prcmu_timer_base =__io_address (U5500_PRCMU_TIMER_3_BASE ); }else if (cpu_is_u8500 ()) { -#ifdef CONFIG_LOCAL_TIMERS - twd_base =__io_address (U8500_TWD_BASE ); -#endif mtu_base =__io_address (U8500_MTU0_BASE ); prcmu_timer_base =__io_address (U8500_PRCMU_TIMER_4_BASE ); }else {
@@ -54,6 +71,7 @@ static void __init ux500_timer_init(void)nmdk_timer_init ();clksrc_dbx500_prcmu_init (prcmu_timer_base); +ux500_twd_init (); }static void ux500_timer_reset (void )
Signature · 1 line
1.7.7.1
PATCH v2 10/15 ARM: highbank: convert to twd_local_timer_register() interface
In reply to Marc ZyngierAdd support for the new smp_twd runtime registration interface to the highbank platforms, and remove the old compile-time support.
The highbank DTS file is updated to match the TWD DT documentation.
--- arch/arm/boot/dts/highbank.dts | 4 +- arch/arm/mach-highbank/Makefile | 1 - arch/arm/mach-highbank/highbank.c | 5 ++++ arch/arm/mach-highbank/localtimer.c | 40 ----------------------------------- 4 files changed, 7 insertions(+), 43 deletions(-) delete mode 100644 arch/arm/mach-highbank/localtimer.c
arch/arm/boot/dts/highbank.dts +2 -2
@@ -72,13 +72,13 @@ ranges; timer at fff10600 { - compatible = "arm,smp-twd"; + compatible = "arm,cortex-a9-twd-timer"; reg = <0xfff10600 0x20>; interrupts = <1 13 0xf04>; }; watchdog at fff10620 { - compatible = "arm,cortex-a9-wdt"; + compatible = "arm,cortex-a9-twd-wdt"; reg = <0xfff10620 0x20>; interrupts = <1 14 0xf04>; };
arch/arm/mach-highbank/Makefile +0 -1
@@ -1,6 +1,5 @@ obj-y := clock.o highbank.o system.o obj-$(CONFIG_DEBUG_HIGHBANK_UART) += lluart.o obj-$(CONFIG_SMP) += platsmp.o -obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o obj-$(CONFIG_PM_SLEEP) += pm.o
arch/arm/mach-highbank/highbank.c +5 -0
@@ -27,6 +27,7 @@#include <asm/cacheflush.h> #include <asm/unified.h> #include <asm/smp_scu.h> +#include <asm/smp_twd.h> #include <asm/hardware/arm_timer.h> #include <asm/hardware/timer-sp.h> #include <asm/hardware/gic.h>
@@ -96,6 +97,7 @@ static void __init highbank_init_irq(void)static void __init highbank_timer_init (void ) {int irq; +int err;struct device_node *np;void __iomem *timer_base;
@@ -113,6 +115,9 @@ static void __init highbank_timer_init(void)sp804_clocksource_init (timer_base +0x20 ,"timer1" );sp804_clockevents_init (timer_base, irq,"timer0" ); + + err =twd_local_timer_of_register (); +WARN_ON (err); }static struct sys_timer highbank_timer = {
arch/arm/mach-highbank/localtimer.c deleted +0 -40
@@ -1,40 +0,0 @@ -/* -* Copyright 2010-2011 Calxeda, Inc. -* Based on localtimer.c, Copyright (C) 2002 ARM Ltd. -* -* This program is free software; you can redistribute it and/or modify it -* under the terms and conditions of the GNU General Public License, -* version 2, as published by the Free Software Foundation. -* -* This program is distributed in the hope it will be useful, but WITHOUT -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along with -* this program. If not, see <http://www.gnu.org/licenses/>. -*/ -#include <linux/init.h> -#include <linux/clockchips.h> -#include <linux/of.h> -#include <linux/of_address.h> -#include <linux/of_irq.h> - -#include <asm/smp_twd.h> - -/* -* Setup the local clock events for a CPU. -*/ -int __cpuinit local_timer_setup (struct clock_event_device *evt) -{ -struct device_node *np; - - np =of_find_compatible_node (NULL ,NULL ,"arm,smp-twd" ); -if (!twd_base) { - twd_base =of_iomap (np,0 ); -WARN_ON (!twd_base); - } - evt->irq =irq_of_parse_and_map (np,0 ); -twd_timer_setup (evt); -return 0 ; -}
Signature · 1 line
1.7.7.1
PATCH v2 10/15 ARM: highbank: convert to twd_local_timer_register() interface
Quoted 7 lines · Marc Zyngier
Add support for the new
smp_twdruntime registration interface to the highbank platforms, and remove the old compile-time support.The highbank DTS file is updated to match the TWD DT documentation.
Cc Rob Herring <[email protected]>Signed-off-by Marc Zyngier <[email protected]>
A couple of minor things below. Otherwise,
Quoted 13 lines
--- arch/arm/boot/dts/highbank.dts | 4 +- arch/arm/mach-highbank/Makefile | 1 - arch/arm/mach-highbank/highbank.c | 5 ++++ arch/arm/mach-highbank/localtimer.c | 40 ----------------------------------- 4 files changed, 7 insertions(+), 43 deletions(-) delete mode 100644 arch/arm/mach-highbank/localtimer.carch/arm/boot/dts/highbank.dts +0
-0
arch/arm/boot/dts/highbank.dts line 77
Quoted 7 lines
arch/arm/boot/dts/highbank.dts +1
-1@@ -72,13 +72,13 @@ ranges; timer at fff10600 { - compatible = "arm,smp-twd"; + compatible = "arm,cortex-a9-twd-timer"; reg = <0xfff10600 0x20>; interrupts = <1 13 0xf04>;
Would you mind fixing these to be edge triggered.
Quoted 40 lines
arch/arm/boot/dts/highbank.dts +1
-1}; watchdog at fff10620 { - compatible = "arm,cortex-a9-wdt"; + compatible = "arm,cortex-a9-twd-wdt"; reg = <0xfff10620 0x20>; interrupts = <1 14 0xf04>; };arch/arm/mach-highbank/Makefile +0
-1@@ -1,6 +1,5 @@ obj-y := clock.o highbank.o system.o obj-$(CONFIG_DEBUG_HIGHBANK_UART) += lluart.o obj-$(CONFIG_SMP) += platsmp.o -obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o obj-$(CONFIG_PM_SLEEP) += pm.oarch/arm/mach-highbank/highbank.c +2
-0@@ -27,6 +27,7 @@#include <asm/cacheflush.h> #include <asm/unified.h> #include <asm/smp_scu.h> +#include <asm/smp_twd.h> #include <asm/hardware/arm_timer.h> #include <asm/hardware/timer-sp.h> #include <asm/hardware/gic.h> @@ -96,6 +97,7 @@ static void __init highbank_init_irq(void)static void __init highbank_timer_init (void ) {int irq; +int err;struct device_node *np;void __iomem *timer_base;
arch/arm/mach-highbank/highbank.c static void __init highbank_timer_init(void) · line 120
Quoted 6 lines
arch/arm/mach-highbank/highbank.c +3
-0@@ -113,6 +115,9 @@ static void __init highbank_timer_init(void)sp804_clocksource_init (timer_base +0x20 ,"timer1" );sp804_clockevents_init (timer_base, irq,"timer0" ); + + err =twd_local_timer_of_register (); +WARN_ON (err);
Perhaps the WARN should be inside twd_local_timer_of_register.
Rob
Quoted 49 lines
arch/arm/mach-highbank/highbank.c +0
-0}static struct sys_timer highbank_timer = {arch/arm/mach-highbank/localtimer.c deleted +0
-40@@ -1,40 +0,0 @@ -/* -* Copyright 2010-2011 Calxeda, Inc. -* Based on localtimer.c, Copyright (C) 2002 ARM Ltd. -* -* This program is free software; you can redistribute it and/or modify it -* under the terms and conditions of the GNU General Public License, -* version 2, as published by the Free Software Foundation. -* -* This program is distributed in the hope it will be useful, but WITHOUT -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along with -* this program. If not, see <http://www.gnu.org/licenses/>. -*/ -#include <linux/init.h> -#include <linux/clockchips.h> -#include <linux/of.h> -#include <linux/of_address.h> -#include <linux/of_irq.h> - -#include <asm/smp_twd.h> - -/* -* Setup the local clock events for a CPU. -*/ -int __cpuinit local_timer_setup (struct clock_event_device *evt) -{ -struct device_node *np; - - np =of_find_compatible_node (NULL ,NULL ,"arm,smp-twd" ); -if (!twd_base) { - twd_base =of_iomap (np,0 ); -WARN_ON (!twd_base); - } - evt->irq =irq_of_parse_and_map (np,0 ); -twd_timer_setup (evt); -return 0 ; -}
PATCH v2 10/15 ARM: highbank: convert to twd_local_timer_register() interface
Quoted 28 lines · Rob Herring
Quoted 7 lines · Marc Zyngier
Add support for the new
smp_twdruntime registration interface to the highbank platforms, and remove the old compile-time support.The highbank DTS file is updated to match the TWD DT documentation.
Cc Rob Herring <[email protected]>Signed-off-by Marc Zyngier <[email protected]>A couple of minor things below. Otherwise,
Acked-by Rob Herring <[email protected]>Quoted 15 lines
--- arch/arm/boot/dts/highbank.dts | 4 +- arch/arm/mach-highbank/Makefile | 1 - arch/arm/mach-highbank/highbank.c | 5 ++++ arch/arm/mach-highbank/localtimer.c | 40 ----------------------------------- 4 files changed, 7 insertions(+), 43 deletions(-) delete mode 100644 arch/arm/mach-highbank/localtimer.carch/arm/boot/dts/highbank.dts +0
-0@@ -72,13 +72,13 @@ ranges;
Quoted 8 lines
arch/arm/boot/dts/highbank.dts line 77
Quoted 5 lines
arch/arm/boot/dts/highbank.dts +1
-1timer at fff10600 { - compatible = "arm,smp-twd"; + compatible = "arm,cortex-a9-twd-timer"; reg = <0xfff10600 0x20>; interrupts = <1 13 0xf04>;Would you mind fixing these to be edge triggered.
This would just be an indication, since not only SGI but also PPI has a read-only Interrupt Configuration Register. So does the patch below make sense?
arch/arm/common/gic.c +2 -2
@@ -186,8 +186,8 @@ static int gic_set_type(struct irq_data *d, unsigned int type)bool enabled = false;u32 val; -/* Interrupt configuration for SGIs can't be changed */ -if (gicirq <16 ) +/* Interrupt configuration for SGIs and PPIs can't be changed */ +if (gicirq <32 )return -EINVAL ;if (type !=IRQ_TYPE_LEVEL_HIGH && type !=IRQ_TYPE_EDGE_RISING )
Signature · 2 lines
Regards, Shawn
PATCH v2 10/15 ARM: highbank: convert to twd_local_timer_register() interface
Quoted 3 lines · Shawn Guo
This would just be an indication, since not only SGI but also PPI has a read-only Interrupt Configuration Register. So does the patch below make sense?
No, because Tegra can change the configuration of PPIs.
PATCH v2 10/15 ARM: highbank: convert to twd_local_timer_register() interface
In reply to Shawn GuoQuoted 37 lines · Shawn Guo
Quoted 28 lines · Rob Herring
Quoted 7 lines · Marc Zyngier
Add support for the new
smp_twdruntime registration interface to the highbank platforms, and remove the old compile-time support.The highbank DTS file is updated to match the TWD DT documentation.
Cc Rob Herring <[email protected]>Signed-off-by Marc Zyngier <[email protected]>A couple of minor things below. Otherwise,
Acked-by Rob Herring <[email protected]>Quoted 15 lines
--- arch/arm/boot/dts/highbank.dts | 4 +- arch/arm/mach-highbank/Makefile | 1 - arch/arm/mach-highbank/highbank.c | 5 ++++ arch/arm/mach-highbank/localtimer.c | 40 ----------------------------------- 4 files changed, 7 insertions(+), 43 deletions(-) delete mode 100644 arch/arm/mach-highbank/localtimer.carch/arm/boot/dts/highbank.dts +0
-0@@ -72,13 +72,13 @@ ranges;Quoted 8 lines
arch/arm/boot/dts/highbank.dts line 77
Quoted 5 lines
arch/arm/boot/dts/highbank.dts +1
-1timer at fff10600 { - compatible = "arm,smp-twd"; + compatible = "arm,cortex-a9-twd-timer"; reg = <0xfff10600 0x20>; interrupts = <1 13 0xf04>;Would you mind fixing these to be edge triggered.
Quoted 3 lines
This would just be an indication, since not only SGI but also PPI has a read-only Interrupt Configuration Register. So does the patch below make sense?
That is implementation dependent for PPIs IIRC. Whether it's programmable or not, you still need to know the type of interrupt (although it doesn't seem to matter here).
Rob
Quoted 16 lines
arch/arm/common/gic.c +2
-2@@ -186,8 +186,8 @@ static int gic_set_type(struct irq_data *d, unsigned int type)bool enabled = false;u32 val; -/* Interrupt configuration for SGIs can't be changed */ -if (gicirq <16 ) +/* Interrupt configuration for SGIs and PPIs can't be changed */ +if (gicirq <32 )return -EINVAL ;if (type !=IRQ_TYPE_LEVEL_HIGH && type !=IRQ_TYPE_EDGE_RISING )
PATCH v2 11/15 ARM: imx6q: convert to twd_local_timer_register() interface
In reply to Marc ZyngierAdd support for the new smp_twd runtime registration interface to the imx6q platforms, and remove the old compile-time support.
The imx6q DTS file is updated to match the TWD DT documentation. Also present in this patch a DTS fix to the timer interrupt routing (the PPI connection uses bits [15:8]).
--- arch/arm/boot/dts/imx6q.dtsi | 6 +++--- arch/arm/mach-imx/Makefile | 1 - arch/arm/mach-imx/localtimer.c | 35 ----------------------------------- arch/arm/mach-imx/mach-imx6q.c | 5 +++++ 4 files changed, 8 insertions(+), 39 deletions(-) delete mode 100644 arch/arm/mach-imx/localtimer.c
arch/arm/boot/dts/imx6q.dtsi +3 -3
@@ -88,9 +88,9 @@ ranges; timer at 00a00600 { - compatible = "arm,smp-twd"; - reg = <0x00a00600 0x100>; - interrupts = <1 13 0xf4>; + compatible = "arm,cortex-a9-twd-timer"; + reg = <0x00a00600 0x20>; + interrupts = <1 13 0xf04>; }; L2: l2-cache at 00a02000 {
arch/arm/mach-imx/Makefile +0 -1
@@ -69,7 +69,6 @@ obj-$(CONFIG_CPU_V7) += head-v7.o AFLAGS_head-v7.o :=-Wa,-march=armv7-a obj-$(CONFIG_SMP) += platsmp.o obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o -obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o obj-$(CONFIG_SOC_IMX6Q) += clock-imx6q.o mach-imx6q.o ifeq ($(CONFIG_PM),y)
arch/arm/mach-imx/localtimer.c deleted +0 -35
@@ -1,35 +0,0 @@ -/* -* Copyright 2011 Freescale Semiconductor, Inc. -* Copyright 2011 Linaro Ltd. -* -* The code contained herein is licensed under the GNU General Public -* License. You may obtain a copy of the GNU General Public License -* Version 2 or later at the following locations: -* -* http://www.opensource.org/licenses/gpl-license.html -* http://www.gnu.org/copyleft/gpl.html -*/ - -#include <linux/init.h> -#include <linux/clockchips.h> -#include <linux/of_address.h> -#include <linux/of_irq.h> -#include <asm/smp_twd.h> - -/* -* Setup the local clock events for a CPU. -*/ -int __cpuinit local_timer_setup (struct clock_event_device *evt) -{ -struct device_node *np; - - np =of_find_compatible_node (NULL ,NULL ,"arm,smp-twd" ); -if (!twd_base) { - twd_base =of_iomap (np,0 ); -WARN_ON (!twd_base); - } - evt->irq =irq_of_parse_and_map (np,0 ); -twd_timer_setup (evt); - -return 0 ; -}
arch/arm/mach-imx/mach-imx6q.c +5 -0
@@ -21,6 +21,7 @@#include <linux/of_platform.h> #include <linux/phy.h> #include <linux/micrel_phy.h> +#include <asm/smp_twd.h> #include <asm/hardware/cache-l2x0.h> #include <asm/hardware/gic.h> #include <asm/mach/arch.h>
@@ -118,7 +119,11 @@ static void __init imx6q_init_irq(void)static void __init imx6q_timer_init (void ) { +int err; +mx6q_clocks_init (); +twd_local_timer_of_register (); +WARN_ON (err); }static struct sys_timer imx6q_timer = {
Signature · 1 line
1.7.7.1
PATCH v2 11/15 ARM: imx6q: convert to twd_local_timer_register() interface
Quoted 7 lines · Marc Zyngier
Add support for the new
smp_twdruntime registration interface to the imx6q platforms, and remove the old compile-time support.The imx6q DTS file is updated to match the TWD DT documentation. Also present in this patch a DTS fix to the timer interrupt routing (the PPI connection uses bits [15:8]).
Thanks for the fixing.
Quoted 15 lines
Cc Shawn Guo <[email protected]>Signed-off-by Marc Zyngier <[email protected]>--- arch/arm/boot/dts/imx6q.dtsi | 6 +++--- arch/arm/mach-imx/Makefile | 1 - arch/arm/mach-imx/localtimer.c | 35 ----------------------------------- arch/arm/mach-imx/mach-imx6q.c | 5 +++++ 4 files changed, 8 insertions(+), 39 deletions(-) delete mode 100644 arch/arm/mach-imx/localtimer.carch/arm/boot/dts/imx6q.dtsi +0
-0
arch/arm/boot/dts/imx6q.dtsi line 93
Quoted 9 lines
arch/arm/boot/dts/imx6q.dtsi +3
-3@@ -88,9 +88,9 @@ ranges; timer at 00a00600 { - compatible = "arm,smp-twd"; - reg = <0x00a00600 0x100>; - interrupts = <1 13 0xf4>; + compatible = "arm,cortex-a9-twd-timer"; + reg = <0x00a00600 0x20>; + interrupts = <1 13 0xf04>;
I would also prefer to fix it as 0xf01, even though it's just an indication.
Quoted 69 lines
arch/arm/boot/dts/imx6q.dtsi +0
-0}; L2: l2-cache at 00a02000 {arch/arm/mach-imx/Makefile +0
-1@@ -69,7 +69,6 @@ obj-$(CONFIG_CPU_V7) += head-v7.o AFLAGS_head-v7.o :=-Wa,-march=armv7-a obj-$(CONFIG_SMP) += platsmp.o obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o -obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o obj-$(CONFIG_SOC_IMX6Q) += clock-imx6q.o mach-imx6q.o ifeq ($(CONFIG_PM),y)arch/arm/mach-imx/localtimer.c deleted +0
-35@@ -1,35 +0,0 @@ -/* -* Copyright 2011 Freescale Semiconductor, Inc. -* Copyright 2011 Linaro Ltd. -* -* The code contained herein is licensed under the GNU General Public -* License. You may obtain a copy of the GNU General Public License -* Version 2 or later at the following locations: -* -* http://www.opensource.org/licenses/gpl-license.html -* http://www.gnu.org/copyleft/gpl.html -*/ - -#include <linux/init.h> -#include <linux/clockchips.h> -#include <linux/of_address.h> -#include <linux/of_irq.h> -#include <asm/smp_twd.h> - -/* -* Setup the local clock events for a CPU. -*/ -int __cpuinit local_timer_setup (struct clock_event_device *evt) -{ -struct device_node *np; - - np =of_find_compatible_node (NULL ,NULL ,"arm,smp-twd" ); -if (!twd_base) { - twd_base =of_iomap (np,0 ); -WARN_ON (!twd_base); - } - evt->irq =irq_of_parse_and_map (np,0 ); -twd_timer_setup (evt); - -return 0 ; -}arch/arm/mach-imx/mach-imx6q.c +1
-0@@ -21,6 +21,7 @@#include <linux/of_platform.h> #include <linux/phy.h> #include <linux/micrel_phy.h> +#include <asm/smp_twd.h> #include <asm/hardware/cache-l2x0.h> #include <asm/hardware/gic.h> #include <asm/mach/arch.h>
arch/arm/mach-imx/mach-imx6q.c static void __init imx6q_init_irq(void) · line 125
Quoted 7 lines
arch/arm/mach-imx/mach-imx6q.c +3
-0@@ -118,7 +119,11 @@ static void __init imx6q_init_irq(void)static void __init imx6q_timer_init (void ) { +int err; +mx6q_clocks_init (); +twd_local_timer_of_register ();
err = twd_local_timer_of_register();
Regards,
Shawn
Quoted 8 lines
arch/arm/mach-imx/mach-imx6q.c +1
-0+WARN_ON (err); }static struct sys_timer imx6q_timer = {Signature · 1 line
1.7.7.1
PATCH v2 12/15 ARM: smp_twd: remove old local timer interface
In reply to Marc ZyngierNow that all users of the previous local timer interface have been converted to the runtime registration API, make this interface the only one supported for this driver.
--- arch/arm/include/asm/localtimer.h | 8 -------- arch/arm/include/asm/smp_twd.h | 6 ------ arch/arm/kernel/smp_twd.c | 34 +++++----------------------------- 3 files changed, 5 insertions(+), 43 deletions(-)
arch/arm/include/asm/localtimer.h +0 -8
@@ -11,7 +11,6 @@#define __ASM_ARM_LOCALTIMER_H#include <linux/errno.h> -#include <linux/interrupt.h> struct clock_event_device ;
@@ -26,13 +25,6 @@ struct local_timer_ops {void percpu_timer_setup (void );#ifdef CONFIG_LOCAL_TIMERS - -#ifdef CONFIG_HAVE_ARM_TWD - -#include "smp_twd.h" - -#endif -/* * Stop the local timer */
arch/arm/include/asm/smp_twd.h +0 -6
@@ -20,12 +20,6 @@#include <linux/ioport.h> -struct clock_event_device ; - -extern void __iomem *twd_base; - -int twd_timer_setup (struct clock_event_device *); -struct twd_local_timer {struct resource res[2 ]; };
arch/arm/kernel/smp_twd.c +5 -29
@@ -18,7 +18,7 @@#include <linux/smp.h> #include <linux/jiffies.h> #include <linux/clockchips.h> -#include <linux/irq.h> +#include <linux/interrupt.h> #include <linux/io.h> #include <linux/of_irq.h> #include <linux/of_address.h>
@@ -28,7 +28,7 @@#include <asm/hardware/gic.h> /* set up by the platform code */ -void __iomem *twd_base; +static void __iomem *twd_base;static struct clk *twd_clk;static unsigned long twd_timer_rate;
@@ -80,7 +80,7 @@ static int twd_set_next_event(unsigned long evt,* If a local timer interrupt has occurred, acknowledge and return 1. * Otherwise, return 0. */ -int twd_timer_ack (void ) +static int twd_timer_ack (void ) {if (__raw_readl (twd_base +TWD_TIMER_INTSTAT )) {__raw_writel (1 , twd_base +TWD_TIMER_INTSTAT );
@@ -96,11 +96,6 @@ static void twd_timer_stop(struct clock_event_device *clk)disable_percpu_irq (clk->irq); } -/* Temporary hack to be removed when all TWD users are converted to -the new registration interface */ -void local_timer_stop (struct clock_event_device *clk) - __attribute__ ((alias ("twd_timer_stop" ))); -#ifdef CONFIG_CPU_FREQ /*
@@ -230,28 +225,10 @@ static struct clk *twd_get_clock(void)/* * Setup the local clock events for a CPU. */ -int __cpuinit twd_timer_setup (struct clock_event_device *clk) +static int __cpuinit twd_timer_setup (struct clock_event_device *clk) {struct clock_event_device **this_cpu_clk; -if (!twd_evt) { -int err; - - twd_evt = alloc_percpu(struct clock_event_device *); -if (!twd_evt) { -pr_err ("twd: can't allocate memory\n" ); -return -ENOMEM ; - } - - err =request_percpu_irq (clk->irq, twd_handler, -"twd" , twd_evt); -if (err) { -pr_err ("twd: can't register interrupt %d (%d)\n" , - clk->irq, err); -return err; - } - } -if (!twd_clk) twd_clk =twd_get_clock ();
@@ -266,8 +243,7 @@ int __cpuinit twd_timer_setup(struct clock_event_device *clk) clk->rating =350 ; clk->set_mode = twd_set_mode; clk->set_next_event = twd_set_next_event; -if (!clk->irq) - clk->irq = twd_ppi; + clk->irq = twd_ppi; this_cpu_clk =__this_cpu_ptr (twd_evt); *this_cpu_clk = clk;
Signature · 1 line
1.7.7.1
PATCH v2 13/15 ARM: local timers: convert exynos to runtime registration interface
In reply to Marc ZyngierConvert the Exynos MCT timers to the runtime registration interface. Tested on Origen.
--- arch/arm/mach-exynos/mct.c | 18 ++++++++++-------- 1 files changed, 10 insertions(+), 8 deletions(-)
arch/arm/mach-exynos/mct.c +10 -8
@@ -21,6 +21,7 @@#include <linux/percpu.h> #include <asm/hardware/gic.h> +#include <asm/localtimer.h> #include <plat/cpu.h>
@@ -375,7 +376,7 @@ static struct irqaction mct_tick1_event_irq = { .handler = exynos4_mct_tick_isr, }; -static void exynos4_mct_tick_init (struct clock_event_device *evt) +static int __cpuinit exynos4_local_timer_setup (struct clock_event_device *evt) {struct mct_clock_event_device *mevt;unsigned int cpu =smp_processor_id ();
@@ -417,17 +418,11 @@ static void exynos4_mct_tick_init(struct clock_event_device *evt) }else {enable_percpu_irq (IRQ_MCT_LOCALTIMER ,0 ); } -} - -/* Setup the local clock events for a CPU */ -int __cpuinit local_timer_setup (struct clock_event_device *evt) -{ -exynos4_mct_tick_init (evt);return 0 ; } -void local_timer_stop (struct clock_event_device *evt) +static void exynos4_local_timer_stop (struct clock_event_device *evt) {unsigned int cpu =smp_processor_id (); evt->set_mode (CLOCK_EVT_MODE_UNUSED , evt);
@@ -439,6 +434,11 @@ void local_timer_stop(struct clock_event_device *evt) else disable_percpu_irq(IRQ_MCT_LOCALTIMER); } + +static struct local_timer_ops exynos4_mct_tick_ops__initdata = { + .setup = exynos4_local_timer_setup, + .stop = exynos4_local_timer_stop, +};#endif /* CONFIG_LOCAL_TIMERS */ static void __init exynos4_timer_resources (void )
@@ -458,6 +458,8 @@ static void __init exynos4_timer_resources(void)WARN (err,"MCT: can't request IRQ %d (%d)\n" , IRQ_MCT_LOCALTIMER, err); } + +local_timer_register (&exynos4_mct_tick_ops);#endif /* CONFIG_LOCAL_TIMERS */ }
Signature · 1 line
1.7.7.1
PATCH v2 13/15 ARM: local timers: convert exynos to runtime registration interface
arch/arm/mach-exynos/mct.c void local_timer_stop(struct clock_event_device *evt) · line 441
Quoted 4 lines · Marc Zyngier
arch/arm/mach-exynos/mct.c +4
-0+static struct local_timer_ops exynos4_mct_tick_ops__initdata = { + .setup = exynos4_local_timer_setup, + .stop = exynos4_local_timer_stop, +};
This also needs to be __cpuinitdata
David
Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
PATCH v2 14/15 ARM: local timers: convert MSM to runtime registration interface
In reply to Marc ZyngierConvert the MSM timers to the runtime registration interface.
--- arch/arm/mach-msm/timer.c | 79 +++++++++++++++++++++++++-------------------- 1 files changed, 44 insertions(+), 35 deletions(-)
arch/arm/mach-msm/timer.c +44 -35
@@ -127,6 +127,45 @@ static struct clocksource msm_clocksource = { .flags = CLOCK_SOURCE_IS_CONTINUOUS, }; +#ifdef CONFIG_LOCAL_TIMERS +static int __cpuinit msm_local_timer_setup (struct clock_event_device *evt) +{ +/* Use existing clock_event for cpu 0 */ +if (!smp_processor_id ()) +return 0 ; + +writel_relaxed (0 , event_base +TIMER_ENABLE ); +writel_relaxed (0 , event_base +TIMER_CLEAR ); +writel_relaxed (~0 , event_base +TIMER_MATCH_VAL ); + evt->irq = msm_clockevent.irq; + evt->name ="local_timer" ; + evt->features = msm_clockevent.features; + evt->rating = msm_clockevent.rating; + evt->set_mode = msm_timer_set_mode; + evt->set_next_event = msm_timer_set_next_event; + evt->shift = msm_clockevent.shift; + evt->mult =div_sc (GPT_HZ ,NSEC_PER_SEC , evt->shift); + evt->max_delta_ns =clockevent_delta2ns (0xf0000000 , evt); + evt->min_delta_ns =clockevent_delta2ns (4 , evt); + + *__this_cpu_ptr (msm_evt.percpu_evt) = evt; +clockevents_register_device (evt); +enable_percpu_irq (evt->irq,0 ); +return 0 ; +} + +static void msm_local_timer_stop (struct clock_event_device *evt) +{ + evt->set_mode (CLOCK_EVT_MODE_UNUSED , evt); +disable_percpu_irq (evt->irq); +} + +static struct local_timer_ops msm_local_timer_ops__initdata = { + .setup = msm_local_timer_setup, + .stop = msm_local_timer_stop, +}; +#endif /* CONFIG_LOCAL_TIMERS */ +static void __init msm_timer_init (void ) {struct clock_event_device *ce = &msm_clockevent;
@@ -173,8 +212,12 @@ static void __init msm_timer_init(void) *__this_cpu_ptr (msm_evt.percpu_evt) = ce; res =request_percpu_irq (ce->irq, msm_timer_interrupt, ce->name, msm_evt.percpu_evt); -if (!res) +if (!res) {enable_percpu_irq (ce->irq,0 ); +#ifdef CONFIG_LOCAL_TIMERS +local_timer_register (&msm_local_timer_ops); +#endif + } }else { msm_evt.evt = ce; res = request_irq(ce->irq, msm_timer_interrupt,
@@ -191,40 +234,6 @@ err:pr_err ("clocksource_register failed\n" ); } -#ifdef CONFIG_LOCAL_TIMERS -int __cpuinit local_timer_setup (struct clock_event_device *evt) -{ -/* Use existing clock_event for cpu 0 */ -if (!smp_processor_id ()) -return 0 ; - -writel_relaxed (0 , event_base +TIMER_ENABLE ); -writel_relaxed (0 , event_base +TIMER_CLEAR ); -writel_relaxed (~0 , event_base +TIMER_MATCH_VAL ); - evt->irq = msm_clockevent.irq; - evt->name ="local_timer" ; - evt->features = msm_clockevent.features; - evt->rating = msm_clockevent.rating; - evt->set_mode = msm_timer_set_mode; - evt->set_next_event = msm_timer_set_next_event; - evt->shift = msm_clockevent.shift; - evt->mult =div_sc (GPT_HZ ,NSEC_PER_SEC , evt->shift); - evt->max_delta_ns =clockevent_delta2ns (0xf0000000 , evt); - evt->min_delta_ns =clockevent_delta2ns (4 , evt); - - *__this_cpu_ptr (msm_evt.percpu_evt) = evt; -clockevents_register_device (evt); -enable_percpu_irq (evt->irq,0 ); -return 0 ; -} - -void local_timer_stop (struct clock_event_device *evt) -{ - evt->set_mode (CLOCK_EVT_MODE_UNUSED , evt); -disable_percpu_irq (evt->irq); -} -#endif /* CONFIG_LOCAL_TIMERS */ -struct sys_timer msm_timer = { .init = msm_timer_init };
Signature · 1 line
1.7.7.1
PATCH v2 14/15 ARM: local timers: convert MSM to runtime registration interface
Quoted 6 lines · Marc Zyngier
Convert the MSM timers to the runtime registration interface.
Cc Stephen Boyd <[email protected]>Tested-by David Brown <[email protected]>Acked-by David Brown <[email protected]>Signed-off-by Marc Zyngier <[email protected]>
Ok, this is definitely now consistenly causing cpu hotplug to fail. I'll look in to this further, but for now, please removed my Tested-by and Acked-by.
David
Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
PATCH v2 14/15 ARM: local timers: convert MSM to runtime registration interface
Quoted 11 lines · David Brown
Quoted 6 lines · Marc Zyngier
Convert the MSM timers to the runtime registration interface.
Cc Stephen Boyd <[email protected]>Tested-by David Brown <[email protected]>Acked-by David Brown <[email protected]>Signed-off-by Marc Zyngier <[email protected]>Ok, this is definitely now consistenly causing cpu hotplug to fail. I'll look in to this further, but for now, please removed my Tested-by and Acked-by.
That'll be because the local_timer_ops structure is marked __initdata but is used after init has completed. It should be marked __cpuinitdata if it's used for CPU bringup (which it is.)
PATCH v2 14/15 ARM: local timers: convert MSM to runtime registration interface
Quoted 9 lines · Russell King - ARM Linux
Quoted 8 lines · David Brown
Quoted 6 lines · Marc Zyngier
Convert the MSM timers to the runtime registration interface.
Cc Stephen Boyd <[email protected]>Tested-by David Brown <[email protected]>Acked-by David Brown <[email protected]>Signed-off-by Marc Zyngier <[email protected]>
Quoted 7 lines
Quoted 3 lines
Ok, this is definitely now consistenly causing cpu hotplug to fail. I'll look in to this further, but for now, please removed my Tested-by and Acked-by.
That'll be because the
local_timer_opsstructure is marked__initdatabut is used after init has completed. It should be marked__cpuinitdataif it's used for CPU bringup (which it is.)
:-) I guess I should be checking my email while looking for problems. But, I found it anyway.
Thanks,
David
Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
PATCH v2 14/15 ARM: local timers: convert MSM to runtime registration interface
In reply to Marc ZyngierQuoted 1 line · Marc Zyngier
+static struct
local_timer_opsmsm_local_timer_ops__initdata= {
This needs to be __cpuinitdata. With that change, you can put the tested and acked-by back.
David
Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
PATCH v2 14/15 ARM: local timers: convert MSM to runtime registration interface
Quoted 6 lines · David Brown
Quoted 1 line · Marc Zyngier
+static struct
local_timer_opsmsm_local_timer_ops__initdata= {This needs to be
__cpuinitdata. With that change, you can put the tested and acked-by back.
Marc,
There's a bunch of similar problems throughout this patch set - could you look through them and fix please?
PATCH v2 14/15 ARM: local timers: convert MSM to runtime registration interface
Quoted 5 lines · On Fri, 13 Jan 2012 23:29:50 +0000 Russell King - ARM Linux…
Quoted 4 lines · David Brown
Quoted 1 line · Marc Zyngier
+static struct
local_timer_opsmsm_local_timer_ops__initdata= {
Quoted 7 lines
Quoted 2 lines
This needs to be
__cpuinitdata. With that change, you can put the tested and acked-by back.Marc,
There's a bunch of similar problems throughout this patch set - could you look through them and fix please?
Yes, will fix ASAP. Thanks to you and David for pointing this out.
M.
Signature · 1 line
I'm the slime oozin' out from your TV set...
PATCH v2 15/15 ARM: local timers: make the runtime registration interface mandatory
In reply to Marc ZyngierRemove all traces of the compile-time local timer interface, and make the runtime selection mandatory.
--- arch/arm/include/asm/localtimer.h | 26 -------------------------- arch/arm/kernel/smp.c | 8 +++++--- 2 files changed, 5 insertions(+), 29 deletions(-)
arch/arm/include/asm/localtimer.h +0 -26
@@ -19,38 +19,12 @@ struct local_timer_ops {void (*stop)(struct clock_event_device *); }; -/* -* Setup a per-cpu timer, whether it be a local timer or dummy broadcast -*/ -void percpu_timer_setup (void ); -#ifdef CONFIG_LOCAL_TIMERS /* -* Stop the local timer -*/ -void local_timer_stop (struct clock_event_device *); - -/* -* Setup a local timer interrupt for a CPU. -*/ -int local_timer_setup (struct clock_event_device *); - -/* * Register a local timer driver */ int local_timer_register (struct local_timer_ops *); -#else - -static inline int local_timer_setup (struct clock_event_device *evt) -{ -return -ENXIO ; -} - -static inline void local_timer_stop (struct clock_event_device *evt) -{ -} -static inline int local_timer_register (struct local_timer_ops *ops) {return -ENXIO ;
arch/arm/kernel/smp.c +5 -3
@@ -260,6 +260,8 @@ static void __cpuinit smp_store_cpu_info(unsigned int cpuid)store_cpu_topology (cpuid); } +static void percpu_timer_setup (void ); +/* * This is the secondary CPU boot entry. We're using this CPUs * idle thread stack, but a set of temporary page tables.
@@ -488,7 +490,7 @@ int local_timer_register(struct local_timer_ops *ops) }#endif -int __attribute__ ((weak))local_timer_setup (struct clock_event_device *clk) +static int local_timer_setup (struct clock_event_device *clk) {if (lt_ops)return lt_ops->setup (clk);
@@ -496,13 +498,13 @@ int __attribute__ ((weak)) local_timer_setup(struct clock_event_device *clk)return -ENXIO ; } -void __attribute__ ((weak))local_timer_stop (struct clock_event_device *clk) +static void local_timer_stop (struct clock_event_device *clk) {if (lt_ops) lt_ops->stop (clk); } -void __cpuinit percpu_timer_setup (void ) +static void __cpuinit percpu_timer_setup (void ) {unsigned int cpu =smp_processor_id ();struct clock_event_device *evt = &per_cpu (percpu_clockevent, cpu);
Signature · 1 line
1.7.7.1