x86, vmi: TSC going backwards check in vmi clocksource, cleanup
clean up vmi_read_cycles to use max() Reported-b: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Alok N Kataria <akataria@vmware.com> Cc: Zach Amsden <zach@vmware.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
committed by
Ingo Molnar
parent
609162850d
commit
fdb17aeb28
@@ -288,8 +288,7 @@ static struct clocksource clocksource_vmi;
|
|||||||
static cycle_t read_real_cycles(void)
|
static cycle_t read_real_cycles(void)
|
||||||
{
|
{
|
||||||
cycle_t ret = (cycle_t)vmi_timer_ops.get_cycle_counter(VMI_CYCLES_REAL);
|
cycle_t ret = (cycle_t)vmi_timer_ops.get_cycle_counter(VMI_CYCLES_REAL);
|
||||||
return ret >= clocksource_vmi.cycle_last ?
|
return max(ret, clocksource_vmi.cycle_last);
|
||||||
ret : clocksource_vmi.cycle_last;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct clocksource clocksource_vmi = {
|
static struct clocksource clocksource_vmi = {
|
||||||
|
Reference in New Issue
Block a user