aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/processor_idle.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/processor_idle.c')
-rw-r--r--drivers/acpi/processor_idle.c37
1 files changed, 17 insertions, 20 deletions
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index f90c56c8379e..3dca36d4ad26 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -35,6 +35,7 @@
35#include <linux/clockchips.h> 35#include <linux/clockchips.h>
36#include <linux/cpuidle.h> 36#include <linux/cpuidle.h>
37#include <linux/syscore_ops.h> 37#include <linux/syscore_ops.h>
38#include <acpi/processor.h>
38 39
39/* 40/*
40 * Include the apic definitions for x86 to have the APIC timer related defines 41 * Include the apic definitions for x86 to have the APIC timer related defines
@@ -46,9 +47,6 @@
46#include <asm/apic.h> 47#include <asm/apic.h>
47#endif 48#endif
48 49
49#include <acpi/acpi_bus.h>
50#include <acpi/processor.h>
51
52#define PREFIX "ACPI: " 50#define PREFIX "ACPI: "
53 51
54#define ACPI_PROCESSOR_CLASS "processor" 52#define ACPI_PROCESSOR_CLASS "processor"
@@ -213,7 +211,7 @@ static int acpi_processor_suspend(void)
213 211
214static void acpi_processor_resume(void) 212static void acpi_processor_resume(void)
215{ 213{
216 u32 resumed_bm_rld; 214 u32 resumed_bm_rld = 0;
217 215
218 acpi_read_bit_register(ACPI_BITREG_BUS_MASTER_RLD, &resumed_bm_rld); 216 acpi_read_bit_register(ACPI_BITREG_BUS_MASTER_RLD, &resumed_bm_rld);
219 if (resumed_bm_rld == saved_bm_rld) 217 if (resumed_bm_rld == saved_bm_rld)
@@ -598,7 +596,7 @@ static int acpi_processor_power_verify(struct acpi_processor *pr)
598 case ACPI_STATE_C2: 596 case ACPI_STATE_C2:
599 if (!cx->address) 597 if (!cx->address)
600 break; 598 break;
601 cx->valid = 1; 599 cx->valid = 1;
602 break; 600 break;
603 601
604 case ACPI_STATE_C3: 602 case ACPI_STATE_C3:
@@ -780,6 +778,13 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
780 if (unlikely(!pr)) 778 if (unlikely(!pr))
781 return -EINVAL; 779 return -EINVAL;
782 780
781#ifdef CONFIG_HOTPLUG_CPU
782 if ((cx->type != ACPI_STATE_C1) && (num_online_cpus() > 1) &&
783 !pr->flags.has_cst &&
784 !(acpi_gbl_FADT.flags & ACPI_FADT_C2_MP_SUPPORTED))
785 return acpi_idle_enter_c1(dev, drv, CPUIDLE_DRIVER_STATE_START);
786#endif
787
783 /* 788 /*
784 * Must be done before busmaster disable as we might need to 789 * Must be done before busmaster disable as we might need to
785 * access HPET ! 790 * access HPET !
@@ -821,6 +826,13 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
821 if (unlikely(!pr)) 826 if (unlikely(!pr))
822 return -EINVAL; 827 return -EINVAL;
823 828
829#ifdef CONFIG_HOTPLUG_CPU
830 if ((cx->type != ACPI_STATE_C1) && (num_online_cpus() > 1) &&
831 !pr->flags.has_cst &&
832 !(acpi_gbl_FADT.flags & ACPI_FADT_C2_MP_SUPPORTED))
833 return acpi_idle_enter_c1(dev, drv, CPUIDLE_DRIVER_STATE_START);
834#endif
835
824 if (!cx->bm_sts_skip && acpi_idle_bm_check()) { 836 if (!cx->bm_sts_skip && acpi_idle_bm_check()) {
825 if (drv->safe_state_index >= 0) { 837 if (drv->safe_state_index >= 0) {
826 return drv->states[drv->safe_state_index].enter(dev, 838 return drv->states[drv->safe_state_index].enter(dev,
@@ -917,12 +929,6 @@ static int acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr,
917 if (!cx->valid) 929 if (!cx->valid)
918 continue; 930 continue;
919 931
920#ifdef CONFIG_HOTPLUG_CPU
921 if ((cx->type != ACPI_STATE_C1) && (num_online_cpus() > 1) &&
922 !pr->flags.has_cst &&
923 !(acpi_gbl_FADT.flags & ACPI_FADT_C2_MP_SUPPORTED))
924 continue;
925#endif
926 per_cpu(acpi_cstate[count], dev->cpu) = cx; 932 per_cpu(acpi_cstate[count], dev->cpu) = cx;
927 933
928 count++; 934 count++;
@@ -930,8 +936,6 @@ static int acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr,
930 break; 936 break;
931 } 937 }
932 938
933 dev->state_count = count;
934
935 if (!count) 939 if (!count)
936 return -EINVAL; 940 return -EINVAL;
937 941
@@ -972,13 +976,6 @@ static int acpi_processor_setup_cpuidle_states(struct acpi_processor *pr)
972 if (!cx->valid) 976 if (!cx->valid)
973 continue; 977 continue;
974 978
975#ifdef CONFIG_HOTPLUG_CPU
976 if ((cx->type != ACPI_STATE_C1) && (num_online_cpus() > 1) &&
977 !pr->flags.has_cst &&
978 !(acpi_gbl_FADT.flags & ACPI_FADT_C2_MP_SUPPORTED))
979 continue;
980#endif
981
982 state = &drv->states[count]; 979 state = &drv->states[count];
983 snprintf(state->name, CPUIDLE_NAME_LEN, "C%d", i); 980 snprintf(state->name, CPUIDLE_NAME_LEN, "C%d", i);
984 strncpy(state->desc, cx->desc, CPUIDLE_DESC_LEN); 981 strncpy(state->desc, cx->desc, CPUIDLE_DESC_LEN);