From: Kai-Heng Feng <kai.heng.feng@canonical.com>
To: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de
Cc: hpa@zytor.com, harry.pan@intel.com, x86@kernel.org,
linux-kernel@vger.kernel.org,
Kai-Heng Feng <kai.heng.feng@canonical.com>
Subject: [PATCH] x86/hpet: Disable HPET on Intel Coffe Lake
Date: Thu, 29 Aug 2019 17:12:32 +0800 [thread overview]
Message-ID: <20190829091232.15065-1-kai.heng.feng@canonical.com> (raw)
Some Coffee Lake platforms have skewed HPET timer once the SoCs entered
PC10, and marked TSC as unstable clocksource as result.
Harry Pan identified it's a firmware bug [1].
To prevent creating a circular dependency between HPET and TSC, let's
disable HPET on affected platforms.
[1]: https://lore.kernel.org/lkml/20190516090651.1396-1-harry.pan@intel.com/
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=203183
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
---
arch/x86/kernel/hpet.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index c6f791bc481e..07e9ec6f85b6 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -7,7 +7,9 @@
#include <linux/cpu.h>
#include <linux/irq.h>
+#include <asm/cpu_device_id.h>
#include <asm/hpet.h>
+#include <asm/intel-family.h>
#include <asm/time.h>
#undef pr_fmt
@@ -806,6 +808,12 @@ static bool __init hpet_counting(void)
return false;
}
+static const struct x86_cpu_id hpet_blacklist[] __initconst = {
+ { X86_VENDOR_INTEL, 6, INTEL_FAM6_KABYLAKE_MOBILE },
+ { X86_VENDOR_INTEL, 6, INTEL_FAM6_KABYLAKE_DESKTOP },
+ { }
+};
+
/**
* hpet_enable - Try to setup the HPET timer. Returns 1 on success.
*/
@@ -819,6 +827,9 @@ int __init hpet_enable(void)
if (!is_hpet_capable())
return 0;
+ if (!hpet_force_user && x86_match_cpu(hpet_blacklist))
+ return 0;
+
hpet_set_mapping();
if (!hpet_virt_address)
return 0;
--
2.17.1
next reply other threads:[~2019-08-29 9:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-29 9:12 Kai-Heng Feng [this message]
2019-08-29 12:13 ` [PATCH] x86/hpet: Disable HPET on Intel Coffe Lake Thomas Gleixner
2019-08-29 14:13 ` Kai-Heng Feng
2019-08-29 19:45 ` Thomas Gleixner
2019-08-29 21:38 ` [RFD] x86/tsc: Loosen the requirements for watchdog - (was x86/hpet: Disable HPET on Intel Coffe Lake) Thomas Gleixner
2019-08-30 3:47 ` Daniel Drake
2019-10-01 15:47 ` [PATCH] x86/hpet: Disable HPET on Intel Coffe Lake Kai-Heng Feng
2019-10-09 5:58 ` Feng Tang
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=20190829091232.15065-1-kai.heng.feng@canonical.com \
--to=kai.heng.feng@canonical.com \
--cc=bp@alien8.de \
--cc=harry.pan@intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).