]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
x86/smpboot: Make optimization of delay calibration work correctly
authorPavel Tatashin <pasha.tatashin@oracle.com>
Sat, 28 Oct 2017 00:11:00 +0000 (20:11 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Nov 2017 09:09:19 +0000 (10:09 +0100)
commitb192d70c54b74684a2fd515a13da60ace3270daa
treeef6567d4023ccf7d6b3c0ee36358b598d7f0fc48
parent466d590ebd51a8af77116fe81cf13a134ea5b119
x86/smpboot: Make optimization of delay calibration work correctly

commit 76ce7cfe35ef58f34e6ba85327afb5fbf6c3ff9b upstream.

If the TSC has constant frequency then the delay calibration can be skipped
when it has been calibrated for a package already. This is checked in
calibrate_delay_is_known(), but that function is buggy in two aspects:

It returns 'false' if

  (!tsc_disabled && !cpu_has(&cpu_data(cpu), X86_FEATURE_CONSTANT_TSC)

which is obviously the reverse of the intended check and the check for the
sibling mask cannot work either because the topology links have not been
set up yet.

Correct the condition and move the call to set_cpu_sibling_map() before
invoking calibrate_delay() so the sibling check works correctly.

[ tglx: Rewrote changelong ]

Fixes: c25323c07345 ("x86/tsc: Use topology functions")
Signed-off-by: Pavel Tatashin <pasha.tatashin@oracle.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: peterz@infradead.org
Cc: bob.picco@oracle.com
Cc: steven.sistare@oracle.com
Cc: daniel.m.jordan@oracle.com
Link: https://lkml.kernel.org/r/20171028001100.26603-1-pasha.tatashin@oracle.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kernel/smpboot.c
arch/x86/kernel/tsc.c