Skip to content

Commit 4ec6afd

Browse files
committed
Merge tag 'pm-5.16-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management fixes from Rafael Wysocki: "These fix a CPU hot-add issue in the cpufreq core, fix a comment in the cpufreq core code and update its documentation, and disable the DTPM (Dynamic Thermal Power Management) code for the time being to prevent it from causing issues to appear. Specifics: - Disable DTPM for this cycle to prevent it from causing issues to appear on otherwise functional systems (Daniel Lezcano) - Fix cpufreq sysfs interface failure related to physical CPU hot-add (Xiongfeng Wang) - Fix comment in cpufreq core and update its documentation (Tang Yizhou)" * tag 'pm-5.16-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: powercap: DTPM: Drop unused local variable from init_dtpm() cpufreq: docs: Update core.rst cpufreq: Fix a comment in cpufreq_policy_free powercap/drivers/dtpm: Disable DTPM at boot time cpufreq: Fix get_cpu_device() failure in add_cpu_dev_symlink()
2 parents 757f3e6 + 404c912 commit 4ec6afd

File tree

3 files changed

+10
-15
lines changed

3 files changed

+10
-15
lines changed

Documentation/cpu-freq/core.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ CPUFREQ_POSTCHANGE.
7373
The third argument is a struct cpufreq_freqs with the following
7474
values:
7575

76-
===== ===========================
77-
cpu number of the affected CPU
76+
====== ======================================
77+
policy a pointer to the struct cpufreq_policy
7878
old old frequency
7979
new new frequency
8080
flags flags of the cpufreq driver
81-
===== ===========================
81+
====== ======================================
8282

8383
3. CPUFreq Table Generation with Operating Performance Point (OPP)
8484
==================================================================

drivers/cpufreq/cpufreq.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,10 +1004,9 @@ static struct kobj_type ktype_cpufreq = {
10041004
.release = cpufreq_sysfs_release,
10051005
};
10061006

1007-
static void add_cpu_dev_symlink(struct cpufreq_policy *policy, unsigned int cpu)
1007+
static void add_cpu_dev_symlink(struct cpufreq_policy *policy, unsigned int cpu,
1008+
struct device *dev)
10081009
{
1009-
struct device *dev = get_cpu_device(cpu);
1010-
10111010
if (unlikely(!dev))
10121011
return;
10131012

@@ -1296,8 +1295,9 @@ static void cpufreq_policy_free(struct cpufreq_policy *policy)
12961295

12971296
if (policy->max_freq_req) {
12981297
/*
1299-
* CPUFREQ_CREATE_POLICY notification is sent only after
1300-
* successfully adding max_freq_req request.
1298+
* Remove max_freq_req after sending CPUFREQ_REMOVE_POLICY
1299+
* notification, since CPUFREQ_CREATE_POLICY notification was
1300+
* sent after adding max_freq_req earlier.
13011301
*/
13021302
blocking_notifier_call_chain(&cpufreq_policy_notifier_list,
13031303
CPUFREQ_REMOVE_POLICY, policy);
@@ -1391,7 +1391,7 @@ static int cpufreq_online(unsigned int cpu)
13911391
if (new_policy) {
13921392
for_each_cpu(j, policy->related_cpus) {
13931393
per_cpu(cpufreq_cpu_data, j) = policy;
1394-
add_cpu_dev_symlink(policy, j);
1394+
add_cpu_dev_symlink(policy, j, get_cpu_device(j));
13951395
}
13961396

13971397
policy->min_freq_req = kzalloc(2 * sizeof(*policy->min_freq_req),
@@ -1565,7 +1565,7 @@ static int cpufreq_add_dev(struct device *dev, struct subsys_interface *sif)
15651565
/* Create sysfs link on CPU registration */
15661566
policy = per_cpu(cpufreq_cpu_data, cpu);
15671567
if (policy)
1568-
add_cpu_dev_symlink(policy, cpu);
1568+
add_cpu_dev_symlink(policy, cpu, dev);
15691569

15701570
return 0;
15711571
}

drivers/powercap/dtpm.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -463,17 +463,12 @@ int dtpm_register(const char *name, struct dtpm *dtpm, struct dtpm *parent)
463463

464464
static int __init init_dtpm(void)
465465
{
466-
struct dtpm_descr *dtpm_descr;
467-
468466
pct = powercap_register_control_type(NULL, "dtpm", NULL);
469467
if (IS_ERR(pct)) {
470468
pr_err("Failed to register control type\n");
471469
return PTR_ERR(pct);
472470
}
473471

474-
for_each_dtpm_table(dtpm_descr)
475-
dtpm_descr->init();
476-
477472
return 0;
478473
}
479474
late_initcall(init_dtpm);

0 commit comments

Comments
 (0)