diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-11-30 18:45:55 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-11-30 18:45:55 -0500 |
commit | 0cf710f8c6bc210b147b0625ddf2eec8cdb33f43 (patch) | |
tree | 45420f114f2d7e6522318459e2cb2d3146eaf137 | |
parent | 9c41180be47a6c08105894e1289182995749fc9a (diff) | |
parent | 6981037442b05b192504fbc3c165cb240e01f6e2 (diff) |
Merge tag 'pm-4.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management fixes from Rafael Wysocki:
- add missing module information to the Mediatek cpufreq driver module
(Jesse Chan)
- fix config dependencies for the Loongson cpufreq driver (James Hogan)
- fix two issues related to CPU offline in the cpupower utility
(Abhishek Goel).
* tag 'pm-4.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
cpufreq: mediatek: add missing MODULE_DESCRIPTION/AUTHOR/LICENSE
cpufreq: Add Loongson machine dependencies
cpupower : Fix cpupower working when cpu0 is offline
cpupowerutils: bench - Fix cpu online check
-rw-r--r-- | drivers/cpufreq/Kconfig | 2 | ||||
-rw-r--r-- | drivers/cpufreq/mediatek-cpufreq.c | 4 | ||||
-rw-r--r-- | tools/power/cpupower/bench/system.c | 2 | ||||
-rw-r--r-- | tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c | 9 |
4 files changed, 13 insertions, 4 deletions
diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig index 4ebae43118ef..d8addbce40bc 100644 --- a/drivers/cpufreq/Kconfig +++ b/drivers/cpufreq/Kconfig | |||
@@ -275,6 +275,7 @@ config BMIPS_CPUFREQ | |||
275 | 275 | ||
276 | config LOONGSON2_CPUFREQ | 276 | config LOONGSON2_CPUFREQ |
277 | tristate "Loongson2 CPUFreq Driver" | 277 | tristate "Loongson2 CPUFreq Driver" |
278 | depends on LEMOTE_MACH2F | ||
278 | help | 279 | help |
279 | This option adds a CPUFreq driver for loongson processors which | 280 | This option adds a CPUFreq driver for loongson processors which |
280 | support software configurable cpu frequency. | 281 | support software configurable cpu frequency. |
@@ -287,6 +288,7 @@ config LOONGSON2_CPUFREQ | |||
287 | 288 | ||
288 | config LOONGSON1_CPUFREQ | 289 | config LOONGSON1_CPUFREQ |
289 | tristate "Loongson1 CPUFreq Driver" | 290 | tristate "Loongson1 CPUFreq Driver" |
291 | depends on LOONGSON1_LS1B | ||
290 | help | 292 | help |
291 | This option adds a CPUFreq driver for loongson1 processors which | 293 | This option adds a CPUFreq driver for loongson1 processors which |
292 | support software configurable cpu frequency. | 294 | support software configurable cpu frequency. |
diff --git a/drivers/cpufreq/mediatek-cpufreq.c b/drivers/cpufreq/mediatek-cpufreq.c index 18c4bd9a5c65..e0d5090b303d 100644 --- a/drivers/cpufreq/mediatek-cpufreq.c +++ b/drivers/cpufreq/mediatek-cpufreq.c | |||
@@ -620,3 +620,7 @@ static int __init mtk_cpufreq_driver_init(void) | |||
620 | return 0; | 620 | return 0; |
621 | } | 621 | } |
622 | device_initcall(mtk_cpufreq_driver_init); | 622 | device_initcall(mtk_cpufreq_driver_init); |
623 | |||
624 | MODULE_DESCRIPTION("MediaTek CPUFreq driver"); | ||
625 | MODULE_AUTHOR("Pi-Cheng Chen <pi-cheng.chen@linaro.org>"); | ||
626 | MODULE_LICENSE("GPL v2"); | ||
diff --git a/tools/power/cpupower/bench/system.c b/tools/power/cpupower/bench/system.c index c25a74ae51ba..2bb3eef7d5c1 100644 --- a/tools/power/cpupower/bench/system.c +++ b/tools/power/cpupower/bench/system.c | |||
@@ -61,7 +61,7 @@ int set_cpufreq_governor(char *governor, unsigned int cpu) | |||
61 | 61 | ||
62 | dprintf("set %s as cpufreq governor\n", governor); | 62 | dprintf("set %s as cpufreq governor\n", governor); |
63 | 63 | ||
64 | if (cpupower_is_cpu_online(cpu) != 0) { | 64 | if (cpupower_is_cpu_online(cpu) != 1) { |
65 | perror("cpufreq_cpu_exists"); | 65 | perror("cpufreq_cpu_exists"); |
66 | fprintf(stderr, "error: cpu %u does not exist\n", cpu); | 66 | fprintf(stderr, "error: cpu %u does not exist\n", cpu); |
67 | return -1; | 67 | return -1; |
diff --git a/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c b/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c index 1b5da0066ebf..5b3205f16217 100644 --- a/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c +++ b/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c | |||
@@ -130,15 +130,18 @@ static struct cpuidle_monitor *cpuidle_register(void) | |||
130 | { | 130 | { |
131 | int num; | 131 | int num; |
132 | char *tmp; | 132 | char *tmp; |
133 | int this_cpu; | ||
134 | |||
135 | this_cpu = sched_getcpu(); | ||
133 | 136 | ||
134 | /* Assume idle state count is the same for all CPUs */ | 137 | /* Assume idle state count is the same for all CPUs */ |
135 | cpuidle_sysfs_monitor.hw_states_num = cpuidle_state_count(0); | 138 | cpuidle_sysfs_monitor.hw_states_num = cpuidle_state_count(this_cpu); |
136 | 139 | ||
137 | if (cpuidle_sysfs_monitor.hw_states_num <= 0) | 140 | if (cpuidle_sysfs_monitor.hw_states_num <= 0) |
138 | return NULL; | 141 | return NULL; |
139 | 142 | ||
140 | for (num = 0; num < cpuidle_sysfs_monitor.hw_states_num; num++) { | 143 | for (num = 0; num < cpuidle_sysfs_monitor.hw_states_num; num++) { |
141 | tmp = cpuidle_state_name(0, num); | 144 | tmp = cpuidle_state_name(this_cpu, num); |
142 | if (tmp == NULL) | 145 | if (tmp == NULL) |
143 | continue; | 146 | continue; |
144 | 147 | ||
@@ -146,7 +149,7 @@ static struct cpuidle_monitor *cpuidle_register(void) | |||
146 | strncpy(cpuidle_cstates[num].name, tmp, CSTATE_NAME_LEN - 1); | 149 | strncpy(cpuidle_cstates[num].name, tmp, CSTATE_NAME_LEN - 1); |
147 | free(tmp); | 150 | free(tmp); |
148 | 151 | ||
149 | tmp = cpuidle_state_desc(0, num); | 152 | tmp = cpuidle_state_desc(this_cpu, num); |
150 | if (tmp == NULL) | 153 | if (tmp == NULL) |
151 | continue; | 154 | continue; |
152 | strncpy(cpuidle_cstates[num].desc, tmp, CSTATE_DESC_LEN - 1); | 155 | strncpy(cpuidle_cstates[num].desc, tmp, CSTATE_DESC_LEN - 1); |