|
@@ -1244,7 +1244,7 @@ static void tsc_refine_calibration_work(struct work_struct *work)
|
|
|
|
|
|
/* Don't bother refining TSC on unstable systems */
|
|
/* Don't bother refining TSC on unstable systems */
|
|
if (tsc_unstable)
|
|
if (tsc_unstable)
|
|
- return;
|
|
|
|
|
|
+ goto unreg;
|
|
|
|
|
|
/*
|
|
/*
|
|
* Since the work is started early in boot, we may be
|
|
* Since the work is started early in boot, we may be
|
|
@@ -1297,11 +1297,12 @@ static void tsc_refine_calibration_work(struct work_struct *work)
|
|
|
|
|
|
out:
|
|
out:
|
|
if (tsc_unstable)
|
|
if (tsc_unstable)
|
|
- return;
|
|
|
|
|
|
+ goto unreg;
|
|
|
|
|
|
if (boot_cpu_has(X86_FEATURE_ART))
|
|
if (boot_cpu_has(X86_FEATURE_ART))
|
|
art_related_clocksource = &clocksource_tsc;
|
|
art_related_clocksource = &clocksource_tsc;
|
|
clocksource_register_khz(&clocksource_tsc, tsc_khz);
|
|
clocksource_register_khz(&clocksource_tsc, tsc_khz);
|
|
|
|
+unreg:
|
|
clocksource_unregister(&clocksource_tsc_early);
|
|
clocksource_unregister(&clocksource_tsc_early);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1311,8 +1312,8 @@ static int __init init_tsc_clocksource(void)
|
|
if (!boot_cpu_has(X86_FEATURE_TSC) || tsc_disabled > 0 || !tsc_khz)
|
|
if (!boot_cpu_has(X86_FEATURE_TSC) || tsc_disabled > 0 || !tsc_khz)
|
|
return 0;
|
|
return 0;
|
|
|
|
|
|
- if (check_tsc_unstable())
|
|
|
|
- return 0;
|
|
|
|
|
|
+ if (tsc_unstable)
|
|
|
|
+ goto unreg;
|
|
|
|
|
|
if (tsc_clocksource_reliable)
|
|
if (tsc_clocksource_reliable)
|
|
clocksource_tsc.flags &= ~CLOCK_SOURCE_MUST_VERIFY;
|
|
clocksource_tsc.flags &= ~CLOCK_SOURCE_MUST_VERIFY;
|
|
@@ -1328,6 +1329,7 @@ static int __init init_tsc_clocksource(void)
|
|
if (boot_cpu_has(X86_FEATURE_ART))
|
|
if (boot_cpu_has(X86_FEATURE_ART))
|
|
art_related_clocksource = &clocksource_tsc;
|
|
art_related_clocksource = &clocksource_tsc;
|
|
clocksource_register_khz(&clocksource_tsc, tsc_khz);
|
|
clocksource_register_khz(&clocksource_tsc, tsc_khz);
|
|
|
|
+unreg:
|
|
clocksource_unregister(&clocksource_tsc_early);
|
|
clocksource_unregister(&clocksource_tsc_early);
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|