public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: Don't use tsc_khz to calculate lpj if notsc is passed.
@ 2008-11-03 19:18 Alok Kataria
  2008-11-04  8:55 ` Ingo Molnar
  0 siblings, 1 reply; 2+ messages in thread
From: Alok Kataria @ 2008-11-03 19:18 UTC (permalink / raw)
  To: Ingo Molnar, the arch/x86 maintainers
  Cc: Bartlomiej Zolnierkiewicz, stable, LKML

x86: Don't use tsc_khz to calculate lpj if notsc is passed.

From: Alok N Kataria <akataria@vmware.com>

With notsc passed on commandline, tsc may not be used for
udelays, make sure that we do not use tsc_khz to calculate
the lpj value in such cases.

Signed-off-by: Alok N Kataria <akataria@vmware.com>
Cc: stable@kernel.org

---

 arch/x86/kernel/tsc.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)


diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index ee01cd9..8904571 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -829,10 +829,6 @@ void __init tsc_init(void)
 		cpu_khz = calibrate_cpu();
 #endif
 
-	lpj = ((u64)tsc_khz * 1000);
-	do_div(lpj, HZ);
-	lpj_fine = lpj;
-
 	printk("Detected %lu.%03lu MHz processor.\n",
 			(unsigned long)cpu_khz / 1000,
 			(unsigned long)cpu_khz % 1000);
@@ -852,6 +848,10 @@ void __init tsc_init(void)
 	/* now allow native_sched_clock() to use rdtsc */
 	tsc_disabled = 0;
 
+	lpj = ((u64)tsc_khz * 1000);
+	do_div(lpj, HZ);
+	lpj_fine = lpj;
+	
 	use_tsc_delay();
 	/* Check and install the TSC clocksource */
 	dmi_check_system(bad_tsc_dmi_table);



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

* Re: [PATCH] x86: Don't use tsc_khz to calculate lpj if notsc is passed.
  2008-11-03 19:18 [PATCH] x86: Don't use tsc_khz to calculate lpj if notsc is passed Alok Kataria
@ 2008-11-04  8:55 ` Ingo Molnar
  0 siblings, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2008-11-04  8:55 UTC (permalink / raw)
  To: Alok Kataria
  Cc: the arch/x86 maintainers, Bartlomiej Zolnierkiewicz, stable, LKML,
	Thomas Gleixner, H. Peter Anvin


* Alok Kataria <akataria@vmware.com> wrote:

> x86: Don't use tsc_khz to calculate lpj if notsc is passed.
> 
> From: Alok N Kataria <akataria@vmware.com>
> 
> With notsc passed on commandline, tsc may not be used for
> udelays, make sure that we do not use tsc_khz to calculate
> the lpj value in such cases.
> 
> Signed-off-by: Alok N Kataria <akataria@vmware.com>
> Cc: stable@kernel.org

applied to tip/x86/urgent, thanks Alok!

btw., i fixed this error checkpatch noticed:

ERROR: trailing whitespace
#41: FILE: arch/x86/kernel/tsc.c:838:
+^I$

total: 1 errors, 0 warnings, 0 checks, 20 lines checked

	Ingo

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

end of thread, other threads:[~2008-11-04  8:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-03 19:18 [PATCH] x86: Don't use tsc_khz to calculate lpj if notsc is passed Alok Kataria
2008-11-04  8:55 ` Ingo Molnar

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