Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/agpgart
[pandora-kernel.git] / arch / ia64 / kernel / process.c
index ea914cc..17685ab 100644 (file)
@@ -8,8 +8,6 @@
  * 2005-10-07 Keith Owens <kaos@sgi.com>
  *           Add notify_die() hooks.
  */
-#define __KERNEL_SYSCALLS__    /* see <asm/unistd.h> */
-
 #include <linux/cpu.h>
 #include <linux/pm.h>
 #include <linux/elf.h>
@@ -270,10 +268,16 @@ cpu_idle (void)
 
        /* endless idle loop with no priority at all */
        while (1) {
-               if (can_do_pal_halt)
+               if (can_do_pal_halt) {
                        current_thread_info()->status &= ~TS_POLLING;
-               else
+                       /*
+                        * TS_POLLING-cleared state must be visible before we
+                        * test NEED_RESCHED:
+                        */
+                       smp_mb();
+               } else {
                        current_thread_info()->status |= TS_POLLING;
+               }
 
                if (!need_resched()) {
                        void (*idle)(void);