public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] linux-2.5.59_timer-tsc-cleanup_A0
@ 2003-01-17  2:52 john stultz
       [not found] ` <22767.1042793253@www52.gmx.net>
  0 siblings, 1 reply; 3+ messages in thread
From: john stultz @ 2003-01-17  2:52 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: Martin J. Bligh, lkml

Linus, Andrew, All,
        Just a resend/resync for 2.5.59. This patch cleans up the
timer_tsc code, removing the unused use_tsc variable and making
fast_gettimeoffset_quotient static.

Please apply.

thanks
-john


diff -Nru a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c
--- a/arch/i386/kernel/smpboot.c	Thu Jan 16 18:46:42 2003
+++ b/arch/i386/kernel/smpboot.c	Thu Jan 16 18:46:42 2003
@@ -182,8 +182,6 @@
 
 #define NR_LOOPS 5
 
-extern unsigned long fast_gettimeoffset_quotient;
-
 /*
  * accurate 64-bit/32-bit division, expanded to 32-bit divisions and 64-bit
  * multiplication. Not terribly optimized but we need it at boot time only
@@ -223,7 +221,8 @@
 
 	printk("checking TSC synchronization across %u CPUs: ", num_booting_cpus());
 
-	one_usec = ((1<<30)/fast_gettimeoffset_quotient)*(1<<2);
+	/* convert from kcyc/sec to cyc/usec */
+	one_usec = cpu_khz / 1000;
 
 	atomic_set(&tsc_start_flag, 1);
 	wmb();
diff -Nru a/arch/i386/kernel/timers/timer_tsc.c b/arch/i386/kernel/timers/timer_tsc.c
--- a/arch/i386/kernel/timers/timer_tsc.c	Thu Jan 16 18:46:42 2003
+++ b/arch/i386/kernel/timers/timer_tsc.c	Thu Jan 16 18:46:42 2003
@@ -18,7 +18,6 @@
 
 extern spinlock_t i8253_lock;
 
-static int use_tsc;
 /* Number of usecs that the last interrupt was delayed */
 static int delay_at_last_interrupt;
 
@@ -29,7 +28,7 @@
  * Equal to 2^32 * (1 / (clocks per usec) ).
  * Initialized in time_init.
  */
-unsigned long fast_gettimeoffset_quotient;
+static unsigned long fast_gettimeoffset_quotient;
 
 static unsigned long get_offset_tsc(void)
 {
@@ -277,7 +276,6 @@
 		unsigned long tsc_quotient = calibrate_tsc();
 		if (tsc_quotient) {
 			fast_gettimeoffset_quotient = tsc_quotient;
-			use_tsc = 1;
 			/*
 			 *	We could be more selective here I suspect
 			 *	and just enable this for the next intel chips ?




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] linux-2.5.59_timer-tsc-cleanup_A0
       [not found] ` <22767.1042793253@www52.gmx.net>
@ 2003-01-17  9:02   ` Dominik Brodowski
  2003-01-17 19:16     ` john stultz
  0 siblings, 1 reply; 3+ messages in thread
From: Dominik Brodowski @ 2003-01-17  9:02 UTC (permalink / raw)
  To: john stultz; +Cc: linux-kernel, torvalds, akpm

Hi John,

On Fri, Jan 17, 2003 at 09:47:33AM +0100, john stultz wrote:
> Linus, Andrew, All,
>         Just a resend/resync for 2.5.59. This patch cleans up the
> timer_tsc code, removing the unused use_tsc variable and making
> fast_gettimeoffset_quotient static.

use_tsc is _not_ unused -- it's used at least in time_cpufreq_notifier (even
though time_cpufreq_notifier didn't introduce use_tsc, it's in there the
same way it's in 2.4. time.c ). So please don't remove it.

	Dominik

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] linux-2.5.59_timer-tsc-cleanup_A0
  2003-01-17  9:02   ` Dominik Brodowski
@ 2003-01-17 19:16     ` john stultz
  0 siblings, 0 replies; 3+ messages in thread
From: john stultz @ 2003-01-17 19:16 UTC (permalink / raw)
  To: Dominik Brodowski; +Cc: lkml, Linus Torvalds, akpm

On Fri, 2003-01-17 at 01:02, Dominik Brodowski wrote:
> Hi John,
> 
> On Fri, Jan 17, 2003 at 09:47:33AM +0100, john stultz wrote:
> > Linus, Andrew, All,
> >         Just a resend/resync for 2.5.59. This patch cleans up the
> > timer_tsc code, removing the unused use_tsc variable and making
> > fast_gettimeoffset_quotient static.
> 
> use_tsc is _not_ unused -- it's used at least in time_cpufreq_notifier (even
> though time_cpufreq_notifier didn't introduce use_tsc, it's in there the
> same way it's in 2.4. time.c ). So please don't remove it.

<Groan> Oh yikes, that totally snuck by me.

Thanks for pointing that out, I'll remove the chance from my patch
immediately. 

thanks again,
-dumbo^W-john





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-01-17 19:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-17  2:52 [PATCH] linux-2.5.59_timer-tsc-cleanup_A0 john stultz
     [not found] ` <22767.1042793253@www52.gmx.net>
2003-01-17  9:02   ` Dominik Brodowski
2003-01-17 19:16     ` john stultz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox