x86/tsc: Be consistent about use_tsc_delay()
authorPeter Zijlstra <peterz@infradead.org>
Fri, 4 Mar 2022 15:19:54 +0000 (16:19 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 15 Mar 2022 17:20:33 +0000 (18:20 +0100)
commit69f8aeab437c6bae1394673154917e0a218edb44
treede50aa19558b15432bc8b288209f19be1aaf1853
parent977b94814006dd78a7853de696be8c5ef3f0e71b
x86/tsc: Be consistent about use_tsc_delay()

Currently loops_per_jiffy is set in tsc_early_init(), but then don't
switch to delay_tsc, with the result that delay_loop is used with
loops_per_jiffy set for delay_tsc.

Then in (late) tsc_init() lpj_fine is set (which is mostly unused) and
after which use_tsc_delay() is finally called.

Move both loops_per_jiffy and use_tsc_delay() into
tsc_enable_sched_clock() which is called the moment tsc_khz is
determined, be it early or late. Keeping the lot consistent.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20220304152135.914397165@infradead.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kernel/tsc.c