login
Header Space

 
 

[PATCH] [26/58] x86_64: Use generic xtime init

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <tglx@...>, <patches@...>, <linux-kernel@...>
Date: Thursday, July 19, 2007 - 5:55 am

From: Thomas Gleixner <tglx@linutronix.de>
xtime can be initialized including the cmos update from the generic
timekeeping code. Remove the arch specific implementation.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andi Kleen <ak@suse.de>

---
 arch/x86_64/kernel/time.c |   40 +---------------------------------------
 1 file changed, 1 insertion(+), 39 deletions(-)

Index: linux/arch/x86_64/kernel/time.c
===================================================================
--- linux.orig/arch/x86_64/kernel/time.c
+++ linux/arch/x86_64/kernel/time.c
@@ -193,7 +193,7 @@ static irqreturn_t timer_interrupt(int i
 	return IRQ_HANDLED;
 }
 
-static unsigned long get_cmos_time(void)
+unsigned long read_persistent_clock(void)
 {
 	unsigned int year, mon, day, hour, min, sec;
 	unsigned long flags;
@@ -367,11 +367,6 @@ void __init time_init(void)
 {
 	if (nohpet)
 		hpet_address = 0;
-	xtime.tv_sec = get_cmos_time();
-	xtime.tv_nsec = 0;
-
-	set_normalized_timespec(&wall_to_monotonic,
-	                        -xtime.tv_sec, -xtime.tv_nsec);
 
 	if (hpet_arch_init())
 		hpet_address = 0;
@@ -408,54 +403,21 @@ void __init time_init(void)
 	setup_irq(0, &irq0);
 }
 
-
-static long clock_cmos_diff;
-static unsigned long sleep_start;
-
 /*
  * sysfs support for the timer.
  */
 
 static int timer_suspend(struct sys_device *dev, pm_message_t state)
 {
-	/*
-	 * Estimate time zone so that set_time can update the clock
-	 */
-	long cmos_time =  get_cmos_time();
-
-	clock_cmos_diff = -cmos_time;
-	clock_cmos_diff += get_seconds();
-	sleep_start = cmos_time;
 	return 0;
 }
 
 static int timer_resume(struct sys_device *dev)
 {
-	unsigned long flags;
-	unsigned long sec;
-	unsigned long ctime = get_cmos_time();
-	long sleep_length = (ctime - sleep_start) * HZ;
-
-	if (sleep_length < 0) {
-		printk(KERN_WARNING "Time skew detected in timer resume!\n");
-		/* The time after the resume must not be earlier than the time
-		 * before the suspend or some nasty things will happen
-		 */
-		sleep_length = 0;
-		ctime = sleep_start;
-	}
 	if (hpet_address)
 		hpet_reenable();
 	else
 		i8254_timer_resume();
-
-	sec = ctime + clock_cmos_diff;
-	write_seqlock_irqsave(&xtime_lock,flags);
-	xtime.tv_sec = sec;
-	xtime.tv_nsec = 0;
-	jiffies += sleep_length;
-	write_sequnlock_irqrestore(&xtime_lock,flags);
-	touch_softlockup_watchdog();
 	return 0;
 }
 
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] [0/58] First batch of x86 patches for .23, Andi Kleen, (Thu Jul 19, 5:54 am)
[PATCH] [58/58] x86: remove support for the Rise CPU, Andi Kleen, (Thu Jul 19, 5:55 am)
[PATCH] [55/58] i386: add reference to the arguments, Andi Kleen, (Thu Jul 19, 5:55 am)
[PATCH] [53/58] x86: PM_TRACE support, Andi Kleen, (Thu Jul 19, 5:55 am)
[PATCH] [51/58] i386: fix machine rebooting, Andi Kleen, (Thu Jul 19, 5:55 am)
[PATCH] [48/58] x86_64: O_EXCL on /dev/mcelog, Andi Kleen, (Thu Jul 19, 5:55 am)
[PATCH] [43/58] x86_64: Quicklist support for x86_64, Andi Kleen, (Thu Jul 19, 5:55 am)
[PATCH] [42/58] i386: timer_irq_works() static again, Andi Kleen, (Thu Jul 19, 5:55 am)
[PATCH] [40/58] i386: remapped_pgdat_init() static, Andi Kleen, (Thu Jul 19, 5:55 am)
[PATCH] [39/58] i386: minor nx handling adjustment, Andi Kleen, (Thu Jul 19, 5:55 am)
[PATCH] [34/58] x86_64: ia32entry adjustments, Andi Kleen, (Thu Jul 19, 5:55 am)
Re: [PATCH] [34/58] x86_64: ia32entry adjustments, Jeff Garzik, (Thu Jul 19, 10:46 am)
Re: [PATCH] [34/58] x86_64: ia32entry adjustments, Jan Beulich, (Mon Aug 6, 6:43 am)
Re: [PATCH] [33/58] x86_64: Avoid too many remote cpu refere..., Christoph Hellwig, (Thu Jul 19, 6:21 am)
[PATCH] [30/58] x86: share hpet.h with i386, Andi Kleen, (Thu Jul 19, 5:55 am)
[PATCH] [29/58] x86_64: fiuxp pt_reqs leftovers, Andi Kleen, (Thu Jul 19, 5:55 am)
[PATCH] [28/58] x86_64: Fix APIC typo, Andi Kleen, (Thu Jul 19, 5:55 am)
[PATCH] [26/58] x86_64: Use generic xtime init, Andi Kleen, (Thu Jul 19, 5:55 am)
[PATCH] [25/58] x86_64: use generic cmos update, Andi Kleen, (Thu Jul 19, 5:55 am)
[PATCH] [23/58] i386: remove pit_interrupt_hook, Andi Kleen, (Thu Jul 19, 5:55 am)
[PATCH] [20/58] x86: Always probe the NMI watchdog, Andi Kleen, (Thu Jul 19, 5:55 am)
[PATCH] [15/58] i386: Rewrite sched_clock, Andi Kleen, (Thu Jul 19, 5:54 am)
Re: [PATCH] [15/58] i386: Rewrite sched_clock, Daniel Walker, (Thu Jul 19, 12:51 pm)
Re: [PATCH] [15/58] i386: Rewrite sched_clock, Mathieu Desnoyers, (Thu Jul 19, 11:11 pm)
Re: [PATCH] [15/58] i386: Rewrite sched_clock, Andi Kleen, (Fri Jul 20, 4:27 am)
Re: [PATCH] [15/58] i386: Rewrite sched_clock, Mathieu Desnoyers, (Fri Jul 20, 10:12 am)
Re: [PATCH] [15/58] i386: Rewrite sched_clock, Andi Kleen, (Fri Jul 20, 11:14 am)
[PATCH] 80386 and 80486 cmpxchg64 and cmpxchg64_local fallback, Mathieu Desnoyers, (Fri Jul 20, 12:49 pm)
Re: [PATCH] [15/58] i386: Rewrite sched_clock, Mathieu Desnoyers, (Fri Jul 20, 11:22 am)
Re: [PATCH] [15/58] i386: Rewrite sched_clock, Mathieu Desnoyers, (Fri Jul 20, 10:39 am)
Re: [PATCH] [15/58] i386: Rewrite sched_clock, Mathieu Desnoyers, (Thu Jul 19, 11:47 pm)
Re: [PATCH] [15/58] i386: Rewrite sched_clock (cmpxchg8b), Mathieu Desnoyers, (Fri Jul 20, 12:18 am)
Re: [PATCH] [15/58] i386: Rewrite sched_clock (cmpxchg8b), Mathieu Desnoyers, (Fri Jul 20, 1:47 am)
Re: [PATCH] [15/58] i386: Rewrite sched_clock, Andi Kleen, (Thu Jul 19, 1:13 pm)
Re: [PATCH] [15/58] i386: Rewrite sched_clock, Daniel Walker, (Thu Jul 19, 1:15 pm)
Re: [PATCH] [15/58] i386: Rewrite sched_clock, Andi Kleen, (Thu Jul 19, 1:22 pm)
Re: [PATCH] [15/58] i386: Rewrite sched_clock, Daniel Walker, (Thu Jul 19, 1:31 pm)
Re: [PATCH] [15/58] i386: Rewrite sched_clock, Andi Kleen, (Thu Jul 19, 1:38 pm)
Re: [PATCH] [15/58] i386: Rewrite sched_clock, Daniel Walker, (Thu Jul 19, 1:43 pm)
Re: [PATCH] [15/58] i386: Rewrite sched_clock, Andi Kleen, (Thu Jul 19, 2:00 pm)
Re: [PATCH] [15/58] i386: Rewrite sched_clock, Daniel Walker, (Thu Jul 19, 2:00 pm)
[PATCH] [14/58] x86_64: Add on_cpu_single, Andi Kleen, (Thu Jul 19, 5:54 am)
Re: [PATCH] [14/58] x86_64: Add on_cpu_single, Satyam Sharma, (Thu Jul 19, 7:09 am)
Re: [PATCH] [14/58] x86_64: Add on_cpu_single, Andi Kleen, (Thu Jul 19, 8:07 am)
speck-geostationary