Skip to content

Commit 0cf710f

Browse files
committed
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
2 parents 9c41180 + 6981037 commit 0cf710f

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

drivers/cpufreq/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ config BMIPS_CPUFREQ
275275

276276
config LOONGSON2_CPUFREQ
277277
tristate "Loongson2 CPUFreq Driver"
278+
depends on LEMOTE_MACH2F
278279
help
279280
This option adds a CPUFreq driver for loongson processors which
280281
support software configurable cpu frequency.
@@ -287,6 +288,7 @@ config LOONGSON2_CPUFREQ
287288

288289
config LOONGSON1_CPUFREQ
289290
tristate "Loongson1 CPUFreq Driver"
291+
depends on LOONGSON1_LS1B
290292
help
291293
This option adds a CPUFreq driver for loongson1 processors which
292294
support software configurable cpu frequency.

drivers/cpufreq/mediatek-cpufreq.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,3 +620,7 @@ static int __init mtk_cpufreq_driver_init(void)
620620
return 0;
621621
}
622622
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");

tools/power/cpupower/bench/system.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ int set_cpufreq_governor(char *governor, unsigned int cpu)
6161

6262
dprintf("set %s as cpufreq governor\n", governor);
6363

64-
if (cpupower_is_cpu_online(cpu) != 0) {
64+
if (cpupower_is_cpu_online(cpu) != 1) {
6565
perror("cpufreq_cpu_exists");
6666
fprintf(stderr, "error: cpu %u does not exist\n", cpu);
6767
return -1;

tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,23 +130,26 @@ static struct cpuidle_monitor *cpuidle_register(void)
130130
{
131131
int num;
132132
char *tmp;
133+
int this_cpu;
134+
135+
this_cpu = sched_getcpu();
133136

134137
/* 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);
136139

137140
if (cpuidle_sysfs_monitor.hw_states_num <= 0)
138141
return NULL;
139142

140143
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);
142145
if (tmp == NULL)
143146
continue;
144147

145148
fix_up_intel_idle_driver_name(tmp, num);
146149
strncpy(cpuidle_cstates[num].name, tmp, CSTATE_NAME_LEN - 1);
147150
free(tmp);
148151

149-
tmp = cpuidle_state_desc(0, num);
152+
tmp = cpuidle_state_desc(this_cpu, num);
150153
if (tmp == NULL)
151154
continue;
152155
strncpy(cpuidle_cstates[num].desc, tmp, CSTATE_DESC_LEN - 1);

0 commit comments

Comments
 (0)