[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <46779353.7010709@innova-card.com>
Date: Tue, 19 Jun 2007 10:26:59 +0200
From: Franck Bui-Huu <vagabon.xyz@...il.com>
To: Thomas Gleixner <tglx@...utronix.de>
CC: LKML <linux-kernel@...r.kernel.org>, Andrew Morton <akpm@...l.org>,
Ingo Molnar <mingo@...e.hu>, Andi Kleen <ak@...e.de>,
Chris Wright <chrisw@...s-sol.org>,
Arjan van de Ven <arjan@...radead.org>,
Venkatesh Pallipadi <venkatesh.pallipadi@...el.com>,
john stultz <johnstul@...ibm.com>,
David Miller <davem@...emloft.net>
Subject: Re: [patch-mm 14/25] NTP: Move the cmos update code into ntp.c
Hi Thomas,
Thomas Gleixner wrote:
> i386 and sparc64 have the identical code to update the cmos clock.
> Move it into kernel/time/ntp.c as there are other architectures
> coming along with the same requirements.
>
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> Cc: Chris Wright <chrisw@...s-sol.org>
> Cc: Ingo Molnar <mingo@...e.hu>
> Cc: john stultz <johnstul@...ibm.com>
> Cc: David Miller <davem@...emloft.net>
>
> ---
> arch/i386/Kconfig | 4 +++
> arch/i386/kernel/time.c | 50 +-------------------------------------
> arch/sparc64/Kconfig | 4 +++
> arch/sparc64/kernel/time.c | 53 +---------------------------------------
> include/asm-i386/timer.h | 1
> include/linux/time.h | 2 +
> kernel/time/ntp.c | 59 ++++++++++++++++++++++++++++++++++++++++++---
> 7 files changed, 70 insertions(+), 103 deletions(-)
>
[snip]
> /* Kick start a stopped clock (procedure from the Sun NVRAM/hostid FAQ). */
> Index: linux-2.6.22-rc4-mm/include/linux/time.h
> ===================================================================
> --- linux-2.6.22-rc4-mm.orig/include/linux/time.h 2007-06-16 12:10:21.000000000 +0200
> +++ linux-2.6.22-rc4-mm/include/linux/time.h 2007-06-16 12:10:24.000000000 +0200
> @@ -93,6 +93,8 @@ extern struct timespec wall_to_monotonic
> extern seqlock_t xtime_lock __attribute__((weak));
>
> extern unsigned long read_persistent_clock(void);
> +extern int update_persistent_clock(struct timespec now);
I'm wondering if update_persistent_clock shouldn't be part of
"drivers/rtc/*" framework. Do you have any idea on how this
is going to be implemented on platforms that use this framework ?
> +extern int no_sync_cmos_clock __read_mostly;
> void timekeeping_init(void);
>
> static inline unsigned long get_seconds(void)
> Index: linux-2.6.22-rc4-mm/kernel/time/ntp.c
> ===================================================================
> --- linux-2.6.22-rc4-mm.orig/kernel/time/ntp.c 2007-06-16 12:10:21.000000000 +0200
> +++ linux-2.6.22-rc4-mm/kernel/time/ntp.c 2007-06-16 12:10:24.000000000 +0200
> @@ -10,6 +10,7 @@
>
> #include <linux/mm.h>
> #include <linux/time.h>
> +#include <linux/timer.h>
> #include <linux/timex.h>
> #include <linux/jiffies.h>
> #include <linux/hrtimer.h>
> @@ -187,12 +188,64 @@ u64 current_tick_length(void)
> return tick_length;
> }
>
> +#ifdef CONFIG_GENERIC_CMOS_UPDATE
>
> -void __attribute__ ((weak)) notify_arch_cmos_timer(void)
> +/* Disable the cmos update - used by virtualization and embedded */
> +int no_sync_cmos_clock __read_mostly;
> +
[snip]
>
> +static void notify_cmos_timer(void)
> +{
> + if (no_sync_cmos_clock)
> + mod_timer(&sync_cmos_timer, jiffies + 1);
> +}
Isn't the test condition wrong ? Shouldn't it be:
if (!no_sync_cmos_clock)
mod_timer(&sync_cmos_timer, jiffies + 1);
Thanks,
Franck
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists