Commit 8592013b authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

Merge branch 'pm-cpuidle'

* pm-cpuidle:
  ACPI / processor: remove pointless variable initialization
  ACPI / processor: remove unused function parameter
  cpuidle / ACPI : remove power from acpi_processor_cx structure
  PM / cpuidle: Make ladder governor use the "disabled" state flag
  Honor state disabling in the cpuidle ladder governor
parents 00e8b261 ed1511b8
...@@ -76,9 +76,17 @@ total 0 ...@@ -76,9 +76,17 @@ total 0
* desc : Small description about the idle state (string) * desc : Small description about the idle state (string)
* disable : Option to disable this idle state (bool) * disable : Option to disable this idle state (bool) -> see note below
* latency : Latency to exit out of this idle state (in microseconds) * latency : Latency to exit out of this idle state (in microseconds)
* name : Name of the idle state (string) * name : Name of the idle state (string)
* power : Power consumed while in this idle state (in milliwatts) * power : Power consumed while in this idle state (in milliwatts)
* time : Total time spent in this idle state (in microseconds) * time : Total time spent in this idle state (in microseconds)
* usage : Number of times this state was entered (count) * usage : Number of times this state was entered (count)
Note:
The behavior and the effect of the disable variable depends on the
implementation of a particular governor. In the ladder governor, for
example, it is not coherent, i.e. if one is disabling a light state,
then all deeper states are disabled as well, but the disable variable
does not reflect it. Likewise, if one enables a deep state but a lighter
state still is disabled, then this has no effect.
...@@ -475,7 +475,7 @@ static __ref int acpi_processor_start(struct acpi_processor *pr) ...@@ -475,7 +475,7 @@ static __ref int acpi_processor_start(struct acpi_processor *pr)
acpi_processor_get_limit_info(pr); acpi_processor_get_limit_info(pr);
if (!cpuidle_get_driver() || cpuidle_get_driver() == &acpi_idle_driver) if (!cpuidle_get_driver() || cpuidle_get_driver() == &acpi_idle_driver)
acpi_processor_power_init(pr, device); acpi_processor_power_init(pr);
pr->cdev = thermal_cooling_device_register("Processor", device, pr->cdev = thermal_cooling_device_register("Processor", device,
&processor_cooling_ops); &processor_cooling_ops);
...@@ -509,7 +509,7 @@ static __ref int acpi_processor_start(struct acpi_processor *pr) ...@@ -509,7 +509,7 @@ static __ref int acpi_processor_start(struct acpi_processor *pr)
err_thermal_unregister: err_thermal_unregister:
thermal_cooling_device_unregister(pr->cdev); thermal_cooling_device_unregister(pr->cdev);
err_power_exit: err_power_exit:
acpi_processor_power_exit(pr, device); acpi_processor_power_exit(pr);
return result; return result;
} }
...@@ -620,7 +620,7 @@ static int acpi_processor_remove(struct acpi_device *device, int type) ...@@ -620,7 +620,7 @@ static int acpi_processor_remove(struct acpi_device *device, int type)
return -EINVAL; return -EINVAL;
} }
acpi_processor_power_exit(pr, device); acpi_processor_power_exit(pr);
sysfs_remove_link(&device->dev.kobj, "sysdev"); sysfs_remove_link(&device->dev.kobj, "sysdev");
...@@ -905,8 +905,6 @@ static int __init acpi_processor_init(void) ...@@ -905,8 +905,6 @@ static int __init acpi_processor_init(void)
if (acpi_disabled) if (acpi_disabled)
return 0; return 0;
memset(&errata, 0, sizeof(errata));
result = acpi_bus_register_driver(&acpi_processor_driver); result = acpi_bus_register_driver(&acpi_processor_driver);
if (result < 0) if (result < 0)
return result; return result;
......
...@@ -483,8 +483,6 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr) ...@@ -483,8 +483,6 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
if (obj->type != ACPI_TYPE_INTEGER) if (obj->type != ACPI_TYPE_INTEGER)
continue; continue;
cx.power = obj->integer.value;
current_count++; current_count++;
memcpy(&(pr->power.states[current_count]), &cx, sizeof(cx)); memcpy(&(pr->power.states[current_count]), &cx, sizeof(cx));
...@@ -1218,8 +1216,7 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr) ...@@ -1218,8 +1216,7 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr)
static int acpi_processor_registered; static int acpi_processor_registered;
int __cpuinit acpi_processor_power_init(struct acpi_processor *pr, int __cpuinit acpi_processor_power_init(struct acpi_processor *pr)
struct acpi_device *device)
{ {
acpi_status status = 0; acpi_status status = 0;
int retval; int retval;
...@@ -1283,8 +1280,7 @@ int __cpuinit acpi_processor_power_init(struct acpi_processor *pr, ...@@ -1283,8 +1280,7 @@ int __cpuinit acpi_processor_power_init(struct acpi_processor *pr,
return 0; return 0;
} }
int acpi_processor_power_exit(struct acpi_processor *pr, int acpi_processor_power_exit(struct acpi_processor *pr)
struct acpi_device *device)
{ {
if (disabled_by_idle_boot_param()) if (disabled_by_idle_boot_param())
return 0; return 0;
......
...@@ -88,6 +88,8 @@ static int ladder_select_state(struct cpuidle_driver *drv, ...@@ -88,6 +88,8 @@ static int ladder_select_state(struct cpuidle_driver *drv,
/* consider promotion */ /* consider promotion */
if (last_idx < drv->state_count - 1 && if (last_idx < drv->state_count - 1 &&
!drv->states[last_idx + 1].disabled &&
!dev->states_usage[last_idx + 1].disable &&
last_residency > last_state->threshold.promotion_time && last_residency > last_state->threshold.promotion_time &&
drv->states[last_idx + 1].exit_latency <= latency_req) { drv->states[last_idx + 1].exit_latency <= latency_req) {
last_state->stats.promotion_count++; last_state->stats.promotion_count++;
...@@ -100,7 +102,9 @@ static int ladder_select_state(struct cpuidle_driver *drv, ...@@ -100,7 +102,9 @@ static int ladder_select_state(struct cpuidle_driver *drv,
/* consider demotion */ /* consider demotion */
if (last_idx > CPUIDLE_DRIVER_STATE_START && if (last_idx > CPUIDLE_DRIVER_STATE_START &&
drv->states[last_idx].exit_latency > latency_req) { (drv->states[last_idx].disabled ||
dev->states_usage[last_idx].disable ||
drv->states[last_idx].exit_latency > latency_req)) {
int i; int i;
for (i = last_idx - 1; i > CPUIDLE_DRIVER_STATE_START; i--) { for (i = last_idx - 1; i > CPUIDLE_DRIVER_STATE_START; i--) {
......
...@@ -98,7 +98,6 @@ static int push_cxx_to_hypervisor(struct acpi_processor *_pr) ...@@ -98,7 +98,6 @@ static int push_cxx_to_hypervisor(struct acpi_processor *_pr)
dst_cx->type = cx->type; dst_cx->type = cx->type;
dst_cx->latency = cx->latency; dst_cx->latency = cx->latency;
dst_cx->power = cx->power;
dst_cx->dpcnt = 0; dst_cx->dpcnt = 0;
set_xen_guest_handle(dst_cx->dp, NULL); set_xen_guest_handle(dst_cx->dp, NULL);
......
...@@ -59,7 +59,6 @@ struct acpi_processor_cx { ...@@ -59,7 +59,6 @@ struct acpi_processor_cx {
u8 entry_method; u8 entry_method;
u8 index; u8 index;
u32 latency; u32 latency;
u32 power;
u8 bm_sts_skip; u8 bm_sts_skip;
char desc[ACPI_CX_DESC_LEN]; char desc[ACPI_CX_DESC_LEN];
}; };
...@@ -325,12 +324,10 @@ extern void acpi_processor_reevaluate_tstate(struct acpi_processor *pr, ...@@ -325,12 +324,10 @@ extern void acpi_processor_reevaluate_tstate(struct acpi_processor *pr,
extern const struct file_operations acpi_processor_throttling_fops; extern const struct file_operations acpi_processor_throttling_fops;
extern void acpi_processor_throttling_init(void); extern void acpi_processor_throttling_init(void);
/* in processor_idle.c */ /* in processor_idle.c */
int acpi_processor_power_init(struct acpi_processor *pr, int acpi_processor_power_init(struct acpi_processor *pr);
struct acpi_device *device); int acpi_processor_power_exit(struct acpi_processor *pr);
int acpi_processor_cst_has_changed(struct acpi_processor *pr); int acpi_processor_cst_has_changed(struct acpi_processor *pr);
int acpi_processor_hotplug(struct acpi_processor *pr); int acpi_processor_hotplug(struct acpi_processor *pr);
int acpi_processor_power_exit(struct acpi_processor *pr,
struct acpi_device *device);
int acpi_processor_suspend(struct device *dev); int acpi_processor_suspend(struct device *dev);
int acpi_processor_resume(struct device *dev); int acpi_processor_resume(struct device *dev);
extern struct cpuidle_driver acpi_idle_driver; extern struct cpuidle_driver acpi_idle_driver;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment