Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86:
  x86: fix x86-32 early fixmap initialization.
  x86: disable hpet legacy replacement for kdump
  x86: disable hpet on shutdown
  • Loading branch information
Linus Torvalds committed Dec 3, 2007
2 parents f589b86 + 17d57a9 commit 1a2edea
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 6 deletions.
4 changes: 4 additions & 0 deletions arch/x86/kernel/crash.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <asm/nmi.h>
#include <asm/hw_irq.h>
#include <asm/apic.h>
#include <asm/hpet.h>
#include <linux/kdebug.h>
#include <asm/smp.h>

Expand Down Expand Up @@ -139,6 +140,9 @@ void machine_crash_shutdown(struct pt_regs *regs)
lapic_shutdown();
#if defined(CONFIG_X86_IO_APIC)
disable_IO_APIC();
#endif
#ifdef CONFIG_HPET_TIMER
hpet_disable();
#endif
crash_save_cpu(regs, safe_smp_processor_id());
}
12 changes: 6 additions & 6 deletions arch/x86/kernel/head_32.S
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,12 @@ default_entry:
jb 10b
movl %edi,(init_pg_tables_end - __PAGE_OFFSET)

/* Do an early initialization of the fixmap area */
movl $(swapper_pg_dir - __PAGE_OFFSET), %edx
movl $(swapper_pg_pmd - __PAGE_OFFSET), %eax
addl $0x007, %eax /* 0x007 = PRESENT+RW+USER */
movl %eax, 4092(%edx)

xorl %ebx,%ebx /* This is the boot CPU (BSP) */
jmp 3f
/*
Expand All @@ -208,12 +214,6 @@ default_entry:
.section .init.text,"ax",@progbits
#endif

/* Do an early initialization of the fixmap area */
movl $(swapper_pg_dir - __PAGE_OFFSET), %edx
movl $(swapper_pg_pmd - __PAGE_OFFSET), %eax
addl $0x007, %eax /* 0x007 = PRESENT+RW+USER */
movl %eax, 4092(%edx)

#ifdef CONFIG_SMP
ENTRY(startup_32_smp)
cld
Expand Down
14 changes: 14 additions & 0 deletions arch/x86/kernel/hpet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions arch/x86/kernel/reboot_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <linux/reboot.h>
#include <asm/uaccess.h>
#include <asm/apic.h>
#include <asm/hpet.h>
#include <asm/desc.h>
#include "mach_reboot.h"
#include <asm/reboot_fixups.h>
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions arch/x86/kernel/reboot_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <asm/pgtable.h>
#include <asm/tlbflush.h>
#include <asm/apic.h>
#include <asm/hpet.h>
#include <asm/gart.h>

/*
Expand Down Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions include/asm-x86/hpet.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 1a2edea

Please sign in to comment.