Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
fork

Configure Feed

Select the types of activity you want to include in your feed.

x86: disable hpet on shutdown

If HPET was enabled by pci quirks, we use i8253 as initial clockevent
because pci quirks doesn't run until pci is initialized.

The above means the kernel (or something) is assuming HPET legacy
replacement is disabled and can use i8253 at boot.

If we used kexec, it isn't true. So, this patch disables HPET legacy
replacement for kexec in machine_shutdown().

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Acked-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

authored by

OGAWA Hirofumi and committed by
Ingo Molnar
c86c7fbc 92d499d9

+23
+14
arch/x86/kernel/hpet.c
··· 446 446 } 447 447 fs_initcall(hpet_late_init); 448 448 449 + void hpet_disable(void) 450 + { 451 + if (is_hpet_capable()) { 452 + unsigned long cfg = hpet_readl(HPET_CFG); 453 + 454 + if (hpet_legacy_int_enabled) { 455 + cfg &= ~HPET_CFG_LEGACY; 456 + hpet_legacy_int_enabled = 0; 457 + } 458 + cfg &= ~HPET_CFG_ENABLE; 459 + hpet_writel(cfg, HPET_CFG); 460 + } 461 + } 462 + 449 463 #ifdef CONFIG_HPET_EMULATE_RTC 450 464 451 465 /* HPET in LegacyReplacement Mode eats up RTC interrupt line. When, HPET
+4
arch/x86/kernel/reboot_32.c
··· 11 11 #include <linux/reboot.h> 12 12 #include <asm/uaccess.h> 13 13 #include <asm/apic.h> 14 + #include <asm/hpet.h> 14 15 #include <asm/desc.h> 15 16 #include "mach_reboot.h" 16 17 #include <asm/reboot_fixups.h> ··· 326 325 327 326 #ifdef CONFIG_X86_IO_APIC 328 327 disable_IO_APIC(); 328 + #endif 329 + #ifdef CONFIG_HPET_TIMER 330 + hpet_disable(); 329 331 #endif 330 332 } 331 333
+4
arch/x86/kernel/reboot_64.c
··· 17 17 #include <asm/pgtable.h> 18 18 #include <asm/tlbflush.h> 19 19 #include <asm/apic.h> 20 + #include <asm/hpet.h> 20 21 #include <asm/gart.h> 21 22 22 23 /* ··· 114 113 115 114 disable_IO_APIC(); 116 115 116 + #ifdef CONFIG_HPET_TIMER 117 + hpet_disable(); 118 + #endif 117 119 local_irq_restore(flags); 118 120 119 121 pci_iommu_shutdown();
+1
include/asm-x86/hpet.h
··· 61 61 extern int hpet_force_user; 62 62 extern int is_hpet_enabled(void); 63 63 extern int hpet_enable(void); 64 + extern void hpet_disable(void); 64 65 extern unsigned long hpet_readl(unsigned long a); 65 66 extern void force_hpet_resume(void); 66 67