summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/hpet.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2019-08-26 11:20:55 +0200
committerIngo Molnar <mingo@kernel.org>2019-08-26 11:20:55 +0200
commitb3e30c9884407599353e690a4eb36d0c4671bf62 (patch)
treed752d32d8a1a395cacd220313f24b933b2ed7294 /arch/x86/kernel/hpet.c
parentx86/msr-index: Move AMD MSRs where they belong (diff)
parentLinux 5.3-rc6 (diff)
downloadlinux-b3e30c9884407599353e690a4eb36d0c4671bf62.tar.xz
linux-b3e30c9884407599353e690a4eb36d0c4671bf62.zip
Merge tag 'v5.3-rc6' into x86/cpu, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kernel/hpet.c')
-rw-r--r--arch/x86/kernel/hpet.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index c43e96a938d0..c6f791bc481e 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -827,10 +827,6 @@ int __init hpet_enable(void)
if (!hpet_cfg_working())
goto out_nohpet;
- /* Validate that the counter is counting */
- if (!hpet_counting())
- goto out_nohpet;
-
/*
* Read the period and check for a sane value:
*/
@@ -896,6 +892,14 @@ int __init hpet_enable(void)
}
hpet_print_config();
+ /*
+ * Validate that the counter is counting. This needs to be done
+ * after sanitizing the config registers to properly deal with
+ * force enabled HPETs.
+ */
+ if (!hpet_counting())
+ goto out_nohpet;
+
clocksource_register_hz(&clocksource_hpet, (u32)hpet_freq);
if (id & HPET_ID_LEGSUP) {