aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/acpi/processor_idle.c33
1 files changed, 26 insertions, 7 deletions
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index ff64d333e95f..79d5ca3066c6 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -519,6 +519,29 @@ static int acpi_processor_get_power_info_fadt (struct acpi_processor *pr)
519} 519}
520 520
521 521
522static int acpi_processor_get_power_info_default_c1 (struct acpi_processor *pr)
523{
524 int i;
525
526 ACPI_FUNCTION_TRACE("acpi_processor_get_power_info_default_c1");
527
528 for (i = 0; i < ACPI_PROCESSOR_MAX_POWER; i++)
529 memset(pr->power.states, 0, sizeof(struct acpi_processor_cx));
530
531 /* if info is obtained from pblk/fadt, type equals state */
532 pr->power.states[ACPI_STATE_C1].type = ACPI_STATE_C1;
533 pr->power.states[ACPI_STATE_C2].type = ACPI_STATE_C2;
534 pr->power.states[ACPI_STATE_C3].type = ACPI_STATE_C3;
535
536 /* the C0 state only exists as a filler in our array,
537 * and all processors need to support C1 */
538 pr->power.states[ACPI_STATE_C0].valid = 1;
539 pr->power.states[ACPI_STATE_C1].valid = 1;
540
541 return_VALUE(0);
542}
543
544
522static int acpi_processor_get_power_info_cst (struct acpi_processor *pr) 545static int acpi_processor_get_power_info_cst (struct acpi_processor *pr)
523{ 546{
524 acpi_status status = 0; 547 acpi_status status = 0;
@@ -787,10 +810,7 @@ static int acpi_processor_get_power_info (
787 if ((result) || (acpi_processor_power_verify(pr) < 2)) { 810 if ((result) || (acpi_processor_power_verify(pr) < 2)) {
788 result = acpi_processor_get_power_info_fadt(pr); 811 result = acpi_processor_get_power_info_fadt(pr);
789 if (result) 812 if (result)
790 return_VALUE(result); 813 result = acpi_processor_get_power_info_default_c1(pr);
791
792 if (acpi_processor_power_verify(pr) < 2)
793 return_VALUE(-ENODEV);
794 } 814 }
795 815
796 /* 816 /*
@@ -810,11 +830,10 @@ static int acpi_processor_get_power_info (
810 * CPU as being "idle manageable" 830 * CPU as being "idle manageable"
811 */ 831 */
812 for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) { 832 for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) {
813 if (pr->power.states[i].valid) 833 if (pr->power.states[i].valid) {
814 pr->power.count = i; 834 pr->power.count = i;
815 if ((pr->power.states[i].valid) &&
816 (pr->power.states[i].type >= ACPI_STATE_C2))
817 pr->flags.power = 1; 835 pr->flags.power = 1;
836 }
818 } 837 }
819 838
820 return_VALUE(0); 839 return_VALUE(0);