aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-07-11 15:28:17 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-11 15:28:17 -0400
commit7728f036adb25f8f7f8e36ffa9cecf6ba3ddae91 (patch)
treeb37f71e5fd0d0bdd8919b294889c51f53320c513
parent8cbd0eefcaf8cc32ded2bf229f0fc379b2ad69f2 (diff)
parentd8851b4b0c1e7cf6cae829d060510437d2d320ee (diff)
Merge tag 'pm+acpi-3.11-rc1-more' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull more power management and ACPI updates from Rafael Wysocki: - Fix for a recent cpufreq regression that caused WARN() to trigger overzealously in a couple of places and spam the kernel log with useless garbage as a result. From Viresh Kumar. - ACPI dock fix removing a discrepancy between the definition of acpi_dock_init(), which says that the function returns int, and its header in the header file, which says that it is a void function. The function is now defined as void too. - ACPI PM fix for failures to update device power states as needed, for example, during resume from system suspend, because the old state was deeper than the new one, but the new one is not D0. - Fix for two debug messages in the ACPI power resources code that don't have a newline at the end and make the kernel log difficult to read. From Mika Westerberg. - Two ACPI cleanups from Naresh Bhat and Haicheng Li. - cpupower updates from Thomas Renninger, including Intel Haswell support improvements and a new idle-set subcommand among other things. * tag 'pm+acpi-3.11-rc1-more' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI / power: add missing newline to debug messages cpupower: Add Haswell family 0x45 specific idle monitor to show PC8,9,10 states cpupower: Haswell also supports the C-states introduced with SandyBridge cpupower: Introduce idle-set subcommand and C-state enabling/disabling cpupower: Implement disabling of cstate interface cpupower: Make idlestate usage unsigned ACPI / fan: Initialize acpi_state variable ACPI / scan: remove unused LIST_HEAD(acpi_device_list) ACPI / dock: Actually define acpi_dock_init() as void ACPI / PM: Fix corner case in acpi_bus_update_power() cpufreq: Fix serialization of frequency transitions
-rw-r--r--drivers/acpi/device_pm.c23
-rw-r--r--drivers/acpi/dock.c7
-rw-r--r--drivers/acpi/fan.c2
-rw-r--r--drivers/acpi/power.c4
-rw-r--r--drivers/acpi/scan.c1
-rw-r--r--drivers/cpufreq/cpufreq.c7
-rw-r--r--include/linux/cpufreq.h2
-rw-r--r--tools/power/cpupower/Makefile4
-rw-r--r--tools/power/cpupower/man/cpupower-monitor.110
-rw-r--r--tools/power/cpupower/utils/builtin.h1
-rw-r--r--tools/power/cpupower/utils/cpuidle-info.c24
-rw-r--r--tools/power/cpupower/utils/cpuidle-set.c118
-rw-r--r--tools/power/cpupower/utils/cpupower.c13
-rw-r--r--tools/power/cpupower/utils/helpers/sysfs.c118
-rw-r--r--tools/power/cpupower/utils/helpers/sysfs.h10
-rw-r--r--tools/power/cpupower/utils/idle_monitor/hsw_ext_idle.c196
-rw-r--r--tools/power/cpupower/utils/idle_monitor/idle_monitors.def1
-rw-r--r--tools/power/cpupower/utils/idle_monitor/snb_idle.c4
18 files changed, 502 insertions, 43 deletions
diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c
index e9e8bb24785b..4ab807dc8518 100644
--- a/drivers/acpi/device_pm.c
+++ b/drivers/acpi/device_pm.c
@@ -324,14 +324,27 @@ int acpi_bus_update_power(acpi_handle handle, int *state_p)
324 if (result) 324 if (result)
325 return result; 325 return result;
326 326
327 if (state == ACPI_STATE_UNKNOWN) 327 if (state == ACPI_STATE_UNKNOWN) {
328 state = ACPI_STATE_D0; 328 state = ACPI_STATE_D0;
329 329 result = acpi_device_set_power(device, state);
330 result = acpi_device_set_power(device, state); 330 if (result)
331 if (!result && state_p) 331 return result;
332 } else {
333 if (device->power.flags.power_resources) {
334 /*
335 * We don't need to really switch the state, bu we need
336 * to update the power resources' reference counters.
337 */
338 result = acpi_power_transition(device, state);
339 if (result)
340 return result;
341 }
342 device->power.state = state;
343 }
344 if (state_p)
332 *state_p = state; 345 *state_p = state;
333 346
334 return result; 347 return 0;
335} 348}
336EXPORT_SYMBOL_GPL(acpi_bus_update_power); 349EXPORT_SYMBOL_GPL(acpi_bus_update_power);
337 350
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
index 14de9f46972e..826560753389 100644
--- a/drivers/acpi/dock.c
+++ b/drivers/acpi/dock.c
@@ -1064,10 +1064,10 @@ find_dock_and_bay(acpi_handle handle, u32 lvl, void *context, void **rv)
1064 return AE_OK; 1064 return AE_OK;
1065} 1065}
1066 1066
1067int __init acpi_dock_init(void) 1067void __init acpi_dock_init(void)
1068{ 1068{
1069 if (acpi_disabled) 1069 if (acpi_disabled)
1070 return 0; 1070 return;
1071 1071
1072 /* look for dock stations and bays */ 1072 /* look for dock stations and bays */
1073 acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, 1073 acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
@@ -1075,11 +1075,10 @@ int __init acpi_dock_init(void)
1075 1075
1076 if (!dock_station_count) { 1076 if (!dock_station_count) {
1077 pr_info(PREFIX "No dock devices found.\n"); 1077 pr_info(PREFIX "No dock devices found.\n");
1078 return 0; 1078 return;
1079 } 1079 }
1080 1080
1081 register_acpi_bus_notifier(&dock_acpi_notifier); 1081 register_acpi_bus_notifier(&dock_acpi_notifier);
1082 pr_info(PREFIX "%s: %d docks/bays found\n", 1082 pr_info(PREFIX "%s: %d docks/bays found\n",
1083 ACPI_DOCK_DRIVER_DESCRIPTION, dock_station_count); 1083 ACPI_DOCK_DRIVER_DESCRIPTION, dock_station_count);
1084 return 0;
1085} 1084}
diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c
index 8d1c0105e113..5b02a0aa540c 100644
--- a/drivers/acpi/fan.c
+++ b/drivers/acpi/fan.c
@@ -84,7 +84,7 @@ static int fan_get_cur_state(struct thermal_cooling_device *cdev, unsigned long
84{ 84{
85 struct acpi_device *device = cdev->devdata; 85 struct acpi_device *device = cdev->devdata;
86 int result; 86 int result;
87 int acpi_state; 87 int acpi_state = ACPI_STATE_D0;
88 88
89 if (!device) 89 if (!device)
90 return -EINVAL; 90 return -EINVAL;
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index 288bb270f8ed..5c28c894c0fc 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -279,7 +279,7 @@ static int acpi_power_on_unlocked(struct acpi_power_resource *resource)
279 279
280 if (resource->ref_count++) { 280 if (resource->ref_count++) {
281 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 281 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
282 "Power resource [%s] already on", 282 "Power resource [%s] already on\n",
283 resource->name)); 283 resource->name));
284 } else { 284 } else {
285 result = __acpi_power_on(resource); 285 result = __acpi_power_on(resource);
@@ -325,7 +325,7 @@ static int acpi_power_off_unlocked(struct acpi_power_resource *resource)
325 325
326 if (!resource->ref_count) { 326 if (!resource->ref_count) {
327 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 327 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
328 "Power resource [%s] already off", 328 "Power resource [%s] already off\n",
329 resource->name)); 329 resource->name));
330 return 0; 330 return 0;
331 } 331 }
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index dfe76f17cfc4..10985573aaa7 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -35,7 +35,6 @@ bool acpi_force_hot_remove;
35 35
36static const char *dummy_hid = "device"; 36static const char *dummy_hid = "device";
37 37
38static LIST_HEAD(acpi_device_list);
39static LIST_HEAD(acpi_bus_id_list); 38static LIST_HEAD(acpi_bus_id_list);
40static DEFINE_MUTEX(acpi_scan_lock); 39static DEFINE_MUTEX(acpi_scan_lock);
41static LIST_HEAD(acpi_scan_handlers_list); 40static LIST_HEAD(acpi_scan_handlers_list);
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 6a015ada5285..0937b8d6c2a4 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -312,11 +312,12 @@ static void __cpufreq_notify_transition(struct cpufreq_policy *policy,
312 switch (state) { 312 switch (state) {
313 313
314 case CPUFREQ_PRECHANGE: 314 case CPUFREQ_PRECHANGE:
315 if (WARN(policy->transition_ongoing, 315 if (WARN(policy->transition_ongoing ==
316 cpumask_weight(policy->cpus),
316 "In middle of another frequency transition\n")) 317 "In middle of another frequency transition\n"))
317 return; 318 return;
318 319
319 policy->transition_ongoing = true; 320 policy->transition_ongoing++;
320 321
321 /* detect if the driver reported a value as "old frequency" 322 /* detect if the driver reported a value as "old frequency"
322 * which is not equal to what the cpufreq core thinks is 323 * which is not equal to what the cpufreq core thinks is
@@ -341,7 +342,7 @@ static void __cpufreq_notify_transition(struct cpufreq_policy *policy,
341 "No frequency transition in progress\n")) 342 "No frequency transition in progress\n"))
342 return; 343 return;
343 344
344 policy->transition_ongoing = false; 345 policy->transition_ongoing--;
345 346
346 adjust_jiffies(CPUFREQ_POSTCHANGE, freqs); 347 adjust_jiffies(CPUFREQ_POSTCHANGE, freqs);
347 pr_debug("FREQ: %lu - CPU: %lu", (unsigned long)freqs->new, 348 pr_debug("FREQ: %lu - CPU: %lu", (unsigned long)freqs->new,
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 4d7390bc1727..90d5a15120d5 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -119,7 +119,7 @@ struct cpufreq_policy {
119 119
120 struct kobject kobj; 120 struct kobject kobj;
121 struct completion kobj_unregister; 121 struct completion kobj_unregister;