[PATCH] x86_64: Remove enable/disable_hlt
authorAndi Kleen <ak@suse.de>
Wed, 11 Jan 2006 21:42:42 +0000 (22:42 +0100)
committerLinus Torvalds <torvalds@g5.osdl.org>
Thu, 12 Jan 2006 03:01:12 +0000 (19:01 -0800)
Was only used by the floppy driver to work around some ancient
hardware bug that should never occur on any 64bit system.

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/x86_64/kernel/process.c
include/asm-x86_64/system.h

index 3060ed97b755f836f076c54bee60740ebc41e1be..c9df991150bb158efff00e2040fca20025a20095 100644 (file)
@@ -55,8 +55,6 @@ asmlinkage extern void ret_from_fork(void);
 
 unsigned long kernel_thread_flags = CLONE_VM | CLONE_UNTRACED;
 
-static atomic_t hlt_counter = ATOMIC_INIT(0);
-
 unsigned long boot_option_idle_override = 0;
 EXPORT_SYMBOL(boot_option_idle_override);
 
@@ -66,20 +64,6 @@ EXPORT_SYMBOL(boot_option_idle_override);
 void (*pm_idle)(void);
 static DEFINE_PER_CPU(unsigned int, cpu_idle_state);
 
-void disable_hlt(void)
-{
-       atomic_inc(&hlt_counter);
-}
-
-EXPORT_SYMBOL(disable_hlt);
-
-void enable_hlt(void)
-{
-       atomic_dec(&hlt_counter);
-}
-
-EXPORT_SYMBOL(enable_hlt);
-
 /*
  * We use this if we don't have any better
  * idle routine..
@@ -88,21 +72,16 @@ void default_idle(void)
 {
        local_irq_enable();
 
-       if (!atomic_read(&hlt_counter)) {
-               clear_thread_flag(TIF_POLLING_NRFLAG);
-               smp_mb__after_clear_bit();
-               while (!need_resched()) {
-                       local_irq_disable();
-                       if (!need_resched())
-                               safe_halt();
-                       else
-                               local_irq_enable();
-               }
-               set_thread_flag(TIF_POLLING_NRFLAG);
-       } else {
-               while (!need_resched())
-                       cpu_relax();
+       clear_thread_flag(TIF_POLLING_NRFLAG);
+       smp_mb__after_clear_bit();
+       while (!need_resched()) {
+               local_irq_disable();
+               if (!need_resched())
+                       safe_halt();
+               else
+                       local_irq_enable();
        }
+       set_thread_flag(TIF_POLLING_NRFLAG);
 }
 
 /*
index b34cc2ee222be04842ad512945b5e92022996ed5..1200ea2ea12f683766583e2f013bce8ba579aa98 100644 (file)
@@ -330,13 +330,6 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
 
 void cpu_idle_wait(void);
 
-/*
- * disable hlt during certain critical i/o operations
- */
-#define HAVE_DISABLE_HLT
-void disable_hlt(void);
-void enable_hlt(void);
-
 extern unsigned long arch_align_stack(unsigned long sp);
 
 #endif