diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c index 53303f2e547582e282f5a941cc2311b79a821238..4a86ffd67ec5e23ecec8c9ed42d9f00ecc051631 100644 --- a/arch/x86/kernel/hpet.c +++ b/arch/x86/kernel/hpet.c @@ -446,6 +446,20 @@ static __init int hpet_late_init(void) } fs_initcall(hpet_late_init); +void hpet_disable(void) +{ + if (is_hpet_capable()) { + unsigned long cfg = hpet_readl(HPET_CFG); + + if (hpet_legacy_int_enabled) { + cfg &= ~HPET_CFG_LEGACY; + hpet_legacy_int_enabled = 0; + } + cfg &= ~HPET_CFG_ENABLE; + hpet_writel(cfg, HPET_CFG); + } +} + #ifdef CONFIG_HPET_EMULATE_RTC /* HPET in LegacyReplacement Mode eats up RTC interrupt line. When, HPET diff --git a/arch/x86/kernel/reboot_32.c b/arch/x86/kernel/reboot_32.c index 9e2269d00918c13948b03b92532498015e95460b..bb1a0f889c5ebaed7a42864a9a98ea86e9848e52 100644 --- a/arch/x86/kernel/reboot_32.c +++ b/arch/x86/kernel/reboot_32.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include "mach_reboot.h" #include @@ -326,6 +327,9 @@ static void native_machine_shutdown(void) #ifdef CONFIG_X86_IO_APIC disable_IO_APIC(); #endif +#ifdef CONFIG_HPET_TIMER + hpet_disable(); +#endif } void __attribute__((weak)) mach_reboot_fixups(void) diff --git a/arch/x86/kernel/reboot_64.c b/arch/x86/kernel/reboot_64.c index 71b13c5f5817dd0d1ffbe2285fe003c11e6ea088..53620a92a8fdd74cc2885d28d65eaa7eb34d89d1 100644 --- a/arch/x86/kernel/reboot_64.c +++ b/arch/x86/kernel/reboot_64.c @@ -17,6 +17,7 @@ #include #include #include +#include #include /* @@ -113,6 +114,9 @@ void machine_shutdown(void) disable_IO_APIC(); +#ifdef CONFIG_HPET_TIMER + hpet_disable(); +#endif local_irq_restore(flags); pci_iommu_shutdown(); diff --git a/include/asm-x86/hpet.h b/include/asm-x86/hpet.h index b1f3c1ea55d959687f278b0107b63a96e9c69e8e..ad8d6e758785ca283b33b802880945f4e8c1f4ee 100644 --- a/include/asm-x86/hpet.h +++ b/include/asm-x86/hpet.h @@ -61,6 +61,7 @@ extern unsigned long force_hpet_address; extern int hpet_force_user; extern int is_hpet_enabled(void); extern int hpet_enable(void); +extern void hpet_disable(void); extern unsigned long hpet_readl(unsigned long a); extern void force_hpet_resume(void);