diff options
-rw-r--r-- | drivers/acpi/processor_idle.c | 20 | ||||
-rw-r--r-- | include/acpi/processor.h | 3 |
2 files changed, 14 insertions, 9 deletions
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 106a22948aa9..4ba3a9a473dd 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -265,7 +265,7 @@ static atomic_t c3_cpu_count; | |||
265 | /* Common C-state entry for C2, C3, .. */ | 265 | /* Common C-state entry for C2, C3, .. */ |
266 | static void acpi_cstate_enter(struct acpi_processor_cx *cstate) | 266 | static void acpi_cstate_enter(struct acpi_processor_cx *cstate) |
267 | { | 267 | { |
268 | if (cstate->space_id == ACPI_CSTATE_FFH) { | 268 | if (cstate->entry_method == ACPI_CSTATE_FFH) { |
269 | /* Call into architectural FFH based C-state */ | 269 | /* Call into architectural FFH based C-state */ |
270 | acpi_processor_ffh_cstate_enter(cstate); | 270 | acpi_processor_ffh_cstate_enter(cstate); |
271 | } else { | 271 | } else { |
@@ -929,20 +929,20 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr) | |||
929 | cx.address = reg->address; | 929 | cx.address = reg->address; |
930 | cx.index = current_count + 1; | 930 | cx.index = current_count + 1; |
931 | 931 | ||
932 | cx.space_id = ACPI_CSTATE_SYSTEMIO; | 932 | cx.entry_method = ACPI_CSTATE_SYSTEMIO; |
933 | if (reg->space_id == ACPI_ADR_SPACE_FIXED_HARDWARE) { | 933 | if (reg->space_id == ACPI_ADR_SPACE_FIXED_HARDWARE) { |
934 | if (acpi_processor_ffh_cstate_probe | 934 | if (acpi_processor_ffh_cstate_probe |
935 | (pr->id, &cx, reg) == 0) { | 935 | (pr->id, &cx, reg) == 0) { |
936 | cx.space_id = ACPI_CSTATE_FFH; | 936 | cx.entry_method = ACPI_CSTATE_FFH; |
937 | } else if (cx.type != ACPI_STATE_C1) { | 937 | } else if (cx.type == ACPI_STATE_C1) { |
938 | /* | 938 | /* |
939 | * C1 is a special case where FIXED_HARDWARE | 939 | * C1 is a special case where FIXED_HARDWARE |
940 | * can be handled in non-MWAIT way as well. | 940 | * can be handled in non-MWAIT way as well. |
941 | * In that case, save this _CST entry info. | 941 | * In that case, save this _CST entry info. |
942 | * That is, we retain space_id of SYSTEM_IO for | ||
943 | * halt based C1. | ||
944 | * Otherwise, ignore this info and continue. | 942 | * Otherwise, ignore this info and continue. |
945 | */ | 943 | */ |
944 | cx.entry_method = ACPI_CSTATE_HALT; | ||
945 | } else { | ||
946 | continue; | 946 | continue; |
947 | } | 947 | } |
948 | } | 948 | } |
@@ -1376,12 +1376,16 @@ static inline void acpi_idle_update_bm_rld(struct acpi_processor *pr, | |||
1376 | /** | 1376 | /** |
1377 | * acpi_idle_do_entry - a helper function that does C2 and C3 type entry | 1377 | * acpi_idle_do_entry - a helper function that does C2 and C3 type entry |
1378 | * @cx: cstate data | 1378 | * @cx: cstate data |
1379 | * | ||
1380 | * Caller disables interrupt before call and enables interrupt after return. | ||
1379 | */ | 1381 | */ |
1380 | static inline void acpi_idle_do_entry(struct acpi_processor_cx *cx) | 1382 | static inline void acpi_idle_do_entry(struct acpi_processor_cx *cx) |
1381 | { | 1383 | { |
1382 | if (cx->space_id == ACPI_CSTATE_FFH) { | 1384 | if (cx->entry_method == ACPI_CSTATE_FFH) { |
1383 | /* Call into architectural FFH based C-state */ | 1385 | /* Call into architectural FFH based C-state */ |
1384 | acpi_processor_ffh_cstate_enter(cx); | 1386 | acpi_processor_ffh_cstate_enter(cx); |
1387 | } else if (cx->entry_method == ACPI_CSTATE_HALT) { | ||
1388 | acpi_safe_halt(); | ||
1385 | } else { | 1389 | } else { |
1386 | int unused; | 1390 | int unused; |
1387 | /* IO port based C-state */ | 1391 | /* IO port based C-state */ |
@@ -1414,7 +1418,7 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev, | |||
1414 | if (pr->flags.bm_check) | 1418 | if (pr->flags.bm_check) |
1415 | acpi_idle_update_bm_rld(pr, cx); | 1419 | acpi_idle_update_bm_rld(pr, cx); |
1416 | 1420 | ||
1417 | acpi_safe_halt(); | 1421 | acpi_idle_do_entry(cx); |
1418 | 1422 | ||
1419 | local_irq_enable(); | 1423 | local_irq_enable(); |
1420 | cx->usage++; | 1424 | cx->usage++; |
diff --git a/include/acpi/processor.h b/include/acpi/processor.h index 6e253b5b0f3b..f6d7c508917c 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h | |||
@@ -34,6 +34,7 @@ | |||
34 | 34 | ||
35 | #define ACPI_CSTATE_SYSTEMIO (0) | 35 | #define ACPI_CSTATE_SYSTEMIO (0) |
36 | #define ACPI_CSTATE_FFH (1) | 36 | #define ACPI_CSTATE_FFH (1) |
37 | #define ACPI_CSTATE_HALT (2) | ||
37 | 38 | ||
38 | /* Power Management */ | 39 | /* Power Management */ |
39 | 40 | ||
@@ -64,7 +65,7 @@ struct acpi_processor_cx { | |||
64 | u8 valid; | 65 | u8 valid; |
65 | u8 type; | 66 | u8 type; |
66 | u32 address; | 67 | u32 address; |
67 | u8 space_id; | 68 | u8 entry_method; |
68 | u8 index; | 69 | u8 index; |
69 | u32 latency; | 70 | u32 latency; |
70 | u32 latency_ticks; | 71 | u32 latency_ticks; |