diff options
Diffstat (limited to 'arch/i386/kernel')
-rw-r--r-- | arch/i386/kernel/apm.c | 6 | ||||
-rw-r--r-- | arch/i386/kernel/process.c | 7 |
2 files changed, 11 insertions, 2 deletions
diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c index a60358fe9a49..44a553597e2f 100644 --- a/arch/i386/kernel/apm.c +++ b/arch/i386/kernel/apm.c @@ -784,7 +784,11 @@ static int apm_do_idle(void) polling = !!(current_thread_info()->status & TS_POLLING); if (polling) { current_thread_info()->status &= ~TS_POLLING; - smp_mb__after_clear_bit(); + /* + * TS_POLLING-cleared state must be visible before we + * test NEED_RESCHED: + */ + smp_mb(); } if (!need_resched()) { idled = 1; diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c index dd53c58f64f1..304b261fdb03 100644 --- a/arch/i386/kernel/process.c +++ b/arch/i386/kernel/process.c @@ -103,7 +103,12 @@ void default_idle(void) if (!hlt_counter && boot_cpu_data.hlt_works_ok) { current_thread_info()->status &= ~TS_POLLING; - smp_mb__after_clear_bit(); + /* + * TS_POLLING-cleared state must be visible before we + * test NEED_RESCHED: + */ + smp_mb(); + while (!need_resched()) { local_irq_disable(); if (!need_resched()) |