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()
Unified · Split
| @@ -73,12 +73,12 @@ CPUFREQ_POSTCHANGE. · 72 unmodified lines | |||
| 73 | The third argument is a struct cpufreq_freqs with the following | 73 | The third argument is a struct cpufreq_freqs with the following |
| 74 | values: | 74 | values: |
| 75 | 75 | ||
| 76 | ===== =========================== | 76 | ====== ====================================== |
| 77 | cpu number of the affected CPU | 77 | policy a pointer to the struct cpufreq_policy |
| 78 | old old frequency | 78 | old old frequency |
| 79 | new new frequency | 79 | new new frequency |
| 80 | flags flags of the cpufreq driver | 80 | flags flags of the cpufreq driver |
| 81 | ===== =========================== | 81 | ====== ====================================== |
| 82 | 82 | ||
| 83 | 3. CPUFreq Table Generation with Operating Performance Point (OPP) | 83 | 3. CPUFreq Table Generation with Operating Performance Point (OPP) |
| 84 | ================================================================== | 84 | ================================================================== |
| @@ -1004,10 +1004,9 @@ static struct kobj_type ktype_cpufreq = { · 1003 unmodified lines | |||
| 1004 | .release = cpufreq_sysfs_release, | 1004 | .release = cpufreq_sysfs_release, |
| 1005 | }; | 1005 | }; |
| 1006 | 1006 | ||
| 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) | ||
| 1008 | { | 1009 | { |
| 1009 | struct device *dev = get_cpu_device(cpu); | ||
| 1010 | |||
| 1011 | if (unlikely(!dev)) | 1010 | if (unlikely(!dev)) |
| 1012 | return; | 1011 | return; |
| 1013 | 1012 | ||
| @@ -1296,8 +1295,9 @@ static void cpufreq_policy_free(struct cpufreq_policy *policy) · 282 unmodified lines | |||
| 1296 | 1295 | ||
| 1297 | if (policy->max_freq_req) { | 1296 | if (policy->max_freq_req) { |
| 1298 | /* | 1297 | /* |
| 1299 | * CPUFREQ_CREATE_POLICY notification is sent only after | 1298 | * Remove max_freq_req after sending CPUFREQ_REMOVE_POLICY |
| 1300 | * successfully adding max_freq_req request. | 1299 | * notification, since CPUFREQ_CREATE_POLICY notification was |
| 1300 | * sent after adding max_freq_req earlier. | ||
| 1301 | */ | 1301 | */ |
| 1302 | blocking_notifier_call_chain(&cpufreq_policy_notifier_list, | 1302 | blocking_notifier_call_chain(&cpufreq_policy_notifier_list, |
| 1303 | CPUFREQ_REMOVE_POLICY, policy); | 1303 | CPUFREQ_REMOVE_POLICY, policy); |
| @@ -1391,7 +1391,7 @@ static int cpufreq_online(unsigned int cpu) · 87 unmodified lines | |||
| 1391 | if (new_policy) { | 1391 | if (new_policy) { |
| 1392 | for_each_cpu(j, policy->related_cpus) { | 1392 | for_each_cpu(j, policy->related_cpus) { |
| 1393 | per_cpu(cpufreq_cpu_data, j) = policy; | 1393 | 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)); |
| 1395 | } | 1395 | } |
| 1396 | 1396 | ||
| 1397 | policy->min_freq_req = kzalloc(2 * sizeof(*policy->min_freq_req), | 1397 | 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) · 167 unmodified lines | |||
| 1565 | /* Create sysfs link on CPU registration */ | 1565 | /* Create sysfs link on CPU registration */ |
| 1566 | policy = per_cpu(cpufreq_cpu_data, cpu); | 1566 | policy = per_cpu(cpufreq_cpu_data, cpu); |
| 1567 | if (policy) | 1567 | if (policy) |
| 1568 | add_cpu_dev_symlink(policy, cpu); | 1568 | add_cpu_dev_symlink(policy, cpu, dev); |
| 1569 | 1569 | ||
| 1570 | return 0; | 1570 | return 0; |
| 1571 | } | 1571 | } |
| @@ -463,17 +463,12 @@ int dtpm_register(const char *name, struct dtpm *dtpm, struct dtpm *parent) · 462 unmodified lines | |||
| 463 | 463 | ||
| 464 | static int __init init_dtpm(void) | 464 | static int __init init_dtpm(void) |
| 465 | { | 465 | { |
| 466 | struct dtpm_descr *dtpm_descr; | ||
| 467 | |||
| 468 | pct = powercap_register_control_type(NULL, "dtpm", NULL); | 466 | pct = powercap_register_control_type(NULL, "dtpm", NULL); |
| 469 | if (IS_ERR(pct)) { | 467 | if (IS_ERR(pct)) { |
| 470 | pr_err("Failed to register control type\n"); | 468 | pr_err("Failed to register control type\n"); |
| 471 | return PTR_ERR(pct); | 469 | return PTR_ERR(pct); |
| 472 | } | 470 | } |
| 473 | 471 | ||
| 474 | for_each_dtpm_table(dtpm_descr) | ||
| 475 | dtpm_descr->init(); | ||
| 476 | |||
| 477 | return 0; | 472 | return 0; |
| 478 | } | 473 | } |
| 479 | late_initcall(init_dtpm); | 474 | late_initcall(init_dtpm); |