All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhang Rui <rui.zhang@intel.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	LKML <linux-kernel@vger.kernel.org>, linux-x86 <x86@kernel.org>,
	Len Brown <len.brown@intel.com>,
	"Chen, Yu C" <yu.c.chen@intel.com>
Subject: Re: Regression: unable to boot after commit bd9240a18edf ("x86/apic: Add TSC_DEADLINE quirk due to errata") - Surface Pro 4 SKL
Date: Tue, 19 Dec 2017 18:48:24 +0800	[thread overview]
Message-ID: <1513680504.2569.1.camel@intel.com> (raw)
In-Reply-To: <20171218202822.juwyxsd7millme7o@hirez.programming.kicks-ass.net>

On Mon, 2017-12-18 at 21:28 +0100, Peter Zijlstra wrote:
> Hi, can you see if this makes you Surface boot?
> 
No, it does not boot.

> I tested it on my IVB by making has_legacy_pic() return unconditional
> true.
> 
> [    0.024000] tsc: Unable to calibrate against PIT
> [    0.025000] tsc: using HPET reference calibration
> [    0.026000] tsc: Detected 2792.451 MHz processor
> 
> ---
> 
> 
> diff --git a/arch/x86/include/asm/i8259.h
> b/arch/x86/include/asm/i8259.h
> index c8376b40e882..e2cfc4b52ee4 100644
> --- a/arch/x86/include/asm/i8259.h
> +++ b/arch/x86/include/asm/i8259.h
> @@ -69,6 +69,11 @@ struct legacy_pic {
>  extern struct legacy_pic *legacy_pic;
>  extern struct legacy_pic null_legacy_pic;
>  
> +static inline bool has_legacy_pic(void)
> +{
> +	return legacy_pic == &null_legacy_pic;
> +}
> +
shouldn't this be
	return legacy_pic == &default_legacy_pic;
?

thanks,
rui
>  static inline int nr_legacy_irqs(void)
>  {
>  	return legacy_pic->nr_legacy_irqs;
> diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
> index 8ea117f8142e..2afc623b2280 100644
> --- a/arch/x86/kernel/tsc.c
> +++ b/arch/x86/kernel/tsc.c
> @@ -25,6 +25,7 @@
>  #include <asm/geode.h>
>  #include <asm/apic.h>
>  #include <asm/intel-family.h>
> +#include <asm/i8259.h>
>  
>  unsigned int __read_mostly cpu_khz;	/* TSC clocks / usec, not
> used here */
>  EXPORT_SYMBOL(cpu_khz);
> @@ -363,6 +364,15 @@ static unsigned long pit_calibrate_tsc(u32
> latch, unsigned long ms, int loopmin)
>  	unsigned long tscmin, tscmax;
>  	int pitcnt;
>  
> +	if (!has_legacy_pic()) {
> +		udelay(10 * USEC_PER_MSEC);
> +		udelay(10 * USEC_PER_MSEC);
> +		udelay(10 * USEC_PER_MSEC);
> +		udelay(10 * USEC_PER_MSEC);
> +		udelay(10 * USEC_PER_MSEC);
> +		return ULONG_MAX;
> +	}
> +
>  	/* Set the Gate high, disable speaker */
>  	outb((inb(0x61) & ~0x02) | 0x01, 0x61);
>  
> @@ -487,6 +497,9 @@ static unsigned long quick_pit_calibrate(void)
>  	u64 tsc, delta;
>  	unsigned long d1, d2;
>  
> +	if (!has_legacy_pic())
> +		return 0;
> +
>  	/* Set the Gate high, disable speaker */
>  	outb((inb(0x61) & ~0x02) | 0x01, 0x61);
>  

  reply	other threads:[~2017-12-19 10:48 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-28  2:08 Regression: unable to boot after commit bd9240a18edf ("x86/apic: Add TSC_DEADLINE quirk due to errata") - Surface Pro 4 SKL Zhang Rui
2017-11-28  8:14 ` Peter Zijlstra
2017-11-28  8:22   ` Zhang Rui
2017-11-28  9:34     ` Thomas Gleixner
2017-11-28 10:59       ` Zhang Rui
2017-11-28 12:36         ` Peter Zijlstra
2017-11-29 14:44           ` Zhang Rui
2017-12-18 20:28             ` Peter Zijlstra
2017-12-19 10:48               ` Zhang Rui [this message]
2017-12-19 13:15                 ` Peter Zijlstra
2017-12-19 15:23                   ` Zhang Rui
2017-12-19 15:23                 ` Peter Zijlstra
2017-12-19 15:31                   ` Peter Zijlstra
2017-12-19 15:43                     ` Zhang Rui
2017-12-19 15:42                   ` Zhang Rui
2017-12-19 16:01                     ` Peter Zijlstra
2017-12-19 17:23                       ` Peter Zijlstra
2017-12-20 14:08                         ` Zhang Rui
2017-12-20 14:48                           ` Peter Zijlstra
2017-11-28  9:35     ` Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1513680504.2569.1.camel@intel.com \
    --to=rui.zhang@intel.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=yu.c.chen@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.