浏览代码

x86: quick TSC calibration, improve

- make sure the final TSC timestamp is reliable too

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Ingo Molnar 16 年之前
父节点
当前提交
4156e9a8ef
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      arch/x86/kernel/tsc.c

+ 6 - 0
arch/x86/kernel/tsc.c

@@ -316,6 +316,12 @@ static unsigned long quick_pit_calibrate(void)
 		}
 		t2 = get_cycles();
 
+		/*
+		 * Make sure we can rely on the second TSC timestamp:
+		 */
+		if (!pit_expect_msb(--expect))
+			goto failed;
+
 		/*
 		 * Ok, if we get here, then we've seen the
 		 * MSB of the PIT decrement QUICK_PIT_ITERATIONS