diff options
| author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2017-09-03 18:05:51 -0400 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2017-09-03 18:05:51 -0400 |
| commit | a1b5fd8fa29fb2359f398ef17a706449d94de80d (patch) | |
| tree | 0fceec781252aa78e8c13061cca57cb7bece405f /drivers/acpi | |
| parent | ab271bc95b40960799c084b0e94a33c4272ec0bf (diff) | |
| parent | 1b39e3f813b4685c7a30ae964d5529a1b0e3a286 (diff) | |
Merge branch 'pm-cpuidle'
* pm-cpuidle:
cpuidle: Make drivers initialize polling state
cpuidle: Move polling state initialization code to separate file
cpuidle: Eliminate the CPUIDLE_DRIVER_STATE_START symbol
cpuidle: Convert to using %pOF instead of full_name
Diffstat (limited to 'drivers/acpi')
| -rw-r--r-- | drivers/acpi/processor_idle.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 5c8aa9cf62d7..df38e81cc672 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
| @@ -48,6 +48,8 @@ | |||
| 48 | #define _COMPONENT ACPI_PROCESSOR_COMPONENT | 48 | #define _COMPONENT ACPI_PROCESSOR_COMPONENT |
| 49 | ACPI_MODULE_NAME("processor_idle"); | 49 | ACPI_MODULE_NAME("processor_idle"); |
| 50 | 50 | ||
| 51 | #define ACPI_IDLE_STATE_START (IS_ENABLED(CONFIG_ARCH_HAS_CPU_RELAX) ? 1 : 0) | ||
| 52 | |||
| 51 | static unsigned int max_cstate __read_mostly = ACPI_PROCESSOR_MAX_POWER; | 53 | static unsigned int max_cstate __read_mostly = ACPI_PROCESSOR_MAX_POWER; |
| 52 | module_param(max_cstate, uint, 0000); | 54 | module_param(max_cstate, uint, 0000); |
| 53 | static unsigned int nocst __read_mostly; | 55 | static unsigned int nocst __read_mostly; |
| @@ -761,7 +763,7 @@ static int acpi_idle_enter(struct cpuidle_device *dev, | |||
| 761 | 763 | ||
| 762 | if (cx->type != ACPI_STATE_C1) { | 764 | if (cx->type != ACPI_STATE_C1) { |
| 763 | if (acpi_idle_fallback_to_c1(pr) && num_online_cpus() > 1) { | 765 | if (acpi_idle_fallback_to_c1(pr) && num_online_cpus() > 1) { |
| 764 | index = CPUIDLE_DRIVER_STATE_START; | 766 | index = ACPI_IDLE_STATE_START; |
| 765 | cx = per_cpu(acpi_cstate[index], dev->cpu); | 767 | cx = per_cpu(acpi_cstate[index], dev->cpu); |
| 766 | } else if (cx->type == ACPI_STATE_C3 && pr->flags.bm_check) { | 768 | } else if (cx->type == ACPI_STATE_C3 && pr->flags.bm_check) { |
| 767 | if (cx->bm_sts_skip || !acpi_idle_bm_check()) { | 769 | if (cx->bm_sts_skip || !acpi_idle_bm_check()) { |
| @@ -813,7 +815,7 @@ static void acpi_idle_enter_freeze(struct cpuidle_device *dev, | |||
| 813 | static int acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr, | 815 | static int acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr, |
| 814 | struct cpuidle_device *dev) | 816 | struct cpuidle_device *dev) |
| 815 | { | 817 | { |
| 816 | int i, count = CPUIDLE_DRIVER_STATE_START; | 818 | int i, count = ACPI_IDLE_STATE_START; |
| 817 | struct acpi_processor_cx *cx; | 819 | struct acpi_processor_cx *cx; |
| 818 | 820 | ||
| 819 | if (max_cstate == 0) | 821 | if (max_cstate == 0) |
| @@ -840,7 +842,7 @@ static int acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr, | |||
| 840 | 842 | ||
| 841 | static int acpi_processor_setup_cstates(struct acpi_processor *pr) | 843 | static int acpi_processor_setup_cstates(struct acpi_processor *pr) |
| 842 | { | 844 | { |
| 843 | int i, count = CPUIDLE_DRIVER_STATE_START; | 845 | int i, count; |
| 844 | struct acpi_processor_cx *cx; | 846 | struct acpi_processor_cx *cx; |
| 845 | struct cpuidle_state *state; | 847 | struct cpuidle_state *state; |
| 846 | struct cpuidle_driver *drv = &acpi_idle_driver; | 848 | struct cpuidle_driver *drv = &acpi_idle_driver; |
| @@ -848,6 +850,13 @@ static int acpi_processor_setup_cstates(struct acpi_processor *pr) | |||
| 848 | if (max_cstate == 0) | 850 | if (max_cstate == 0) |
| 849 | max_cstate = 1; | 851 | max_cstate = 1; |
| 850 | 852 | ||
| 853 | if (IS_ENABLED(CONFIG_ARCH_HAS_CPU_RELAX)) { | ||
| 854 | cpuidle_poll_state_init(drv); | ||
| 855 | count = 1; | ||
| 856 | } else { | ||
| 857 | count = 0; | ||
| 858 | } | ||
| 859 | |||
| 851 | for (i = 1; i < ACPI_PROCESSOR_MAX_POWER && i <= max_cstate; i++) { | 860 | for (i = 1; i < ACPI_PROCESSOR_MAX_POWER && i <= max_cstate; i++) { |
| 852 | cx = &pr->power.states[i]; | 861 | cx = &pr->power.states[i]; |
| 853 | 862 | ||
| @@ -1291,7 +1300,7 @@ static int acpi_processor_setup_cpuidle_states(struct acpi_processor *pr) | |||
| 1291 | return -EINVAL; | 1300 | return -EINVAL; |
| 1292 | 1301 | ||
| 1293 | drv->safe_state_index = -1; | 1302 | drv->safe_state_index = -1; |
| 1294 | for (i = CPUIDLE_DRIVER_STATE_START; i < CPUIDLE_STATE_MAX; i++) { | 1303 | for (i = ACPI_IDLE_STATE_START; i < CPUIDLE_STATE_MAX; i++) { |
| 1295 | drv->states[i].name[0] = '\0'; | 1304 | drv->states[i].name[0] = '\0'; |
| 1296 | drv->states[i].desc[0] = '\0'; | 1305 | drv->states[i].desc[0] = '\0'; |
| 1297 | } | 1306 | } |
