Commit 9aa4e2f6ac2e5d0729f5982fd0b070123808381e
Exists in
ti-lsk-linux-4.1.y
and in
10 other branches
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
Showing 6 changed files Side-by-side Diff
drivers/cpufreq/intel_pstate.c
drivers/powercap/intel_rapl.c
... | ... | @@ -953,6 +953,7 @@ |
953 | 953 | { X86_VENDOR_INTEL, 6, 0x3a},/* Ivy Bridge */ |
954 | 954 | { X86_VENDOR_INTEL, 6, 0x3c},/* Haswell */ |
955 | 955 | { X86_VENDOR_INTEL, 6, 0x3d},/* Broadwell */ |
956 | + { X86_VENDOR_INTEL, 6, 0x3f},/* Haswell */ | |
956 | 957 | { X86_VENDOR_INTEL, 6, 0x45},/* Haswell ULT */ |
957 | 958 | /* TODO: Add more CPU IDs after testing */ |
958 | 959 | {} |
959 | 960 | |
... | ... | @@ -1166,11 +1167,10 @@ |
1166 | 1167 | |
1167 | 1168 | for (i = 0; i < RAPL_DOMAIN_MAX; i++) { |
1168 | 1169 | /* use physical package id to read counters */ |
1169 | - if (!rapl_check_domain(cpu, i)) | |
1170 | + if (!rapl_check_domain(cpu, i)) { | |
1170 | 1171 | rp->domain_map |= 1 << i; |
1171 | - else | |
1172 | - pr_warn("RAPL domain %s detection failed\n", | |
1173 | - rapl_domain_names[i]); | |
1172 | + pr_info("Found RAPL domain %s\n", rapl_domain_names[i]); | |
1173 | + } | |
1174 | 1174 | } |
1175 | 1175 | rp->nr_domains = bitmap_weight(&rp->domain_map, RAPL_DOMAIN_MAX); |
1176 | 1176 | if (!rp->nr_domains) { |
include/linux/pm_domain.h
... | ... | @@ -60,7 +60,7 @@ |
60 | 60 | struct mutex lock; |
61 | 61 | struct dev_power_governor *gov; |
62 | 62 | struct work_struct power_off_work; |
63 | - char *name; | |
63 | + const char *name; | |
64 | 64 | unsigned int in_progress; /* Number of devices being suspended now */ |
65 | 65 | atomic_t sd_count; /* Number of subdomains with power "on" */ |
66 | 66 | enum gpd_status status; /* Current state of the domain */ |
kernel/power/power.h
kernel/power/suspend.c
... | ... | @@ -31,7 +31,7 @@ |
31 | 31 | |
32 | 32 | #include "power.h" |
33 | 33 | |
34 | -static const char *pm_labels[] = { "mem", "standby", "freeze", }; | |
34 | +const char *pm_labels[] = { "mem", "standby", "freeze", NULL }; | |
35 | 35 | const char *pm_states[PM_SUSPEND_MAX]; |
36 | 36 | |
37 | 37 | static const struct platform_suspend_ops *suspend_ops; |
kernel/power/suspend_test.c
... | ... | @@ -129,20 +129,20 @@ |
129 | 129 | * at startup time. They're normally disabled, for faster boot and because |
130 | 130 | * we can't know which states really work on this particular system. |
131 | 131 | */ |
132 | -static suspend_state_t test_state __initdata = PM_SUSPEND_ON; | |
132 | +static const char *test_state_label __initdata; | |
133 | 133 | |
134 | 134 | static char warn_bad_state[] __initdata = |
135 | 135 | KERN_WARNING "PM: can't test '%s' suspend state\n"; |
136 | 136 | |
137 | 137 | static int __init setup_test_suspend(char *value) |
138 | 138 | { |
139 | - suspend_state_t i; | |
139 | + int i; | |
140 | 140 | |
141 | 141 | /* "=mem" ==> "mem" */ |
142 | 142 | value++; |
143 | - for (i = PM_SUSPEND_MIN; i < PM_SUSPEND_MAX; i++) | |
144 | - if (!strcmp(pm_states[i], value)) { | |
145 | - test_state = i; | |
143 | + for (i = 0; pm_labels[i]; i++) | |
144 | + if (!strcmp(pm_labels[i], value)) { | |
145 | + test_state_label = pm_labels[i]; | |
146 | 146 | return 0; |
147 | 147 | } |
148 | 148 | |
149 | 149 | |
150 | 150 | |
... | ... | @@ -158,14 +158,22 @@ |
158 | 158 | |
159 | 159 | struct rtc_device *rtc = NULL; |
160 | 160 | struct device *dev; |
161 | + suspend_state_t test_state; | |
161 | 162 | |
162 | 163 | /* PM is initialized by now; is that state testable? */ |
163 | - if (test_state == PM_SUSPEND_ON) | |
164 | - goto done; | |
165 | - if (!pm_states[test_state]) { | |
166 | - printk(warn_bad_state, pm_states[test_state]); | |
167 | - goto done; | |
164 | + if (!test_state_label) | |
165 | + return 0; | |
166 | + | |
167 | + for (test_state = PM_SUSPEND_MIN; test_state < PM_SUSPEND_MAX; test_state++) { | |
168 | + const char *state_label = pm_states[test_state]; | |
169 | + | |
170 | + if (state_label && !strcmp(test_state_label, state_label)) | |
171 | + break; | |
168 | 172 | } |
173 | + if (test_state == PM_SUSPEND_MAX) { | |
174 | + printk(warn_bad_state, test_state_label); | |
175 | + return 0; | |
176 | + } | |
169 | 177 | |
170 | 178 | /* RTCs have initialized by now too ... can we use one? */ |
171 | 179 | dev = class_find_device(rtc_class, NULL, NULL, has_wakealarm); |
172 | 180 | |
... | ... | @@ -173,13 +181,12 @@ |
173 | 181 | rtc = rtc_class_open(dev_name(dev)); |
174 | 182 | if (!rtc) { |
175 | 183 | printk(warn_no_rtc); |
176 | - goto done; | |
184 | + return 0; | |
177 | 185 | } |
178 | 186 | |
179 | 187 | /* go for it */ |
180 | 188 | test_wakealarm(rtc, test_state); |
181 | 189 | rtc_class_close(rtc); |
182 | -done: | |
183 | 190 | return 0; |
184 | 191 | } |
185 | 192 | late_initcall(test_suspend); |