History

Merge tag 'pm-4.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management fixes from Rafael Wysocki: "Stable-candidate fixes for the intel_pstate driver and the cpuidle core. Specifics: - Fix two intel_pstate initialization issues, one of which was introduced during the 4.4 cycle (Srinivas Pandruvada) - Fix kernel build with CONFIG_UBSAN set and CONFIG_CPU_IDLE unset (Catalin Marinas)" * tag 'pm-4.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: cpufreq: intel_pstate: Fix ->set_policy() interface for no_turbo cpufreq: intel_pstate: Fix code ordering in intel_pstate_set_policy() cpuidle: Do not access cpuidle_devices when !CONFIG_CPU_IDLE

Linus Torvalds committed 10 years ago

Commit 524a3f22 parents 9557c3c 36811963 files · +13 −4Browse files

Unified · Split

3 files
  1. drivers/cpufreq/intel_pstate.c +9 −3
  2. include/linux/cpuidle.h +3 −0
  3. kernel/sched/idle.c +1 −1
drivers/cpufreq/intel_pstate.c+9−3
@@ -1460,6 +1460,9 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy) · 1459 unmodified lines
14601460
14611461 intel_pstate_clear_update_util_hook(policy->cpu);
14621462
1463+ pr_debug("set_policy cpuinfo.max %u policy->max %u\n",
1464+ policy->cpuinfo.max_freq, policy->max);
1465+
14631466 cpu = all_cpu_data[0];
14641467 if (cpu->pstate.max_pstate_physical > cpu->pstate.max_pstate &&
14651468 policy->max < policy->cpuinfo.max_freq &&
@@ -1495,13 +1498,13 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy) · 29 unmodified lines
14951498 limits->max_sysfs_pct);
14961499 limits->max_perf_pct = max(limits->min_policy_pct,
14971500 limits->max_perf_pct);
1498− limits->max_perf = round_up(limits->max_perf, FRAC_BITS);
14991501
15001502 /* Make sure min_perf_pct <= max_perf_pct */
15011503 limits->min_perf_pct = min(limits->max_perf_pct, limits->min_perf_pct);
15021504
15031505 limits->min_perf = div_fp(limits->min_perf_pct, 100);
15041506 limits->max_perf = div_fp(limits->max_perf_pct, 100);
1507+ limits->max_perf = round_up(limits->max_perf, FRAC_BITS);
15051508
15061509 out:
15071510 intel_pstate_set_update_util_hook(policy->cpu);
@@ -1558,8 +1561,11 @@ static int intel_pstate_cpu_init(struct cpufreq_policy *policy) · 50 unmodified lines
15581561
15591562 /* cpuinfo and default policy values */
15601563 policy->cpuinfo.min_freq = cpu->pstate.min_pstate * cpu->pstate.scaling;
1561− policy->cpuinfo.max_freq =
1562− cpu->pstate.turbo_pstate * cpu->pstate.scaling;
1564+ update_turbo_state();
1565+ policy->cpuinfo.max_freq = limits->turbo_disabled ?
1566+ cpu->pstate.max_pstate : cpu->pstate.turbo_pstate;
1567+ policy->cpuinfo.max_freq *= cpu->pstate.scaling;
1568+
15631569 intel_pstate_init_acpi_perf_limits(policy);
15641570 policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
15651571 cpumask_set_cpu(policy->cpu, policy->cpus);
include/linux/cpuidle.h+3−0
@@ -152,6 +152,8 @@ extern void cpuidle_disable_device(struct cpuidle_device *dev); · 151 unmodified lines
152152 extern int cpuidle_play_dead(void);
153153
154154 extern struct cpuidle_driver *cpuidle_get_cpu_driver(struct cpuidle_device *dev);
155+static inline struct cpuidle_device *cpuidle_get_device(void)
156+{return __this_cpu_read(cpuidle_devices); }
155157 #else
156158 static inline void disable_cpuidle(void) { }
157159 static inline bool cpuidle_not_available(struct cpuidle_driver *drv,
@@ -187,6 +189,7 @@ static inline void cpuidle_disable_device(struct cpuidle_device *dev) { } · 29 unmodified lines
187189 static inline int cpuidle_play_dead(void) {return -ENODEV; }
188190 static inline struct cpuidle_driver *cpuidle_get_cpu_driver(
189191 struct cpuidle_device *dev) {return NULL; }
192+static inline struct cpuidle_device *cpuidle_get_device(void) {return NULL; }
190193 #endif
191194
192195 #if defined(CONFIG_CPU_IDLE) && defined(CONFIG_SUSPEND)
kernel/sched/idle.c+1−1
@@ -127,7 +127,7 @@ static int call_cpuidle(struct cpuidle_driver *drv, struct cpuidle_device *dev, · 126 unmodified lines
127127 */
128128 static void cpuidle_idle_call(void)
129129 {
130− struct cpuidle_device *dev = __this_cpu_read(cpuidle_devices);
130+ struct cpuidle_device *dev = cpuidle_get_device();
131131 struct cpuidle_driver *drv = cpuidle_get_cpu_driver(dev);
132132 int next_state, entered_state;
133133

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t