[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.21.1807191817080.1693@nanos.tec.linutronix.de>
Date: Thu, 19 Jul 2018 18:19:33 +0200 (CEST)
From: Thomas Gleixner <tglx@...utronix.de>
To: Pavel Tatashin <pasha.tatashin@...cle.com>
cc: Peter Zijlstra <peterz@...radead.org>, steven.sistare@...cle.com,
daniel.m.jordan@...cle.com, linux@...linux.org.uk,
schwidefsky@...ibm.com, heiko.carstens@...ibm.com,
john.stultz@...aro.org, sboyd@...eaurora.org, x86@...nel.org,
linux-kernel@...r.kernel.org, mingo@...hat.com, hpa@...or.com,
douly.fnst@...fujitsu.com, prarit@...hat.com, feng.tang@...el.com,
pmladek@...e.com, gnomes@...rguk.ukuu.org.uk,
linux-s390@...r.kernel.org, boris.ostrovsky@...cle.com,
jgross@...e.com, pbonzini@...hat.com
Subject: Re: [PATCH v14 20/25] x86/tsc: calibrate tsc only once
On Thu, 19 Jul 2018, Pavel Tatashin wrote:
> On 07/19/2018 07:01 AM, Thomas Gleixner wrote:
>
> And hpet_pmtime_calibrate_cpu() contains all the hpet/pmtime stuff.
>
> However, when cpu_khz = x86_platform.calibrate_cpu() is called the first
> time, we still call hpet_pmtime_calibrate_cpu() from
> native_calibrate_cpu(). We cannot simply split native_calibrate_cpu()
> into two independent functions because it is also called from
> recalibrate_cpu_khz().
> So, the question is how to enforce that the first time we do not call hpet/pmtime?
>
> 1. Use a new global variable? Kind of ugly.
> 2. Use system_state == SYSTEM_BOOTING ? Ugly, and probably not very safe.
Both are horrible.
So create two functions. native_...early..() and native....(). The early
one does not contain the hpet/pmtimer stuff and it replaces the ops.pointer
with the late one which contains all of it.
Hmm?
Thanks,
tglx
Powered by blists - more mailing lists