diff options
author | 2005-12-05 11:50:17 -0800 | |
---|---|---|
committer | 2005-12-05 11:50:17 -0800 | |
commit | 3e356b2660eda9da7776144cbc0a038c93dcb335 (patch) | |
tree | 378a38636f6b67a5f092a73850223d11cdfb5ff5 /drivers/acpi/processor_idle.c | |
parent | [IA64] Allow salinfo_decode to detect signals on read (diff) | |
parent | [PATCH] V4L/DVB (3087) fix analog NTSC for pcHDTV 3000 (diff) | |
download | wireguard-linux-3e356b2660eda9da7776144cbc0a038c93dcb335.tar.xz wireguard-linux-3e356b2660eda9da7776144cbc0a038c93dcb335.zip |
Auto-update from upstream
Diffstat (limited to 'drivers/acpi/processor_idle.c')
-rw-r--r-- | drivers/acpi/processor_idle.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 83fd1b6c10c4..5f51057518b0 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -169,15 +169,11 @@ acpi_processor_power_activate(struct acpi_processor *pr, static void acpi_safe_halt(void) { - int polling = test_thread_flag(TIF_POLLING_NRFLAG); - if (polling) { - clear_thread_flag(TIF_POLLING_NRFLAG); - smp_mb__after_clear_bit(); - } + clear_thread_flag(TIF_POLLING_NRFLAG); + smp_mb__after_clear_bit(); if (!need_resched()) safe_halt(); - if (polling) - set_thread_flag(TIF_POLLING_NRFLAG); + set_thread_flag(TIF_POLLING_NRFLAG); } static atomic_t c3_cpu_count; @@ -295,6 +291,16 @@ static void acpi_processor_idle(void) * ------ * Invoke the current Cx state to put the processor to sleep. */ + if (cx->type == ACPI_STATE_C2 || cx->type == ACPI_STATE_C3) { + clear_thread_flag(TIF_POLLING_NRFLAG); + smp_mb__after_clear_bit(); + if (need_resched()) { + set_thread_flag(TIF_POLLING_NRFLAG); + local_irq_enable(); + return; + } + } + switch (cx->type) { case ACPI_STATE_C1: @@ -327,6 +333,7 @@ static void acpi_processor_idle(void) t2 = inl(acpi_fadt.xpm_tmr_blk.address); /* Re-enable interrupts */ local_irq_enable(); + set_thread_flag(TIF_POLLING_NRFLAG); /* Compute time (ticks) that we were actually asleep */ sleep_ticks = ticks_elapsed(t1, t2) - cx->latency_ticks - C2_OVERHEAD; @@ -366,6 +373,7 @@ static void acpi_processor_idle(void) /* Re-enable interrupts */ local_irq_enable(); + set_thread_flag(TIF_POLLING_NRFLAG); /* Compute time (ticks) that we were actually asleep */ sleep_ticks = ticks_elapsed(t1, t2) - cx->latency_ticks - C3_OVERHEAD; |