Skip to content

Commit a3b11c7

Browse files
committed
Merge tag 'pm+acpi-4.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull more power management and ACPI fixes from Rafael Wysocki: "These fix one recent regression (cpufreq core), fix up two features added recently (ACPI CPPC support, SCPI support in the arm_big_little cpufreq driver) and fix three older bugs in the intel_pstate driver. Specifics: - Fix a recent regression in the cpufreq core causing it to fail to clean up sysfs directories properly on cpufreq driver removal (Viresh Kumar). - Fix a build problem in the SCPI support code recently added to the arm_big_little cpufreq driver (Punit Agrawal). - Fix up the recently added CPPC cpufreq frontend to process the CPU coordination information provided by the platform firmware correctly (Ashwin Chaugule). - Fix the intel_pstate driver to behave as intended when switched over to the "performance" mode via sysfs if hardware-driven P-state selection (HWP) is enabled (Alexandra Yates). - Fix two rounding errors in the intel_pstate driver that sometimes cause it to use lower P-states than requested (Prarit Bhargava)" * tag 'pm+acpi-4.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: intel_pstate: Fix "performance" mode behavior with HWP enabled cpufreq: SCPI: Depend on SCPI clk driver cpufreq: intel_pstate: Fix limits->max_perf rounding error cpufreq: intel_pstate: Fix limits->max_policy_pct rounding error cpufreq: Always remove sysfs cpuX/cpufreq link on ->remove_dev() cpufreq: CPPC: Initialize and check CPUFreq CPU co-ord type correctly
2 parents 1724734 + f28a1b0 commit a3b11c7

4 files changed

Lines changed: 10 additions & 8 deletions

File tree

drivers/cpufreq/Kconfig.arm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ config ARM_SA1110_CPUFREQ
202202

203203
config ARM_SCPI_CPUFREQ
204204
tristate "SCPI based CPUfreq driver"
205-
depends on ARM_BIG_LITTLE_CPUFREQ && ARM_SCPI_PROTOCOL
205+
depends on ARM_BIG_LITTLE_CPUFREQ && ARM_SCPI_PROTOCOL && COMMON_CLK_SCPI
206206
help
207207
This adds the CPUfreq driver support for ARM big.LITTLE platforms
208208
using SCPI protocol for CPU power management.

drivers/cpufreq/cppc_cpufreq.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,11 @@ static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy)
9898
policy->max = cpu->perf_caps.highest_perf;
9999
policy->cpuinfo.min_freq = policy->min;
100100
policy->cpuinfo.max_freq = policy->max;
101+
policy->shared_type = cpu->shared_type;
101102

102103
if (policy->shared_type == CPUFREQ_SHARED_TYPE_ANY)
103104
cpumask_copy(policy->cpus, cpu->shared_cpu_map);
104-
else {
105+
else if (policy->shared_type == CPUFREQ_SHARED_TYPE_ALL) {
105106
/* Support only SW_ANY for now. */
106107
pr_debug("Unsupported CPU co-ord type\n");
107108
return -EFAULT;

drivers/cpufreq/cpufreq.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,13 +1401,10 @@ static void cpufreq_remove_dev(struct device *dev, struct subsys_interface *sif)
14011401
}
14021402

14031403
cpumask_clear_cpu(cpu, policy->real_cpus);
1404+
remove_cpu_dev_symlink(policy, cpu);
14041405

1405-
if (cpumask_empty(policy->real_cpus)) {
1406+
if (cpumask_empty(policy->real_cpus))
14061407
cpufreq_policy_free(policy, true);
1407-
return;
1408-
}
1409-
1410-
remove_cpu_dev_symlink(policy, cpu);
14111408
}
14121409

14131410
static void handle_update(struct work_struct *work)

drivers/cpufreq/intel_pstate.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1101,14 +1101,17 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy)
11011101
policy->max >= policy->cpuinfo.max_freq) {
11021102
pr_debug("intel_pstate: set performance\n");
11031103
limits = &performance_limits;
1104+
if (hwp_active)
1105+
intel_pstate_hwp_set();
11041106
return 0;
11051107
}
11061108

11071109
pr_debug("intel_pstate: set powersave\n");
11081110
limits = &powersave_limits;
11091111
limits->min_policy_pct = (policy->min * 100) / policy->cpuinfo.max_freq;
11101112
limits->min_policy_pct = clamp_t(int, limits->min_policy_pct, 0 , 100);
1111-
limits->max_policy_pct = (policy->max * 100) / policy->cpuinfo.max_freq;
1113+
limits->max_policy_pct = DIV_ROUND_UP(policy->max * 100,
1114+
policy->cpuinfo.max_freq);
11121115
limits->max_policy_pct = clamp_t(int, limits->max_policy_pct, 0 , 100);
11131116

11141117
/* Normalize user input to [min_policy_pct, max_policy_pct] */
@@ -1120,6 +1123,7 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy)
11201123
limits->max_sysfs_pct);
11211124
limits->max_perf_pct = max(limits->min_policy_pct,
11221125
limits->max_perf_pct);
1126+
limits->max_perf = round_up(limits->max_perf, 8);
11231127

11241128
/* Make sure min_perf_pct <= max_perf_pct */
11251129
limits->min_perf_pct = min(limits->max_perf_pct, limits->min_perf_pct);

0 commit comments

Comments
 (0)