lkml.org 
[lkml]   [2014]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 1/2] x86, tsc: Fallback to normal calibration if fast MSR calibration fails
On Thu, Feb 06, 2014 at 03:34:18PM +0100, Thomas Gleixner wrote:
> On Thu, 6 Feb 2014, Mika Westerberg wrote:
> > arch/x86/kernel/tsc.c | 7 ++++---
> > 1 file changed, 4 insertions(+), 3 deletions(-)
> >
> > diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
> > index 19e5adb49a27..56facfc54575 100644
> > --- a/arch/x86/kernel/tsc.c
> > +++ b/arch/x86/kernel/tsc.c
> > @@ -655,10 +655,11 @@ unsigned long native_calibrate_tsc(void)
> > local_irq_save(flags);
> > i = try_msr_calibrate_tsc(&fast_calibrate);
> > local_irq_restore(flags);
> > - if (i >= 0) {
> > - if (i == 0)
> > - pr_warn("Fast TSC calibration using MSR failed\n");
> > + if (i > 0) {
> > return fast_calibrate;
> > + } else if (i == 0) {
> > + pr_warn("Fast TSC calibration using MSR failed\n");
> > + /* Continue with the normal calibration */
> > }
>
> Bah. Can we please fix that proper. The whole 0,1,-1 return value from
> try_msr_calibrate_tsc() is just horrible. Why not doing the obvious?

Yes, that looks better and works fine, thanks.

Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com>


\
 
 \ /
  Last update: 2014-02-06 17:01    [W:0.178 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site