Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull power management fix from Rafael Wysocki:
"Fix a recently introduced (mostly theoretical) issue that the requests
to confine the maximum CPU frequency coming from the platform firmware
may not be taken into account if multiple CPUs are covered by one
cpufreq policy on a system with ACPI"

* tag 'pm-5.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPI: processor: Add QoS requests for all CPUs

+42 -26
+21 -13
drivers/acpi/processor_perflib.c
··· 159 159 160 160 void acpi_processor_ppc_init(struct cpufreq_policy *policy) 161 161 { 162 - int cpu = policy->cpu; 163 - struct acpi_processor *pr = per_cpu(processors, cpu); 164 - int ret; 162 + unsigned int cpu; 165 163 166 - if (!pr) 167 - return; 164 + for_each_cpu(cpu, policy->related_cpus) { 165 + struct acpi_processor *pr = per_cpu(processors, cpu); 166 + int ret; 168 167 169 - ret = freq_qos_add_request(&policy->constraints, &pr->perflib_req, 170 - FREQ_QOS_MAX, INT_MAX); 171 - if (ret < 0) 172 - pr_err("Failed to add freq constraint for CPU%d (%d)\n", cpu, 173 - ret); 168 + if (!pr) 169 + continue; 170 + 171 + ret = freq_qos_add_request(&policy->constraints, 172 + &pr->perflib_req, 173 + FREQ_QOS_MAX, INT_MAX); 174 + if (ret < 0) 175 + pr_err("Failed to add freq constraint for CPU%d (%d)\n", 176 + cpu, ret); 177 + } 174 178 } 175 179 176 180 void acpi_processor_ppc_exit(struct cpufreq_policy *policy) 177 181 { 178 - struct acpi_processor *pr = per_cpu(processors, policy->cpu); 182 + unsigned int cpu; 179 183 180 - if (pr) 181 - freq_qos_remove_request(&pr->perflib_req); 184 + for_each_cpu(cpu, policy->related_cpus) { 185 + struct acpi_processor *pr = per_cpu(processors, cpu); 186 + 187 + if (pr) 188 + freq_qos_remove_request(&pr->perflib_req); 189 + } 182 190 } 183 191 184 192 static int acpi_processor_get_performance_control(struct acpi_processor *pr)
+21 -13
drivers/acpi/processor_thermal.c
··· 127 127 128 128 void acpi_thermal_cpufreq_init(struct cpufreq_policy *policy) 129 129 { 130 - int cpu = policy->cpu; 131 - struct acpi_processor *pr = per_cpu(processors, cpu); 132 - int ret; 130 + unsigned int cpu; 133 131 134 - if (!pr) 135 - return; 132 + for_each_cpu(cpu, policy->related_cpus) { 133 + struct acpi_processor *pr = per_cpu(processors, cpu); 134 + int ret; 136 135 137 - ret = freq_qos_add_request(&policy->constraints, &pr->thermal_req, 138 - FREQ_QOS_MAX, INT_MAX); 139 - if (ret < 0) 140 - pr_err("Failed to add freq constraint for CPU%d (%d)\n", cpu, 141 - ret); 136 + if (!pr) 137 + continue; 138 + 139 + ret = freq_qos_add_request(&policy->constraints, 140 + &pr->thermal_req, 141 + FREQ_QOS_MAX, INT_MAX); 142 + if (ret < 0) 143 + pr_err("Failed to add freq constraint for CPU%d (%d)\n", 144 + cpu, ret); 145 + } 142 146 } 143 147 144 148 void acpi_thermal_cpufreq_exit(struct cpufreq_policy *policy) 145 149 { 146 - struct acpi_processor *pr = per_cpu(processors, policy->cpu); 150 + unsigned int cpu; 147 151 148 - if (pr) 149 - freq_qos_remove_request(&pr->thermal_req); 152 + for_each_cpu(cpu, policy->related_cpus) { 153 + struct acpi_processor *pr = per_cpu(processors, policy->cpu); 154 + 155 + if (pr) 156 + freq_qos_remove_request(&pr->thermal_req); 157 + } 150 158 } 151 159 #else /* ! CONFIG_CPU_FREQ */ 152 160 static int cpufreq_get_max_state(unsigned int cpu)