Commit 0cf710f8 authored by Linus Torvalds's avatar Linus Torvalds

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
parents 9c41180b 69810374
...@@ -275,6 +275,7 @@ config BMIPS_CPUFREQ ...@@ -275,6 +275,7 @@ config BMIPS_CPUFREQ
config LOONGSON2_CPUFREQ config LOONGSON2_CPUFREQ
tristate "Loongson2 CPUFreq Driver" tristate "Loongson2 CPUFreq Driver"
depends on LEMOTE_MACH2F
help help
This option adds a CPUFreq driver for loongson processors which This option adds a CPUFreq driver for loongson processors which
support software configurable cpu frequency. support software configurable cpu frequency.
...@@ -287,6 +288,7 @@ config LOONGSON2_CPUFREQ ...@@ -287,6 +288,7 @@ config LOONGSON2_CPUFREQ
config LOONGSON1_CPUFREQ config LOONGSON1_CPUFREQ
tristate "Loongson1 CPUFreq Driver" tristate "Loongson1 CPUFreq Driver"
depends on LOONGSON1_LS1B
help help
This option adds a CPUFreq driver for loongson1 processors which This option adds a CPUFreq driver for loongson1 processors which
support software configurable cpu frequency. support software configurable cpu frequency.
......
...@@ -620,3 +620,7 @@ static int __init mtk_cpufreq_driver_init(void) ...@@ -620,3 +620,7 @@ static int __init mtk_cpufreq_driver_init(void)
return 0; return 0;
} }
device_initcall(mtk_cpufreq_driver_init); device_initcall(mtk_cpufreq_driver_init);
MODULE_DESCRIPTION("MediaTek CPUFreq driver");
MODULE_AUTHOR("Pi-Cheng Chen <pi-cheng.chen@linaro.org>");
MODULE_LICENSE("GPL v2");
...@@ -61,7 +61,7 @@ int set_cpufreq_governor(char *governor, unsigned int cpu) ...@@ -61,7 +61,7 @@ int set_cpufreq_governor(char *governor, unsigned int cpu)
dprintf("set %s as cpufreq governor\n", governor); dprintf("set %s as cpufreq governor\n", governor);
if (cpupower_is_cpu_online(cpu) != 0) { if (cpupower_is_cpu_online(cpu) != 1) {
perror("cpufreq_cpu_exists"); perror("cpufreq_cpu_exists");
fprintf(stderr, "error: cpu %u does not exist\n", cpu); fprintf(stderr, "error: cpu %u does not exist\n", cpu);
return -1; return -1;
......
...@@ -130,15 +130,18 @@ static struct cpuidle_monitor *cpuidle_register(void) ...@@ -130,15 +130,18 @@ static struct cpuidle_monitor *cpuidle_register(void)
{ {
int num; int num;
char *tmp; char *tmp;
int this_cpu;
this_cpu = sched_getcpu();
/* Assume idle state count is the same for all CPUs */ /* Assume idle state count is the same for all CPUs */
cpuidle_sysfs_monitor.hw_states_num = cpuidle_state_count(0); cpuidle_sysfs_monitor.hw_states_num = cpuidle_state_count(this_cpu);
if (cpuidle_sysfs_monitor.hw_states_num <= 0) if (cpuidle_sysfs_monitor.hw_states_num <= 0)
return NULL; return NULL;
for (num = 0; num < cpuidle_sysfs_monitor.hw_states_num; num++) { for (num = 0; num < cpuidle_sysfs_monitor.hw_states_num; num++) {
tmp = cpuidle_state_name(0, num); tmp = cpuidle_state_name(this_cpu, num);
if (tmp == NULL) if (tmp == NULL)
continue; continue;
...@@ -146,7 +149,7 @@ static struct cpuidle_monitor *cpuidle_register(void) ...@@ -146,7 +149,7 @@ static struct cpuidle_monitor *cpuidle_register(void)
strncpy(cpuidle_cstates[num].name, tmp, CSTATE_NAME_LEN - 1); strncpy(cpuidle_cstates[num].name, tmp, CSTATE_NAME_LEN - 1);
free(tmp); free(tmp);
tmp = cpuidle_state_desc(0, num); tmp = cpuidle_state_desc(this_cpu, num);
if (tmp == NULL) if (tmp == NULL)
continue; continue;
strncpy(cpuidle_cstates[num].desc, tmp, CSTATE_DESC_LEN - 1); strncpy(cpuidle_cstates[num].desc, tmp, CSTATE_DESC_LEN - 1);
......
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