diff options
Diffstat (limited to 'drivers/acpi/processor_idle.c')
-rw-r--r-- | drivers/acpi/processor_idle.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 32003fdc91e8..6f3b217699e9 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -364,7 +364,7 @@ int acpi_processor_resume(struct acpi_device * device) | |||
364 | return 0; | 364 | return 0; |
365 | } | 365 | } |
366 | 366 | ||
367 | #if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86_TSC) | 367 | #if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86) |
368 | static int tsc_halts_in_c(int state) | 368 | static int tsc_halts_in_c(int state) |
369 | { | 369 | { |
370 | switch (boot_cpu_data.x86_vendor) { | 370 | switch (boot_cpu_data.x86_vendor) { |
@@ -544,7 +544,7 @@ static void acpi_processor_idle(void) | |||
544 | /* Get end time (ticks) */ | 544 | /* Get end time (ticks) */ |
545 | t2 = inl(acpi_gbl_FADT.xpm_timer_block.address); | 545 | t2 = inl(acpi_gbl_FADT.xpm_timer_block.address); |
546 | 546 | ||
547 | #if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86_TSC) | 547 | #if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86) |
548 | /* TSC halts in C2, so notify users */ | 548 | /* TSC halts in C2, so notify users */ |
549 | if (tsc_halts_in_c(ACPI_STATE_C2)) | 549 | if (tsc_halts_in_c(ACPI_STATE_C2)) |
550 | mark_tsc_unstable("possible TSC halt in C2"); | 550 | mark_tsc_unstable("possible TSC halt in C2"); |
@@ -609,7 +609,7 @@ static void acpi_processor_idle(void) | |||
609 | acpi_set_register(ACPI_BITREG_ARB_DISABLE, 0); | 609 | acpi_set_register(ACPI_BITREG_ARB_DISABLE, 0); |
610 | } | 610 | } |
611 | 611 | ||
612 | #if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86_TSC) | 612 | #if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86) |
613 | /* TSC halts in C3, so notify users */ | 613 | /* TSC halts in C3, so notify users */ |
614 | if (tsc_halts_in_c(ACPI_STATE_C3)) | 614 | if (tsc_halts_in_c(ACPI_STATE_C3)) |
615 | mark_tsc_unstable("TSC halts in C3"); | 615 | mark_tsc_unstable("TSC halts in C3"); |
@@ -945,11 +945,16 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr) | |||
945 | * Otherwise, ignore this info and continue. | 945 | * Otherwise, ignore this info and continue. |
946 | */ | 946 | */ |
947 | cx.entry_method = ACPI_CSTATE_HALT; | 947 | cx.entry_method = ACPI_CSTATE_HALT; |
948 | snprintf(cx.desc, ACPI_CX_DESC_LEN, "ACPI HLT"); | ||
948 | } else { | 949 | } else { |
949 | continue; | 950 | continue; |
950 | } | 951 | } |
952 | } else { | ||
953 | snprintf(cx.desc, ACPI_CX_DESC_LEN, "ACPI IOPORT 0x%x", | ||
954 | cx.address); | ||
951 | } | 955 | } |
952 | 956 | ||
957 | |||
953 | obj = &(element->package.elements[2]); | 958 | obj = &(element->package.elements[2]); |
954 | if (obj->type != ACPI_TYPE_INTEGER) | 959 | if (obj->type != ACPI_TYPE_INTEGER) |
955 | continue; | 960 | continue; |
@@ -1420,6 +1425,14 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev, | |||
1420 | return 0; | 1425 | return 0; |
1421 | 1426 | ||
1422 | local_irq_disable(); | 1427 | local_irq_disable(); |
1428 | |||
1429 | /* Do not access any ACPI IO ports in suspend path */ | ||
1430 | if (acpi_idle_suspend) { | ||
1431 | acpi_safe_halt(); | ||
1432 | local_irq_enable(); | ||
1433 | return 0; | ||
1434 | } | ||
1435 | |||
1423 | if (pr->flags.bm_check) | 1436 | if (pr->flags.bm_check) |
1424 | acpi_idle_update_bm_rld(pr, cx); | 1437 | acpi_idle_update_bm_rld(pr, cx); |
1425 | 1438 | ||
@@ -1487,7 +1500,7 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev, | |||
1487 | acpi_idle_do_entry(cx); | 1500 | acpi_idle_do_entry(cx); |
1488 | t2 = inl(acpi_gbl_FADT.xpm_timer_block.address); | 1501 | t2 = inl(acpi_gbl_FADT.xpm_timer_block.address); |
1489 | 1502 | ||
1490 | #if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86_TSC) | 1503 | #if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86) |
1491 | /* TSC could halt in idle, so notify users */ | 1504 | /* TSC could halt in idle, so notify users */ |
1492 | if (tsc_halts_in_c(cx->type)) | 1505 | if (tsc_halts_in_c(cx->type)) |
1493 | mark_tsc_unstable("TSC halts in idle");; | 1506 | mark_tsc_unstable("TSC halts in idle");; |
@@ -1601,7 +1614,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, | |||
1601 | spin_unlock(&c3_lock); | 1614 | spin_unlock(&c3_lock); |
1602 | } | 1615 | } |
1603 | 1616 | ||
1604 | #if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86_TSC) | 1617 | #if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86) |
1605 | /* TSC could halt in idle, so notify users */ | 1618 | /* TSC could halt in idle, so notify users */ |
1606 | if (tsc_halts_in_c(ACPI_STATE_C3)) | 1619 | if (tsc_halts_in_c(ACPI_STATE_C3)) |
1607 | mark_tsc_unstable("TSC halts in idle"); | 1620 | mark_tsc_unstable("TSC halts in idle"); |
@@ -1643,6 +1656,11 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr) | |||
1643 | return -EINVAL; | 1656 | return -EINVAL; |
1644 | } | 1657 | } |
1645 | 1658 | ||
1659 | for (i = 0; i < CPUIDLE_STATE_MAX; i++) { | ||
1660 | dev->states[i].name[0] = '\0'; | ||
1661 | dev->states[i].desc[0] = '\0'; | ||
1662 | } | ||
1663 | |||
1646 | for (i = 1; i < ACPI_PROCESSOR_MAX_POWER && i <= max_cstate; i++) { | 1664 | for (i = 1; i < ACPI_PROCESSOR_MAX_POWER && i <= max_cstate; i++) { |
1647 | cx = &pr->power.states[i]; | 1665 | cx = &pr->power.states[i]; |
1648 | state = &dev->states[count]; | 1666 | state = &dev->states[count]; |
@@ -1659,6 +1677,7 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr) | |||
1659 | cpuidle_set_statedata(state, cx); | 1677 | cpuidle_set_statedata(state, cx); |
1660 | 1678 | ||
1661 | snprintf(state->name, CPUIDLE_NAME_LEN, "C%d", i); | 1679 | snprintf(state->name, CPUIDLE_NAME_LEN, "C%d", i); |
1680 | strncpy(state->desc, cx->desc, CPUIDLE_DESC_LEN); | ||
1662 | state->exit_latency = cx->latency; | 1681 | state->exit_latency = cx->latency; |
1663 | state->target_residency = cx->latency * latency_factor; | 1682 | state->target_residency = cx->latency * latency_factor; |
1664 | state->power_usage = cx->power; | 1683 | state->power_usage = cx->power; |