From: Al Stone ahs3@redhat.com
Signed-off-by: Al Stone al.stone@linaro.org --- drivers/acpi/processor_idle.c | 74 ++++++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 36 deletions(-)
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 6ff9b57..3404f95 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -76,6 +76,7 @@ static int disabled_by_idle_boot_param(void) boot_option_idle_override == IDLE_HALT; }
+#if !(defined(CONFIG_ARM) || defined(CONFIG_ARM64)) /* * IBM ThinkPad R40e crashes mysteriously when going into C2 or C3. * For now disable this. Probably a bug somewhere else. @@ -95,7 +96,9 @@ static int set_max_cstate(const struct dmi_system_id *id)
return 0; } +#endif
+#if !(defined(CONFIG_ARM) || defined(CONFIG_ARM64)) static struct dmi_system_id processor_power_dmi_table[] = { { set_max_cstate, "Clevo 5600D", { DMI_MATCH(DMI_BIOS_VENDOR,"Phoenix Technologies LTD"), @@ -111,35 +114,32 @@ static struct dmi_system_id processor_power_dmi_table[] = { (void *)1}, {}, }; +#endif
+#if !(defined(CONFIG_ARM) || defined(CONFIG_ARM64)) /* * Callers should disable interrupts before the call and enable * interrupts after return. */ static void acpi_safe_halt(void) { -#ifdef CONFIG_X86 - /* BOZO: abstract out? */ current_thread_info()->status &= ~TS_POLLING; -#endif + /* * TS_POLLING-cleared state must be visible before we * test NEED_RESCHED: */ smp_mb(); if (!need_resched()) { -#ifdef CONFIG_X86 - /* BOZO: abstract out? */ safe_halt(); -#endif local_irq_disable(); } -#ifdef CONFIG_X86 - /* BOZO: abstract out? */ current_thread_info()->status |= TS_POLLING; -#endif } +#else +static void acpi_safe_halt(void) { return; } +#endif
#ifdef ARCH_APICTIMER_STOPS_ON_C3
@@ -678,6 +678,7 @@ static int acpi_processor_get_power_info(struct acpi_processor *pr) return 0; }
+#if !(defined(CONFIG_ARM) || defined(CONFIG_ARM64)) /** * acpi_idle_bm_check - checks if bus master activity was detected */ @@ -703,6 +704,7 @@ static int acpi_idle_bm_check(void) } return bm_status; } +#endif
/** * acpi_idle_do_entry - a helper function that does C2 and C3 type entry @@ -758,6 +760,7 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev, }
+#if !(defined(CONFIG_ARM) || defined(CONFIG_ARM64)) /** * acpi_idle_play_dead - enters an ACPI state for long-term idle (i.e. off-lining) * @dev: the target CPU @@ -771,8 +774,6 @@ static int acpi_idle_play_dead(struct cpuidle_device *dev, int index)
while (1) {
-#ifdef CONFIG_X86 - /* BOZO: abstract out? */ if (cx->entry_method == ACPI_CSTATE_HALT) safe_halt(); else if (cx->entry_method == ACPI_CSTATE_SYSTEMIO) { @@ -780,14 +781,20 @@ static int acpi_idle_play_dead(struct cpuidle_device *dev, int index) /* See comment in acpi_idle_do_entry() */ inl(acpi_gbl_FADT.xpm_timer_block.address); } else -#endif return -ENODEV; }
/* Never reached */ return 0; } +#else +static int acpi_idle_play_dead(struct cpuidle_device *dev, int index) +{ + return -ENODEV; +} +#endif
+#if !(defined(CONFIG_ARM) || defined(CONFIG_ARM64)) /** * acpi_idle_enter_simple - enters an ACPI state without BM handling * @dev: the target CPU @@ -806,10 +813,7 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev, return -EINVAL;
if (cx->entry_method != ACPI_CSTATE_FFH) { -#ifdef CONFIG_X86 - /* BOZO: abstract out? */ current_thread_info()->status &= ~TS_POLLING; -#endif /* * TS_POLLING-cleared state must be visible before we test * NEED_RESCHED: @@ -817,10 +821,7 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev, smp_mb();
if (unlikely(need_resched())) { -#ifdef CONFIG_X86 - /* BOZO: abstract out? */ current_thread_info()->status |= TS_POLLING; -#endif return -EINVAL; } } @@ -840,16 +841,21 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
sched_clock_idle_wakeup_event(0);
-#ifdef CONFIG_X86 - /* BOZO: abstract out? */ if (cx->entry_method != ACPI_CSTATE_FFH) current_thread_info()->status |= TS_POLLING; -#endif
lapic_timer_state_broadcast(pr, cx, 0); return index; } +#else +static int acpi_idle_enter_simple(struct cpuidle_device *dev, + struct cpuidle_driver *drv, int index) +{ + return -EINVAL; +} +#endif
+#if !(defined(CONFIG_ARM) || defined(CONFIG_ARM64)) static int c3_cpu_count; static DEFINE_RAW_SPINLOCK(c3_lock);
@@ -883,10 +889,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, }
if (cx->entry_method != ACPI_CSTATE_FFH) { -#ifdef CONFIG_X86 - /* BOZO: abstract out? */ current_thread_info()->status &= ~TS_POLLING; -#endif /* * TS_POLLING-cleared state must be visible before we test * NEED_RESCHED: @@ -894,18 +897,12 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, smp_mb();
if (unlikely(need_resched())) { -#ifdef CONFIG_X86 - /* BOZO: abstract out? */ current_thread_info()->status |= TS_POLLING; -#endif return -EINVAL; } }
-#ifdef CONFIG_X86 - /* BOZO: abstract out? */ acpi_unlazy_tlb(smp_processor_id()); -#endif
/* Tell the scheduler that we are going deep-idle: */ sched_clock_idle_sleep_event(); @@ -948,15 +945,19 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
sched_clock_idle_wakeup_event(0);
-#ifdef CONFIG_X86 - /* BOZO: abstract out? */ if (cx->entry_method != ACPI_CSTATE_FFH) current_thread_info()->status |= TS_POLLING; -#endif
lapic_timer_state_broadcast(pr, cx, 0); return index; } +#else +static int acpi_idle_enter_bm(struct cpuidle_device *dev, + struct cpuidle_driver *drv, int index) +{ + return -EINVAL; +} +#endif
struct cpuidle_driver acpi_idle_driver = { .name = "acpi_idle", @@ -1201,6 +1202,7 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr)
static int acpi_processor_registered;
+#if !(defined(CONFIG_ARM) || defined(CONFIG_ARM64)) int acpi_processor_power_init(struct acpi_processor *pr) { acpi_status status = 0; @@ -1213,10 +1215,7 @@ int acpi_processor_power_init(struct acpi_processor *pr)
if (!first_run) { dmi_check_system(processor_power_dmi_table); -#ifdef CONFIG_X86 - /* BOZO: abstract out? */ max_cstate = acpi_processor_cstate_check(max_cstate); -#endif if (max_cstate < ACPI_C_STATES_MAX) printk(KERN_NOTICE "ACPI: processor limited to max C-state %d\n", @@ -1275,6 +1274,9 @@ int acpi_processor_power_init(struct acpi_processor *pr) } return 0; } +#else +int acpi_processor_power_init(struct acpi_processor *pr) { return 0; } +#endif
int acpi_processor_power_exit(struct acpi_processor *pr) {