aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/processor_idle.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/processor_idle.c')
-rw-r--r--drivers/acpi/processor_idle.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 6f3b217699e9..788da9781f80 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -216,8 +216,10 @@ static void acpi_safe_halt(void)
216 * test NEED_RESCHED: 216 * test NEED_RESCHED:
217 */ 217 */
218 smp_mb(); 218 smp_mb();
219 if (!need_resched()) 219 if (!need_resched()) {
220 safe_halt(); 220 safe_halt();
221 local_irq_disable();
222 }
221 current_thread_info()->status |= TS_POLLING; 223 current_thread_info()->status |= TS_POLLING;
222} 224}
223 225
@@ -421,7 +423,9 @@ static void acpi_processor_idle(void)
421 else 423 else
422 acpi_safe_halt(); 424 acpi_safe_halt();
423 425
424 local_irq_enable(); 426 if (irqs_disabled())
427 local_irq_enable();
428
425 return; 429 return;
426 } 430 }
427 431
@@ -530,7 +534,9 @@ static void acpi_processor_idle(void)
530 * skew otherwise. 534 * skew otherwise.
531 */ 535 */
532 sleep_ticks = 0xFFFFFFFF; 536 sleep_ticks = 0xFFFFFFFF;
533 local_irq_enable(); 537 if (irqs_disabled())
538 local_irq_enable();
539
534 break; 540 break;
535 541
536 case ACPI_STATE_C2: 542 case ACPI_STATE_C2:
@@ -1481,7 +1487,6 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
1481 return 0; 1487 return 0;
1482 } 1488 }
1483 1489
1484 acpi_unlazy_tlb(smp_processor_id());
1485 /* 1490 /*
1486 * Must be done before busmaster disable as we might need to 1491 * Must be done before busmaster disable as we might need to
1487 * access HPET ! 1492 * access HPET !
@@ -1571,6 +1576,8 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
1571 return 0; 1576 return 0;
1572 } 1577 }
1573 1578
1579 acpi_unlazy_tlb(smp_processor_id());
1580
1574 /* Tell the scheduler that we are going deep-idle: */ 1581 /* Tell the scheduler that we are going deep-idle: */
1575 sched_clock_idle_sleep_event(); 1582 sched_clock_idle_sleep_event();
1576 /* 1583 /*
@@ -1686,7 +1693,9 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr)
1686 switch (cx->type) { 1693 switch (cx->type) {
1687 case ACPI_STATE_C1: 1694 case ACPI_STATE_C1:
1688 state->flags |= CPUIDLE_FLAG_SHALLOW; 1695 state->flags |= CPUIDLE_FLAG_SHALLOW;
1689 state->flags |= CPUIDLE_FLAG_TIME_VALID; 1696 if (cx->entry_method == ACPI_CSTATE_FFH)
1697 state->flags |= CPUIDLE_FLAG_TIME_VALID;
1698
1690 state->enter = acpi_idle_enter_c1; 1699 state->enter = acpi_idle_enter_c1;
1691 dev->safe_state = state; 1700 dev->safe_state = state;
1692 break; 1701 break;