Skip to content

Commit f55b067

Browse files
committed
Merge tag 'pm-6.14-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull more power management updates from Rafael Wysocki: "These are mostly fixes on top of the previously merged power management material with the addition of some teo cpuidle governor updates, some of which may also be regarded as fixes: - Add missing error handling for syscore_suspend() to the hibernation core code (Wentao Liang) - Revert a commit that added unused macros (Andy Shevchenko) - Synchronize the runtime PM status of devices that were runtime- suspended before a system-wide suspend and need to be resumed during the subsequent system-wide resume transition (Rafael Wysocki) - Clean up the teo cpuidle governor and make the handling of short idle intervals in it consistent regardless of the properties of idle states supplied by the cpuidle driver (Rafael Wysocki) - Fix some boost-related issues in cpufreq (Lifeng Zheng) - Fix build issues in the s3c64xx and airoha cpufreq drivers (Viresh Kumar) - Remove unconditional binding of schedutil governor kthreads to the affected CPUs if the cpufreq driver indicates that updates can happen from any CPU (Christian Loehle)" * tag 'pm-6.14-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: PM: sleep: core: Synchronize runtime PM status of parents and children cpufreq: airoha: Depends on OF PM: Revert "Add EXPORT macros for exporting PM functions" PM: hibernate: Add error handling for syscore_suspend() cpufreq/schedutil: Only bind threads if needed cpufreq: ACPI: Remove set_boost in acpi_cpufreq_cpu_init() cpufreq: CPPC: Fix wrong max_freq in policy initialization cpufreq: Introduce a more generic way to set default per-policy boost flag cpufreq: Fix re-boost issue after hotplugging a CPU cpufreq: s3c64xx: Fix compilation warning cpuidle: teo: Skip sleep length computation for low latency constraints cpuidle: teo: Replace time_span_ns with a flag cpuidle: teo: Simplify handling of total events count cpuidle: teo: Skip getting the sleep length if wakeups are very frequent cpuidle: teo: Simplify counting events used for tick management cpuidle: teo: Clarify two code comments cpuidle: teo: Drop local variable prev_intercept_idx cpuidle: teo: Combine candidate state index checks against 0 cpuidle: teo: Reorder candidate state index checks cpuidle: teo: Rearrange idle state lookup code
2 parents c2933b2 + a01e0f4 commit f55b067

File tree

11 files changed

+162
-132
lines changed

11 files changed

+162
-132
lines changed

drivers/base/power/main.c

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -656,13 +656,15 @@ static void device_resume_noirq(struct device *dev, pm_message_t state, bool asy
656656
* so change its status accordingly.
657657
*
658658
* Otherwise, the device is going to be resumed, so set its PM-runtime
659-
* status to "active", but do that only if DPM_FLAG_SMART_SUSPEND is set
660-
* to avoid confusing drivers that don't use it.
659+
* status to "active" unless its power.set_active flag is clear, in
660+
* which case it is not necessary to update its PM-runtime status.
661661
*/
662-
if (skip_resume)
662+
if (skip_resume) {
663663
pm_runtime_set_suspended(dev);
664-
else if (dev_pm_skip_suspend(dev))
664+
} else if (dev->power.set_active) {
665665
pm_runtime_set_active(dev);
666+
dev->power.set_active = false;
667+
}
666668

667669
if (dev->pm_domain) {
668670
info = "noirq power domain ";
@@ -1189,18 +1191,24 @@ static pm_message_t resume_event(pm_message_t sleep_state)
11891191
return PMSG_ON;
11901192
}
11911193

1192-
static void dpm_superior_set_must_resume(struct device *dev)
1194+
static void dpm_superior_set_must_resume(struct device *dev, bool set_active)
11931195
{
11941196
struct device_link *link;
11951197
int idx;
11961198

1197-
if (dev->parent)
1199+
if (dev->parent) {
11981200
dev->parent->power.must_resume = true;
1201+
if (set_active)
1202+
dev->parent->power.set_active = true;
1203+
}
11991204

12001205
idx = device_links_read_lock();
12011206

1202-
list_for_each_entry_rcu_locked(link, &dev->links.suppliers, c_node)
1207+
list_for_each_entry_rcu_locked(link, &dev->links.suppliers, c_node) {
12031208
link->supplier->power.must_resume = true;
1209+
if (set_active)
1210+
link->supplier->power.set_active = true;
1211+
}
12041212

12051213
device_links_read_unlock(idx);
12061214
}
@@ -1278,8 +1286,11 @@ static int device_suspend_noirq(struct device *dev, pm_message_t state, bool asy
12781286
dev->power.may_skip_resume))
12791287
dev->power.must_resume = true;
12801288

1281-
if (dev->power.must_resume)
1282-
dpm_superior_set_must_resume(dev);
1289+
if (dev->power.must_resume) {
1290+
dev->power.set_active = dev->power.set_active ||
1291+
dev_pm_test_driver_flags(dev, DPM_FLAG_SMART_SUSPEND);
1292+
dpm_superior_set_must_resume(dev, dev->power.set_active);
1293+
}
12831294

12841295
Complete:
12851296
complete_all(&dev->power.completion);

drivers/cpufreq/Kconfig.arm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ config ARM_ALLWINNER_SUN50I_CPUFREQ_NVMEM
1717

1818
config ARM_AIROHA_SOC_CPUFREQ
1919
tristate "Airoha EN7581 SoC CPUFreq support"
20-
depends on ARCH_AIROHA || COMPILE_TEST
20+
depends on (ARCH_AIROHA && OF) || COMPILE_TEST
2121
select PM_OPP
2222
default ARCH_AIROHA
2323
help

drivers/cpufreq/acpi-cpufreq.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -909,11 +909,6 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
909909
if (perf->states[0].core_frequency * 1000 != freq_table[0].frequency)
910910
pr_warn(FW_WARN "P-state 0 is not max freq\n");
911911

912-
if (acpi_cpufreq_driver.set_boost) {
913-
set_boost(policy, acpi_cpufreq_driver.boost_enabled);
914-
policy->boost_enabled = acpi_cpufreq_driver.boost_enabled;
915-
}
916-
917912
return result;
918913

919914
err_unreg:

drivers/cpufreq/cppc_cpufreq.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,15 +611,16 @@ static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy)
611611
* Section 8.4.7.1.1.5 of ACPI 6.1 spec)
612612
*/
613613
policy->min = cppc_perf_to_khz(caps, caps->lowest_nonlinear_perf);
614-
policy->max = cppc_perf_to_khz(caps, caps->nominal_perf);
614+
policy->max = cppc_perf_to_khz(caps, policy->boost_enabled ?
615+
caps->highest_perf : caps->nominal_perf);
615616

616617
/*
617618
* Set cpuinfo.min_freq to Lowest to make the full range of performance
618619
* available if userspace wants to use any perf between lowest & lowest
619620
* nonlinear perf
620621
*/
621622
policy->cpuinfo.min_freq = cppc_perf_to_khz(caps, caps->lowest_perf);
622-
policy->cpuinfo.max_freq = cppc_perf_to_khz(caps, caps->nominal_perf);
623+
policy->cpuinfo.max_freq = policy->max;
623624

624625
policy->transition_delay_us = cppc_cpufreq_get_transition_delay_us(cpu);
625626
policy->shared_type = cpu_data->shared_type;

drivers/cpufreq/cpufreq.c

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,10 +1410,6 @@ static int cpufreq_online(unsigned int cpu)
14101410
goto out_free_policy;
14111411
}
14121412

1413-
/* Let the per-policy boost flag mirror the cpufreq_driver boost during init */
1414-
if (cpufreq_boost_enabled() && policy_has_boost_freq(policy))
1415-
policy->boost_enabled = true;
1416-
14171413
/*
14181414
* The initialization has succeeded and the policy is online.
14191415
* If there is a problem with its frequency table, take it
@@ -1476,6 +1472,10 @@ static int cpufreq_online(unsigned int cpu)
14761472

14771473
blocking_notifier_call_chain(&cpufreq_policy_notifier_list,
14781474
CPUFREQ_CREATE_POLICY, policy);
1475+
} else {
1476+
ret = freq_qos_update_request(policy->max_freq_req, policy->max);
1477+
if (ret < 0)
1478+
goto out_destroy_policy;
14791479
}
14801480

14811481
if (cpufreq_driver->get && has_target()) {
@@ -1570,6 +1570,18 @@ static int cpufreq_online(unsigned int cpu)
15701570
if (new_policy && cpufreq_thermal_control_enabled(cpufreq_driver))
15711571
policy->cdev = of_cpufreq_cooling_register(policy);
15721572

1573+
/* Let the per-policy boost flag mirror the cpufreq_driver boost during init */
1574+
if (policy->boost_enabled != cpufreq_boost_enabled()) {
1575+
policy->boost_enabled = cpufreq_boost_enabled();
1576+
ret = cpufreq_driver->set_boost(policy, policy->boost_enabled);
1577+
if (ret) {
1578+
/* If the set_boost fails, the online operation is not affected */
1579+
pr_info("%s: CPU%d: Cannot %s BOOST\n", __func__, policy->cpu,
1580+
policy->boost_enabled ? "enable" : "disable");
1581+
policy->boost_enabled = !policy->boost_enabled;
1582+
}
1583+
}
1584+
15731585
pr_debug("initialization complete\n");
15741586

15751587
return 0;

drivers/cpufreq/s3c64xx-cpufreq.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@ struct s3c64xx_dvfs {
2424
unsigned int vddarm_max;
2525
};
2626

27+
#ifdef CONFIG_REGULATOR
2728
static struct s3c64xx_dvfs s3c64xx_dvfs_table[] = {
2829
[0] = { 1000000, 1150000 },
2930
[1] = { 1050000, 1150000 },
3031
[2] = { 1100000, 1150000 },
3132
[3] = { 1200000, 1350000 },
3233
[4] = { 1300000, 1350000 },
3334
};
35+
#endif
3436

3537
static struct cpufreq_frequency_table s3c64xx_freq_table[] = {
3638
{ 0, 0, 66000 },
@@ -51,15 +53,16 @@ static struct cpufreq_frequency_table s3c64xx_freq_table[] = {
5153
static int s3c64xx_cpufreq_set_target(struct cpufreq_policy *policy,
5254
unsigned int index)
5355
{
54-
struct s3c64xx_dvfs *dvfs;
55-
unsigned int old_freq, new_freq;
56+
unsigned int new_freq = s3c64xx_freq_table[index].frequency;
5657
int ret;
5758

59+
#ifdef CONFIG_REGULATOR
60+
struct s3c64xx_dvfs *dvfs;
61+
unsigned int old_freq;
62+
5863
old_freq = clk_get_rate(policy->clk) / 1000;
59-
new_freq = s3c64xx_freq_table[index].frequency;
6064
dvfs = &s3c64xx_dvfs_table[s3c64xx_freq_table[index].driver_data];
6165

62-
#ifdef CONFIG_REGULATOR
6366
if (vddarm && new_freq > old_freq) {
6467
ret = regulator_set_voltage(vddarm,
6568
dvfs->vddarm_min,

0 commit comments

Comments
 (0)