diff options
-rw-r--r-- | drivers/acpi/processor_idle.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 4ba3a9a473dd..fea71597b40a 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -1407,8 +1407,10 @@ static inline void acpi_idle_do_entry(struct acpi_processor_cx *cx) | |||
1407 | static int acpi_idle_enter_c1(struct cpuidle_device *dev, | 1407 | static int acpi_idle_enter_c1(struct cpuidle_device *dev, |
1408 | struct cpuidle_state *state) | 1408 | struct cpuidle_state *state) |
1409 | { | 1409 | { |
1410 | u32 t1, t2; | ||
1410 | struct acpi_processor *pr; | 1411 | struct acpi_processor *pr; |
1411 | struct acpi_processor_cx *cx = cpuidle_get_statedata(state); | 1412 | struct acpi_processor_cx *cx = cpuidle_get_statedata(state); |
1413 | |||
1412 | pr = processors[smp_processor_id()]; | 1414 | pr = processors[smp_processor_id()]; |
1413 | 1415 | ||
1414 | if (unlikely(!pr)) | 1416 | if (unlikely(!pr)) |
@@ -1418,12 +1420,14 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev, | |||
1418 | if (pr->flags.bm_check) | 1420 | if (pr->flags.bm_check) |
1419 | acpi_idle_update_bm_rld(pr, cx); | 1421 | acpi_idle_update_bm_rld(pr, cx); |
1420 | 1422 | ||
1423 | t1 = inl(acpi_gbl_FADT.xpm_timer_block.address); | ||
1421 | acpi_idle_do_entry(cx); | 1424 | acpi_idle_do_entry(cx); |
1425 | t2 = inl(acpi_gbl_FADT.xpm_timer_block.address); | ||
1422 | 1426 | ||
1423 | local_irq_enable(); | 1427 | local_irq_enable(); |
1424 | cx->usage++; | 1428 | cx->usage++; |
1425 | 1429 | ||
1426 | return 0; | 1430 | return ticks_elapsed_in_us(t1, t2); |
1427 | } | 1431 | } |
1428 | 1432 | ||
1429 | /** | 1433 | /** |
@@ -1660,6 +1664,7 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr) | |||
1660 | switch (cx->type) { | 1664 | switch (cx->type) { |
1661 | case ACPI_STATE_C1: | 1665 | case ACPI_STATE_C1: |
1662 | state->flags |= CPUIDLE_FLAG_SHALLOW; | 1666 | state->flags |= CPUIDLE_FLAG_SHALLOW; |
1667 | state->flags |= CPUIDLE_FLAG_TIME_VALID; | ||
1663 | state->enter = acpi_idle_enter_c1; | 1668 | state->enter = acpi_idle_enter_c1; |
1664 | dev->safe_state = state; | 1669 | dev->safe_state = state; |
1665 | break; | 1670 | break; |