Re: [RFC patch 21/32] x86: Add timer_init to platform

Andrey Panin
2009-08-24T06:56:42Z

On 233, 08 21, 2009 at 09:31:20 -0000, Thomas Gleixner wrote:
> The timer init code is convoluted with several quirks and the paravirt
> timer chooser. Figuring out which code path is actually taken is not
> for the faint hearted.
>
> Move the numaq TSC quirk to tsc_pre_init platform function and replace
> the paravirt time chooser and the remaining x86 quirk with a simple
> platform setup function.

> Index: linux-2.6/arch/x86/kernel/visws_quirks.c
> ===================================================================
> --- linux-2.6.orig/arch/x86/kernel/visws_quirks.c
> +++ linux-2.6/arch/x86/kernel/visws_quirks.c
> @@ -30,6 +30,7 @@
> #include <asm/setup.h>
> #include <asm/apic.h>
> #include <asm/e820.h>
> +#include <asm/time.h>
> #include <asm/io.h>
>
> #include <linux/kernel_stat.h>
> @@ -53,8 +54,10 @@ int is_visws_box(void)
> return visws_board_type >= 0;
> }
>
> -static int __init visws_time_init(void)
> +static void __init visws_time_init(void)
> {
> + hpet_time_init();

What's the purpose of this line ? It's highly unlikely that there is HPET hidden
somewhere inside VisWs :)

> printk(KERN_INFO "Starting Cobalt Timer system clock\n");
>
> /* Set the countdown value */
> @@ -65,12 +68,6 @@ static int __init visws_time_init(void)
>
> /* Enable (unmask) the timer interrupt */
> co_cpu_write(CO_CPU_CTRL, co_cpu_read(CO_CPU_CTRL) & ~CO_CTRL_TIMEMASK);
> -
> - /*
> - * Zero return means the generic timer setup code will set up
> - * the standard vector:
> - */
> - return 0;
> }
>