]> git.baikalelectronics.ru Git - kernel.git/commit
x86/hpet: Undo the early counter is counting check
authorThomas Gleixner <tglx@linutronix.de>
Thu, 25 Jul 2019 06:28:45 +0000 (08:28 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 25 Jul 2019 10:21:32 +0000 (12:21 +0200)
commite3605d0259f165a7df2354ff343f1c84f830170c
treea784d2d4c74708ac6abb584daaaeff6e47a4c4d9
parent9ca52c872a58b3b6cc00d5883bc818d53c09e686
x86/hpet: Undo the early counter is counting check

Rui reported that on a Pentium D machine which has HPET forced enabled
because it is not advertised by ACPI, the early counter is counting check
leads to a silent boot hang.

The reason is that the ordering of checking the counter first and then
reconfiguring the HPET fails to work on that machine. As the HPET is not
advertised and presumably not initialized by the BIOS the early enable and
the following reconfiguration seems to bring it into a broken state. Adding
clocksource=jiffies to the command line results in the following
clocksource watchdog warning:

  clocksource: timekeeping watchdog on CPU1:
  Marking clocksource 'tsc-early' as unstable because the skew is too large:
  clocksource:  'hpet' wd_now: 33 wd_last: 33 mask: ffffffff

That clearly shows that the HPET is not counting after it got reconfigured
and reenabled. If the counter is not working then the HPET timer is not
expiring either, which explains the boot hang.

Move the counter is counting check after the full configuration again to
unbreak these systems.

Reported-by: Rui Salvaterra <rsalvaterra@gmail.com>
Fixes: f179af933681 ("x86/hpet: Separate counter check out of clocksource register code")
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Rui Salvaterra <rsalvaterra@gmail.com>
Link: https://lkml.kernel.org/r/alpine.DEB.2.21.1907250810530.1791@nanos.tec.linutronix.de
arch/x86/kernel/hpet.c