Skip to contentSkip to conversation

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

PATCH Applied Alok Kataria 2 participants 2 messages Nov 3, 2008 – Nov 4, 2008 x86

lore
Share & tools
lore
#0 lore raw

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

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

From: Alok N Kataria <[email protected]>

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.

---

 arch/x86/kernel/tsc.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
arch/x86/kernel/tsc.c +4 -4
index ee01cd9..8904571 100644
@@ -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);
Applied
#1 lore raw
Quoted 10 lines · Alok Kataria

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

From: Alok N Kataria <[email protected]>

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.

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