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
1460 1460
1461 intel_pstate_clear_update_util_hook(policy->cpu);1461 intel_pstate_clear_update_util_hook(policy->cpu);
1462 1462
1463 pr_debug("set_policy cpuinfo.max %u policy->max %u\n",
1464 policy->cpuinfo.max_freq, policy->max);
1465
1463 cpu = all_cpu_data[0];1466 cpu = all_cpu_data[0];
1464 if (cpu->pstate.max_pstate_physical > cpu->pstate.max_pstate &&1467 if (cpu->pstate.max_pstate_physical > cpu->pstate.max_pstate &&
1465 policy->max < policy->cpuinfo.max_freq &&1468 policy->max < policy->cpuinfo.max_freq &&
@@ -1495,13 +1498,13 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy) · 29 unmodified lines
1495 limits->max_sysfs_pct);1498 limits->max_sysfs_pct);
1496 limits->max_perf_pct = max(limits->min_policy_pct,1499 limits->max_perf_pct = max(limits->min_policy_pct,
1497 limits->max_perf_pct);1500 limits->max_perf_pct);
1498 limits->max_perf = round_up(limits->max_perf, FRAC_BITS);
1499 1501
1500 /* Make sure min_perf_pct <= max_perf_pct */1502 /* Make sure min_perf_pct <= max_perf_pct */
1501 limits->min_perf_pct = min(limits->max_perf_pct, limits->min_perf_pct);1503 limits->min_perf_pct = min(limits->max_perf_pct, limits->min_perf_pct);
1502 1504
1503 limits->min_perf = div_fp(limits->min_perf_pct, 100);1505 limits->min_perf = div_fp(limits->min_perf_pct, 100);
1504 limits->max_perf = div_fp(limits->max_perf_pct, 100);1506 limits->max_perf = div_fp(limits->max_perf_pct, 100);
1507 limits->max_perf = round_up(limits->max_perf, FRAC_BITS);
1505 1508
1506 out:1509 out:
1507 intel_pstate_set_update_util_hook(policy->cpu);1510 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
1558 1561
1559 /* cpuinfo and default policy values */1562 /* cpuinfo and default policy values */
1560 policy->cpuinfo.min_freq = cpu->pstate.min_pstate * cpu->pstate.scaling;1563 policy->cpuinfo.min_freq = cpu->pstate.min_pstate * cpu->pstate.scaling;
1561 policy->cpuinfo.max_freq =1564 update_turbo_state();
1562 cpu->pstate.turbo_pstate * cpu->pstate.scaling;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
1563 intel_pstate_init_acpi_perf_limits(policy);1569 intel_pstate_init_acpi_perf_limits(policy);
1564 policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;1570 policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
1565 cpumask_set_cpu(policy->cpu, policy->cpus);1571 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
152extern int cpuidle_play_dead(void);152extern int cpuidle_play_dead(void);
153 153
154extern struct cpuidle_driver *cpuidle_get_cpu_driver(struct cpuidle_device *dev);154extern struct cpuidle_driver *cpuidle_get_cpu_driver(struct cpuidle_device *dev);
155static inline struct cpuidle_device *cpuidle_get_device(void)
156{return __this_cpu_read(cpuidle_devices); }
155#else157#else
156static inline void disable_cpuidle(void) { }158static inline void disable_cpuidle(void) { }
157static inline bool cpuidle_not_available(struct cpuidle_driver *drv,159static 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
187static inline int cpuidle_play_dead(void) {return -ENODEV; }189static inline int cpuidle_play_dead(void) {return -ENODEV; }
188static inline struct cpuidle_driver *cpuidle_get_cpu_driver(190static inline struct cpuidle_driver *cpuidle_get_cpu_driver(
189 struct cpuidle_device *dev) {return NULL; }191 struct cpuidle_device *dev) {return NULL; }
192static inline struct cpuidle_device *cpuidle_get_device(void) {return NULL; }
190#endif193#endif
191 194
192#if defined(CONFIG_CPU_IDLE) && defined(CONFIG_SUSPEND)195#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
127 */127 */
128static void cpuidle_idle_call(void)128static void cpuidle_idle_call(void)
129{129{
130 struct cpuidle_device *dev = __this_cpu_read(cpuidle_devices);130 struct cpuidle_device *dev = cpuidle_get_device();
131 struct cpuidle_driver *drv = cpuidle_get_cpu_driver(dev);131 struct cpuidle_driver *drv = cpuidle_get_cpu_driver(dev);
132 int next_state, entered_state;132 int next_state, entered_state;
133 133

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