Skip to content

Commit 4b5b212

Browse files
lenbKAGA-KOKO
authored andcommitted
x86/tsc: Print tsc_khz, when it differs from cpu_khz
If CPU and TSC frequency are the same the printout of the CPU frequency is valid for the TSC as well: tsc: Detected 2900.000 MHz processor If the TSC frequency is different there is no information in dmesg. Add a conditional printout: tsc: Detected 2904.000 MHz TSC Signed-off-by: Len Brown <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/537b342debcd8e8aebc8d631015dcdf9f9ba8a26.1513920414.git.len.brown@intel.com
1 parent b511203 commit 4b5b212

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

arch/x86/kernel/tsc.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,6 +1316,12 @@ void __init tsc_init(void)
13161316
(unsigned long)cpu_khz / 1000,
13171317
(unsigned long)cpu_khz % 1000);
13181318

1319+
if (cpu_khz != tsc_khz) {
1320+
pr_info("Detected %lu.%03lu MHz TSC",
1321+
(unsigned long)tsc_khz / 1000,
1322+
(unsigned long)tsc_khz % 1000);
1323+
}
1324+
13191325
/* Sanitize TSC ADJUST before cyc2ns gets initialized */
13201326
tsc_store_and_check_tsc_adjust(true);
13211327

0 commit comments

Comments
 (0)