]> Git Repo - linux.git/commitdiff
sched/x86/tsc: Initialize multiplier to 0
authorPeter Zijlstra <[email protected]>
Wed, 22 Jan 2014 21:08:14 +0000 (22:08 +0100)
committerIngo Molnar <[email protected]>
Thu, 23 Jan 2014 13:48:36 +0000 (14:48 +0100)
Since we keep the clock value linearly continuous on frequency change,
make sure the initial multiplier is 0, such that our initial value is 0.
Without this we compute the initial value at whatever the TSC has
managed to reach since power-on.

Reported-and-Tested-by: Markus Trippelsdorf <[email protected]>
Fixes: 20d1c86a57762 ("sched/clock, x86: Rewrite cyc2ns() to avoid the need to disable IRQs")
Cc: [email protected]
Cc: [email protected]
Cc: Eliezer Tamir <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: Mike Galbraith <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: John Stultz <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Arjan van de Ven <[email protected]>
Cc: Sasha Levin <[email protected]>
Cc: [email protected]
Signed-off-by: Peter Zijlstra <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
arch/x86/kernel/tsc.c

index a3acbac2ee7254d0fc67741e6146d74f3b85d58c..19e5adb49a27d8ae4f586ad88b30faeef0f8e727 100644 (file)
@@ -180,7 +180,7 @@ static void cyc2ns_write_end(int cpu, struct cyc2ns_data *data)
 
 static void cyc2ns_data_init(struct cyc2ns_data *data)
 {
-       data->cyc2ns_mul = 1U << CYC2NS_SCALE_FACTOR;
+       data->cyc2ns_mul = 0;
        data->cyc2ns_shift = CYC2NS_SCALE_FACTOR;
        data->cyc2ns_offset = 0;
        data->__count = 0;
This page took 0.067091 seconds and 4 git commands to generate.