From 1d1e3b98e8a087dab3c6b9471ab719e7307b073b Mon Sep 17 00:00:00 2001 From: "venkatesh.pallipadi@intel.com" Date: Thu, 31 Jan 2008 17:35:04 -0800 Subject: [PATCH] --- yaml --- r: 84115 b: refs/heads/master c: bc71bec91f9875ef825d12104acf3bf4ca215fa4 h: refs/heads/master i: 84113: 47f1488f90c2b4221ea31642f87d2d783d17c1cd 84111: f005f47fffcff7aab63f376d6c8fbcb7a9ab96ee v: v3 --- [refs] | 2 +- trunk/drivers/acpi/processor_idle.c | 20 ++++++++++++-------- trunk/include/acpi/processor.h | 3 ++- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/[refs] b/[refs] index c84f414324d5..430c29ccd60a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 2e906655baf1c6f6fccd212fc9e6499dc6928b80 +refs/heads/master: bc71bec91f9875ef825d12104acf3bf4ca215fa4 diff --git a/trunk/drivers/acpi/processor_idle.c b/trunk/drivers/acpi/processor_idle.c index 106a22948aa9..4ba3a9a473dd 100644 --- a/trunk/drivers/acpi/processor_idle.c +++ b/trunk/drivers/acpi/processor_idle.c @@ -265,7 +265,7 @@ static atomic_t c3_cpu_count; /* Common C-state entry for C2, C3, .. */ static void acpi_cstate_enter(struct acpi_processor_cx *cstate) { - if (cstate->space_id == ACPI_CSTATE_FFH) { + if (cstate->entry_method == ACPI_CSTATE_FFH) { /* Call into architectural FFH based C-state */ acpi_processor_ffh_cstate_enter(cstate); } else { @@ -929,20 +929,20 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr) cx.address = reg->address; cx.index = current_count + 1; - cx.space_id = ACPI_CSTATE_SYSTEMIO; + cx.entry_method = ACPI_CSTATE_SYSTEMIO; if (reg->space_id == ACPI_ADR_SPACE_FIXED_HARDWARE) { if (acpi_processor_ffh_cstate_probe (pr->id, &cx, reg) == 0) { - cx.space_id = ACPI_CSTATE_FFH; - } else if (cx.type != ACPI_STATE_C1) { + cx.entry_method = ACPI_CSTATE_FFH; + } else if (cx.type == ACPI_STATE_C1) { /* * C1 is a special case where FIXED_HARDWARE * can be handled in non-MWAIT way as well. * In that case, save this _CST entry info. - * That is, we retain space_id of SYSTEM_IO for - * halt based C1. * Otherwise, ignore this info and continue. */ + cx.entry_method = ACPI_CSTATE_HALT; + } else { continue; } } @@ -1376,12 +1376,16 @@ static inline void acpi_idle_update_bm_rld(struct acpi_processor *pr, /** * acpi_idle_do_entry - a helper function that does C2 and C3 type entry * @cx: cstate data + * + * Caller disables interrupt before call and enables interrupt after return. */ static inline void acpi_idle_do_entry(struct acpi_processor_cx *cx) { - if (cx->space_id == ACPI_CSTATE_FFH) { + if (cx->entry_method == ACPI_CSTATE_FFH) { /* Call into architectural FFH based C-state */ acpi_processor_ffh_cstate_enter(cx); + } else if (cx->entry_method == ACPI_CSTATE_HALT) { + acpi_safe_halt(); } else { int unused; /* IO port based C-state */ @@ -1414,7 +1418,7 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev, if (pr->flags.bm_check) acpi_idle_update_bm_rld(pr, cx); - acpi_safe_halt(); + acpi_idle_do_entry(cx); local_irq_enable(); cx->usage++; diff --git a/trunk/include/acpi/processor.h b/trunk/include/acpi/processor.h index 6e253b5b0f3b..f6d7c508917c 100644 --- a/trunk/include/acpi/processor.h +++ b/trunk/include/acpi/processor.h @@ -34,6 +34,7 @@ #define ACPI_CSTATE_SYSTEMIO (0) #define ACPI_CSTATE_FFH (1) +#define ACPI_CSTATE_HALT (2) /* Power Management */ @@ -64,7 +65,7 @@ struct acpi_processor_cx { u8 valid; u8 type; u32 address; - u8 space_id; + u8 entry_method; u8 index; u32 latency; u32 latency_ticks;