Commit 9aa4e2f6 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

Merge branches 'pm-sleep', 'powercap', 'pm-domains' and 'pm-cpufreq'

* pm-sleep:
  PM / sleep: Fix test_suspend= command line option

* powercap:
  powercap / RAPL: change domain detection message
  powercap / RAPL: add support for CPU model 0x3f

* pm-domains:
  PM / domains: Make generic_pm_domain.name const

* pm-cpufreq:
  cpufreq: intel_pstate: Remove unneeded variable
...@@ -708,10 +708,6 @@ static unsigned int intel_pstate_get(unsigned int cpu_num) ...@@ -708,10 +708,6 @@ static unsigned int intel_pstate_get(unsigned int cpu_num)
static int intel_pstate_set_policy(struct cpufreq_policy *policy) static int intel_pstate_set_policy(struct cpufreq_policy *policy)
{ {
struct cpudata *cpu;
cpu = all_cpu_data[policy->cpu];
if (!policy->cpuinfo.max_freq) if (!policy->cpuinfo.max_freq)
return -ENODEV; return -ENODEV;
......
...@@ -953,6 +953,7 @@ static const struct x86_cpu_id rapl_ids[] = { ...@@ -953,6 +953,7 @@ static const struct x86_cpu_id rapl_ids[] = {
{ X86_VENDOR_INTEL, 6, 0x3a},/* Ivy Bridge */ { X86_VENDOR_INTEL, 6, 0x3a},/* Ivy Bridge */
{ X86_VENDOR_INTEL, 6, 0x3c},/* Haswell */ { X86_VENDOR_INTEL, 6, 0x3c},/* Haswell */
{ X86_VENDOR_INTEL, 6, 0x3d},/* Broadwell */ { X86_VENDOR_INTEL, 6, 0x3d},/* Broadwell */
{ X86_VENDOR_INTEL, 6, 0x3f},/* Haswell */
{ X86_VENDOR_INTEL, 6, 0x45},/* Haswell ULT */ { X86_VENDOR_INTEL, 6, 0x45},/* Haswell ULT */
/* TODO: Add more CPU IDs after testing */ /* TODO: Add more CPU IDs after testing */
{} {}
...@@ -1166,11 +1167,10 @@ static int rapl_detect_domains(struct rapl_package *rp, int cpu) ...@@ -1166,11 +1167,10 @@ static int rapl_detect_domains(struct rapl_package *rp, int cpu)
for (i = 0; i < RAPL_DOMAIN_MAX; i++) { for (i = 0; i < RAPL_DOMAIN_MAX; i++) {
/* use physical package id to read counters */ /* use physical package id to read counters */
if (!rapl_check_domain(cpu, i)) if (!rapl_check_domain(cpu, i)) {
rp->domain_map |= 1 << i; rp->domain_map |= 1 << i;
else pr_info("Found RAPL domain %s\n", rapl_domain_names[i]);
pr_warn("RAPL domain %s detection failed\n", }
rapl_domain_names[i]);
} }
rp->nr_domains = bitmap_weight(&rp->domain_map, RAPL_DOMAIN_MAX); rp->nr_domains = bitmap_weight(&rp->domain_map, RAPL_DOMAIN_MAX);
if (!rp->nr_domains) { if (!rp->nr_domains) {
......
...@@ -60,7 +60,7 @@ struct generic_pm_domain { ...@@ -60,7 +60,7 @@ struct generic_pm_domain {
struct mutex lock; struct mutex lock;
struct dev_power_governor *gov; struct dev_power_governor *gov;
struct work_struct power_off_work; struct work_struct power_off_work;
char *name; const char *name;
unsigned int in_progress; /* Number of devices being suspended now */ unsigned int in_progress; /* Number of devices being suspended now */
atomic_t sd_count; /* Number of subdomains with power "on" */ atomic_t sd_count; /* Number of subdomains with power "on" */
enum gpd_status status; /* Current state of the domain */ enum gpd_status status; /* Current state of the domain */
......
...@@ -179,6 +179,7 @@ extern void swsusp_show_speed(struct timeval *, struct timeval *, ...@@ -179,6 +179,7 @@ extern void swsusp_show_speed(struct timeval *, struct timeval *,
#ifdef CONFIG_SUSPEND #ifdef CONFIG_SUSPEND
/* kernel/power/suspend.c */ /* kernel/power/suspend.c */
extern const char *pm_labels[];
extern const char *pm_states[]; extern const char *pm_states[];
extern int suspend_devices_and_enter(suspend_state_t state); extern int suspend_devices_and_enter(suspend_state_t state);
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include "power.h" #include "power.h"
static const char *pm_labels[] = { "mem", "standby", "freeze", }; const char *pm_labels[] = { "mem", "standby", "freeze", NULL };
const char *pm_states[PM_SUSPEND_MAX]; const char *pm_states[PM_SUSPEND_MAX];
static const struct platform_suspend_ops *suspend_ops; static const struct platform_suspend_ops *suspend_ops;
......
...@@ -129,20 +129,20 @@ static int __init has_wakealarm(struct device *dev, const void *data) ...@@ -129,20 +129,20 @@ static int __init has_wakealarm(struct device *dev, const void *data)
* at startup time. They're normally disabled, for faster boot and because * at startup time. They're normally disabled, for faster boot and because
* we can't know which states really work on this particular system. * we can't know which states really work on this particular system.
*/ */
static suspend_state_t test_state __initdata = PM_SUSPEND_ON; static const char *test_state_label __initdata;
static char warn_bad_state[] __initdata = static char warn_bad_state[] __initdata =
KERN_WARNING "PM: can't test '%s' suspend state\n"; KERN_WARNING "PM: can't test '%s' suspend state\n";
static int __init setup_test_suspend(char *value) static int __init setup_test_suspend(char *value)
{ {
suspend_state_t i; int i;
/* "=mem" ==> "mem" */ /* "=mem" ==> "mem" */
value++; value++;
for (i = PM_SUSPEND_MIN; i < PM_SUSPEND_MAX; i++) for (i = 0; pm_labels[i]; i++)
if (!strcmp(pm_states[i], value)) { if (!strcmp(pm_labels[i], value)) {
test_state = i; test_state_label = pm_labels[i];
return 0; return 0;
} }
...@@ -158,13 +158,21 @@ static int __init test_suspend(void) ...@@ -158,13 +158,21 @@ static int __init test_suspend(void)
struct rtc_device *rtc = NULL; struct rtc_device *rtc = NULL;
struct device *dev; struct device *dev;
suspend_state_t test_state;
/* PM is initialized by now; is that state testable? */ /* PM is initialized by now; is that state testable? */
if (test_state == PM_SUSPEND_ON) if (!test_state_label)
goto done; return 0;
if (!pm_states[test_state]) {
printk(warn_bad_state, pm_states[test_state]); for (test_state = PM_SUSPEND_MIN; test_state < PM_SUSPEND_MAX; test_state++) {
goto done; const char *state_label = pm_states[test_state];
if (state_label && !strcmp(test_state_label, state_label))
break;
}
if (test_state == PM_SUSPEND_MAX) {
printk(warn_bad_state, test_state_label);
return 0;
} }
/* RTCs have initialized by now too ... can we use one? */ /* RTCs have initialized by now too ... can we use one? */
...@@ -173,13 +181,12 @@ static int __init test_suspend(void) ...@@ -173,13 +181,12 @@ static int __init test_suspend(void)
rtc = rtc_class_open(dev_name(dev)); rtc = rtc_class_open(dev_name(dev));
if (!rtc) { if (!rtc) {
printk(warn_no_rtc); printk(warn_no_rtc);
goto done; return 0;
} }
/* go for it */ /* go for it */
test_wakealarm(rtc, test_state); test_wakealarm(rtc, test_state);
rtc_class_close(rtc); rtc_class_close(rtc);
done:
return 0; return 0;
} }
late_initcall(test_suspend); late_initcall(test_suspend);
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