Patchwork [3/4] Reduce TSC calibrations from 20ms to 2ms.

login
register
about
Submitter Kevin O'Connor
Date 2010-09-06 23:24:11
Message ID <7986f0442d0e6007a1d479241229158fc4f902b9.1283815188.git.kevin@koconnor.net>
Download mbox | patch
Permalink /patch/1877/
State Accepted
Commit r5780
Headers show

Comments

Kevin O'Connor - 2010-09-06 23:24:11
2ms is enough time to accurately obtain the clock rate.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
---
 src/cpu/x86/tsc/delay_tsc.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Patrick Georgi - 2010-09-07 07:54:11
Am 07.09.2010 01:24, schrieb Kevin O'Connor:
> 2ms is enough time to accurately obtain the clock rate.
> 
> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Acked-by: Patrick Georgi <patrick.georgi@coresystems.de>

In as r5780


Thanks,
Patrick

Patch

diff --git a/src/cpu/x86/tsc/delay_tsc.c b/src/cpu/x86/tsc/delay_tsc.c
index 27c89e3..1127867 100644
--- a/src/cpu/x86/tsc/delay_tsc.c
+++ b/src/cpu/x86/tsc/delay_tsc.c
@@ -18,8 +18,8 @@  static unsigned long clocks_per_usec;
  * device.
  */
 
-#define CALIBRATE_INTERVAL ((20*CLOCK_TICK_RATE)/1000) /* 20ms */
-#define CALIBRATE_DIVISOR  (20*1000) /* 20ms / 20000 == 1usec */
+#define CALIBRATE_INTERVAL ((2*CLOCK_TICK_RATE)/1000) /* 2ms */
+#define CALIBRATE_DIVISOR  (2*1000) /* 2ms / 2000 == 1usec */
 
 static unsigned long long calibrate_tsc(void)
 {