Message ID | 1353349867-28494-12-git-send-email-swarren@wwwdotorg.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Tue, Nov 20, 2012 at 2:31 AM, Stephen Warren <swarren@wwwdotorg.org> wrote: > From: Stephen Warren <swarren@nvidia.com> > > Now that the only field in struct sys_timer is .init, delete the struct, > and replace the machine descriptor .timer field with the initialization > function itself. > > This will enable moving timer drivers into drivers/clocksource without > having to place a public prototype of each struct sys_timer object into > include/linux; the intent is to create a single of_clocksource_init() > function that determines which timer driver to initialize by scanning > the device dtree, much like the proposed irqchip_init() at: > http://www.spinics.net/lists/arm-kernel/msg203686.html > > Signed-off-by: Stephen Warren <swarren@nvidia.com> > Tested-by: Robert Jarzmik <robert.jarzmik@free.fr> > --- > v3: Minor merge conflicts due to rebasing onto next-20121115. > v2: Converted all platforms, not just Tegra. > > The patch is very large, so I've trimmed it for the mailing list, leaving > only the core ARM changes, changes outside arch/arm, and a single machine > example. The full series can be found at: > > git://nv-tegra.nvidia.com/user/swarren/linux-2.6 arm_timer_rework > --- > 492 files changed, 622 insertions(+), 1199 deletions(-) I checked the patch for mach-mmp. @@ -69,7 +65,7 @@ static const char *mmp_dt_board_compat[] __initdata = { DT_MACHINE_START(PXA168_DT, "Marvell PXA168 (Device Tree Support)") .map_io = mmp_map_io, .init_irq = mmp_dt_irq_init, - .timer = &mmp_dt_timer, + .init_time = mmp_dt_init_timer, .init_machine = pxa168_dt_init, .dt_compat = mmp_dt_board_compat, MACHINE_END @@ -77,7 +73,7 @@ MACHINE_END DT_MACHINE_START(PXA910_DT, "Marvell PXA910 (Device Tree Support)") .map_io = mmp_map_io, .init_irq = mmp_dt_irq_init, - .timer = &mmp_dt_timer, + .init_time = mmp_dt_timer_init, .init_machine = pxa910_dt_init, .dt_compat = mmp_dt_board_compat, MACHINE_END This first init_time is assigned by mmp_dt_init_timer. But the second init_time is assigned by mmp_dt_timer_init. I think it's a typo error. Could you help to fix this? Regards Haojian
On 11/20/2012 09:43 PM, Haojian Zhuang wrote: > On Tue, Nov 20, 2012 at 2:31 AM, Stephen Warren <swarren@wwwdotorg.org> wrote: >> From: Stephen Warren <swarren@nvidia.com> >> >> Now that the only field in struct sys_timer is .init, delete the struct, >> and replace the machine descriptor .timer field with the initialization >> function itself. >> >> This will enable moving timer drivers into drivers/clocksource without >> having to place a public prototype of each struct sys_timer object into >> include/linux; the intent is to create a single of_clocksource_init() >> function that determines which timer driver to initialize by scanning >> the device dtree, much like the proposed irqchip_init() at: >> http://www.spinics.net/lists/arm-kernel/msg203686.html ... > I checked the patch for mach-mmp. > > @@ -69,7 +65,7 @@ static const char *mmp_dt_board_compat[] __initdata = { > DT_MACHINE_START(PXA168_DT, "Marvell PXA168 (Device Tree Support)") > .map_io = mmp_map_io, > .init_irq = mmp_dt_irq_init, > - .timer = &mmp_dt_timer, > + .init_time = mmp_dt_init_timer, > .init_machine = pxa168_dt_init, > .dt_compat = mmp_dt_board_compat, > MACHINE_END > @@ -77,7 +73,7 @@ MACHINE_END > DT_MACHINE_START(PXA910_DT, "Marvell PXA910 (Device Tree Support)") > .map_io = mmp_map_io, > .init_irq = mmp_dt_irq_init, > - .timer = &mmp_dt_timer, > + .init_time = mmp_dt_timer_init, > .init_machine = pxa910_dt_init, > .dt_compat = mmp_dt_board_compat, > MACHINE_END > > This first init_time is assigned by mmp_dt_init_timer. But the second > init_time is > assigned by mmp_dt_timer_init. I think it's a typo error. Could you > help to fix this? Thanks, I've fixed that up locally.
diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h index 917d4fc..308ad7d 100644 --- a/arch/arm/include/asm/mach/arch.h +++ b/arch/arm/include/asm/mach/arch.h @@ -12,7 +12,6 @@ struct tag; struct meminfo; -struct sys_timer; struct pt_regs; struct smp_operations; #ifdef CONFIG_SMP @@ -48,7 +47,7 @@ struct machine_desc { void (*map_io)(void);/* IO mapping function */ void (*init_early)(void); void (*init_irq)(void); - struct sys_timer *timer; /* system tick timer */ + void (*init_time)(void); void (*init_machine)(void); void (*init_late)(void); #ifdef CONFIG_MULTI_IRQ_HANDLER diff --git a/arch/arm/include/asm/mach/time.h b/arch/arm/include/asm/mach/time.h index d316d76..90c12e1 100644 --- a/arch/arm/include/asm/mach/time.h +++ b/arch/arm/include/asm/mach/time.h @@ -10,22 +10,6 @@ #ifndef __ASM_ARM_MACH_TIME_H #define __ASM_ARM_MACH_TIME_H -/* - * This is our kernel timer structure. - * - * - init - * Initialise the kernels jiffy timer source, claim interrupt - * using setup_irq. This is called early on during initialisation - * while interrupts are still disabled on the local CPU. - * - offset - * Return the timer offset in microseconds since the last timer - * interrupt. Note: this must take account of any unprocessed - * timer interrupt which may be pending. - */ -struct sys_timer { - void (*init)(void); -}; - extern void timer_tick(void); struct timespec; diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c index 0b51a7c..955d92d 100644 --- a/arch/arm/kernel/time.c +++ b/arch/arm/kernel/time.c @@ -30,11 +30,6 @@ #include <asm/mach/arch.h> #include <asm/mach/time.h> -/* - * Our system timer. - */ -static struct sys_timer *system_timer; - #if defined(CONFIG_RTC_DRV_CMOS) || defined(CONFIG_RTC_DRV_CMOS_MODULE) || \ defined(CONFIG_NVRAM) || defined(CONFIG_NVRAM_MODULE) /* this needs a better home */ @@ -120,8 +115,6 @@ int __init register_persistent_clock(clock_access_fn read_boot, void __init time_init(void) { - system_timer = machine_desc->timer; - system_timer->init(); + machine_desc->init_time(); sched_clock_postinit(); } - diff --git a/arch/arm/mach-at91/at91rm9200_time.c b/arch/arm/mach-at91/at91rm9200_time.c index aaa443b..a83c5cf 100644 --- a/arch/arm/mach-at91/at91rm9200_time.c +++ b/arch/arm/mach-at91/at91rm9200_time.c @@ -215,8 +215,3 @@ void __init at91rm9200_timer_init(void) /* register clocksource */ clocksource_register_hz(&clk32k, AT91_SLOW_CLOCK); } - -struct sys_timer at91rm9200_timer = { - .init = at91rm9200_timer_init, -}; - diff --git a/arch/arm/mach-at91/board-1arm.c b/arch/arm/mach-at91/board-1arm.c index b99b575..35ab632 100644 --- a/arch/arm/mach-at91/board-1arm.c +++ b/arch/arm/mach-at91/board-1arm.c @@ -90,7 +90,7 @@ static void __init onearm_board_init(void) MACHINE_START(ONEARM, "Ajeco 1ARM single board computer") /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */ - .timer = &at91rm9200_timer, + .init_time = at91rm9200_timer_init, .map_io = at91_map_io, .handle_irq = at91_aic_handle_irq, .init_early = onearm_init_early, diff --git a/drivers/clocksource/bcm2835_timer.c b/drivers/clocksource/bcm2835_timer.c index bc19f12c..7f796d8f 100644 --- a/drivers/clocksource/bcm2835_timer.c +++ b/drivers/clocksource/bcm2835_timer.c @@ -101,7 +101,7 @@ static struct of_device_id bcm2835_time_match[] __initconst = { {} }; -static void __init bcm2835_time_init(void) +void __init bcm2835_timer_init(void) { struct device_node *node; void __iomem *base; @@ -155,7 +155,3 @@ static void __init bcm2835_time_init(void) pr_info("bcm2835: system timer (irq = %d)\n", irq); } - -struct sys_timer bcm2835_timer = { - .init = bcm2835_time_init, -}; diff --git a/drivers/clocksource/dw_apb_timer_of.c b/drivers/clocksource/dw_apb_timer_of.c index f7dba5b..ab09ed3 100644 --- a/drivers/clocksource/dw_apb_timer_of.c +++ b/drivers/clocksource/dw_apb_timer_of.c @@ -107,7 +107,7 @@ static const struct of_device_id osctimer_ids[] __initconst = { {}, }; -static void __init timer_init(void) +void __init dw_apb_timer_init(void) { struct device_node *event_timer, *source_timer; @@ -125,7 +125,3 @@ static void __init timer_init(void) init_sched_clock(); } - -struct sys_timer dw_apb_timer = { - .init = timer_init, -}; diff --git a/include/linux/bcm2835_timer.h b/include/linux/bcm2835_timer.h index 25680fe..ca17aa8 100644 --- a/include/linux/bcm2835_timer.h +++ b/include/linux/bcm2835_timer.h @@ -17,6 +17,6 @@ #include <asm/mach/time.h> -extern struct sys_timer bcm2835_timer; +extern void bcm2835_timer_init(void); #endif diff --git a/include/linux/dw_apb_timer.h b/include/linux/dw_apb_timer.h index 1148575..dd755ce 100644 --- a/include/linux/dw_apb_timer.h +++ b/include/linux/dw_apb_timer.h @@ -53,5 +53,5 @@ void dw_apb_clocksource_start(struct dw_apb_clocksource *dw_cs); cycle_t dw_apb_clocksource_read(struct dw_apb_clocksource *dw_cs); void dw_apb_clocksource_unregister(struct dw_apb_clocksource *dw_cs); -extern struct sys_timer dw_apb_timer; +extern void dw_apb_timer_init(void); #endif /* __DW_APB_TIMER_H__ */