blob: 32f0f554ccaed36addf840b24849f990b20c0a88 [file] [log] [blame]
Thomas Gleixnerc942fdd2019-05-27 08:55:06 +02001// SPDX-License-Identifier: GPL-2.0-or-later
Linus Torvalds1da177e2005-04-16 15:20:36 -07002/*
3 * processor_perflib.c - ACPI Processor P-States Library ($Revision: 71 $)
4 *
5 * Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
6 * Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
7 * Copyright (C) 2004 Dominik Brodowski <linux@brodo.de>
8 * Copyright (C) 2004 Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
9 * - Added processor hotplug support
Linus Torvalds1da177e2005-04-16 15:20:36 -070010 */
11
Linus Torvalds1da177e2005-04-16 15:20:36 -070012#include <linux/kernel.h>
13#include <linux/module.h>
14#include <linux/init.h>
15#include <linux/cpufreq.h>
Tejun Heo5a0e3ad2010-03-24 17:04:11 +090016#include <linux/slab.h>
Lv Zheng8b484632013-12-03 08:49:16 +080017#include <linux/acpi.h>
18#include <acpi/processor.h>
Miao Xie16be87e2008-10-24 17:22:04 +080019#ifdef CONFIG_X86
Thomas Renninger910dfae2008-09-01 14:27:04 +020020#include <asm/cpufeature.h>
Miao Xie16be87e2008-10-24 17:22:04 +080021#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070022
Len Browna192a952009-07-28 16:45:54 -040023#define PREFIX "ACPI: "
24
Linus Torvalds1da177e2005-04-16 15:20:36 -070025#define ACPI_PROCESSOR_FILE_PERFORMANCE "performance"
26#define _COMPONENT ACPI_PROCESSOR_COMPONENT
Len Brownf52fd662007-02-12 22:42:12 -050027ACPI_MODULE_NAME("processor_perflib");
Linus Torvalds1da177e2005-04-16 15:20:36 -070028
Arjan van de Ven65c19bb2006-04-27 05:25:00 -040029static DEFINE_MUTEX(performance_mutex);
Linus Torvalds1da177e2005-04-16 15:20:36 -070030
31/*
32 * _PPC support is implemented as a CPUfreq policy notifier:
33 * This means each time a CPUfreq driver registered also with
34 * the ACPI core is asked to change the speed policy, the maximum
35 * value is adjusted so that it is within the platform limit.
36 *
37 * Also, when a new platform limit value is detected, the CPUfreq
38 * policy is adjusted accordingly.
39 */
40
Thomas Renningera1531ac2008-07-29 22:32:58 -070041/* ignore_ppc:
42 * -1 -> cpufreq low level drivers not initialized -> _PSS, etc. not called yet
43 * ignore _PPC
44 * 0 -> cpufreq low level drivers initialized -> consider _PPC values
45 * 1 -> ignore _PPC totally -> forced by user through boot param
46 */
Milan Broz9f497bc2008-08-12 17:48:27 +020047static int ignore_ppc = -1;
Milan Broz613e5f32008-08-16 02:11:28 +020048module_param(ignore_ppc, int, 0644);
Thomas Renninger623b78c2007-05-18 21:59:28 -050049MODULE_PARM_DESC(ignore_ppc, "If the frequency of your machine gets wrongly" \
50 "limited by BIOS, this should help");
51
Viresh Kumard15ce412019-08-28 14:20:13 +053052static bool acpi_processor_ppc_in_use;
Linus Torvalds1da177e2005-04-16 15:20:36 -070053
Len Brown4be44fc2005-08-05 00:44:28 -040054static int acpi_processor_get_platform_limit(struct acpi_processor *pr)
Linus Torvalds1da177e2005-04-16 15:20:36 -070055{
Len Brown4be44fc2005-08-05 00:44:28 -040056 acpi_status status = 0;
Matthew Wilcox27663c52008-10-10 02:22:59 -040057 unsigned long long ppc = 0;
Viresh Kumard15ce412019-08-28 14:20:13 +053058 int ret;
Linus Torvalds1da177e2005-04-16 15:20:36 -070059
60 if (!pr)
Patrick Mocheld550d982006-06-27 00:41:40 -040061 return -EINVAL;
Linus Torvalds1da177e2005-04-16 15:20:36 -070062
63 /*
64 * _PPC indicates the maximum state currently supported by the platform
65 * (e.g. 0 = states 0..n; 1 = states 1..n; etc.
66 */
67 status = acpi_evaluate_integer(pr->handle, "_PPC", NULL, &ppc);
68
69 if (status != AE_NOT_FOUND)
Viresh Kumard15ce412019-08-28 14:20:13 +053070 acpi_processor_ppc_in_use = true;
Linus Torvalds1da177e2005-04-16 15:20:36 -070071
Len Brown4be44fc2005-08-05 00:44:28 -040072 if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
Thomas Renningera6fc6722006-06-26 23:58:43 -040073 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PPC"));
Patrick Mocheld550d982006-06-27 00:41:40 -040074 return -ENODEV;
Linus Torvalds1da177e2005-04-16 15:20:36 -070075 }
76
Dominik Brodowski2d06d8c2011-03-27 15:04:46 +020077 pr_debug("CPU %d: _PPC is %d - frequency %s limited\n", pr->id,
Thomas Renninger919158d2007-10-31 15:41:42 +010078 (int)ppc, ppc ? "" : "not");
79
Len Brown4be44fc2005-08-05 00:44:28 -040080 pr->performance_platform_limit = (int)ppc;
Linus Torvalds1da177e2005-04-16 15:20:36 -070081
Viresh Kumard15ce412019-08-28 14:20:13 +053082 if (ppc >= pr->performance->state_count ||
Rafael J. Wysocki3000ce32019-10-16 12:47:06 +020083 unlikely(!freq_qos_request_active(&pr->perflib_req)))
Viresh Kumard15ce412019-08-28 14:20:13 +053084 return 0;
85
Rafael J. Wysocki3000ce32019-10-16 12:47:06 +020086 ret = freq_qos_update_request(&pr->perflib_req,
Viresh Kumard15ce412019-08-28 14:20:13 +053087 pr->performance->states[ppc].core_frequency * 1000);
88 if (ret < 0) {
89 pr_warn("Failed to update perflib freq constraint: CPU%d (%d)\n",
90 pr->id, ret);
91 }
92
Patrick Mocheld550d982006-06-27 00:41:40 -040093 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -070094}
95
Zhao Yakuid81c45e12009-10-16 09:20:41 +080096#define ACPI_PROCESSOR_NOTIFY_PERFORMANCE 0x80
97/*
98 * acpi_processor_ppc_ost: Notify firmware the _PPC evaluation status
99 * @handle: ACPI processor handle
100 * @status: the status code of _PPC evaluation
101 * 0: success. OSPM is now using the performance state specificed.
102 * 1: failure. OSPM has not changed the number of P-states in use
103 */
104static void acpi_processor_ppc_ost(acpi_handle handle, int status)
105{
Jiang Liu4a6172a2014-02-19 14:02:18 +0800106 if (acpi_has_method(handle, "_OST"))
107 acpi_evaluate_ost(handle, ACPI_PROCESSOR_NOTIFY_PERFORMANCE,
108 status, NULL);
Zhao Yakuid81c45e12009-10-16 09:20:41 +0800109}
110
Rafael J. Wysockibca5f552016-11-18 13:57:54 +0100111void acpi_processor_ppc_has_changed(struct acpi_processor *pr, int event_flag)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700112{
Thomas Renninger623b78c2007-05-18 21:59:28 -0500113 int ret;
114
Chen Yuba1edb92018-01-29 10:26:46 +0800115 if (ignore_ppc || !pr->performance) {
Zhao Yakuid81c45e12009-10-16 09:20:41 +0800116 /*
117 * Only when it is notification event, the _OST object
118 * will be evaluated. Otherwise it is skipped.
119 */
120 if (event_flag)
121 acpi_processor_ppc_ost(pr->handle, 1);
Rafael J. Wysockibca5f552016-11-18 13:57:54 +0100122 return;
Zhao Yakuid81c45e12009-10-16 09:20:41 +0800123 }
Thomas Renninger623b78c2007-05-18 21:59:28 -0500124
125 ret = acpi_processor_get_platform_limit(pr);
Zhao Yakuid81c45e12009-10-16 09:20:41 +0800126 /*
127 * Only when it is notification event, the _OST object
128 * will be evaluated. Otherwise it is skipped.
129 */
130 if (event_flag) {
131 if (ret < 0)
132 acpi_processor_ppc_ost(pr->handle, 1);
133 else
134 acpi_processor_ppc_ost(pr->handle, 0);
135 }
Rafael J. Wysockibca5f552016-11-18 13:57:54 +0100136 if (ret >= 0)
Rafael J. Wysocki5a25e3f2019-03-26 12:15:13 +0100137 cpufreq_update_limits(pr->id);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700138}
139
Thomas Renningere2f74f32009-11-19 12:31:01 +0100140int acpi_processor_get_bios_limit(int cpu, unsigned int *limit)
141{
142 struct acpi_processor *pr;
143
144 pr = per_cpu(processors, cpu);
145 if (!pr || !pr->performance || !pr->performance->state_count)
146 return -ENODEV;
147 *limit = pr->performance->states[pr->performance_platform_limit].
148 core_frequency * 1000;
149 return 0;
150}
151EXPORT_SYMBOL(acpi_processor_get_bios_limit);
152
Viresh Kumard15ce412019-08-28 14:20:13 +0530153void acpi_processor_ignore_ppc_init(void)
Len Brown4be44fc2005-08-05 00:44:28 -0400154{
Viresh Kumard15ce412019-08-28 14:20:13 +0530155 if (ignore_ppc < 0)
156 ignore_ppc = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700157}
158
Rafael J. Wysocki3000ce32019-10-16 12:47:06 +0200159void acpi_processor_ppc_init(struct cpufreq_policy *policy)
Len Brown4be44fc2005-08-05 00:44:28 -0400160{
Rafael J. Wysockia1bb46c2019-10-25 02:41:40 +0200161 unsigned int cpu;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700162
Rafael J. Wysockia1bb46c2019-10-25 02:41:40 +0200163 for_each_cpu(cpu, policy->related_cpus) {
164 struct acpi_processor *pr = per_cpu(processors, cpu);
165 int ret;
Rafael J. Wysocki2d8b39a2019-10-15 19:35:20 +0200166
Rafael J. Wysockia1bb46c2019-10-25 02:41:40 +0200167 if (!pr)
168 continue;
169
170 ret = freq_qos_add_request(&policy->constraints,
171 &pr->perflib_req,
172 FREQ_QOS_MAX, INT_MAX);
173 if (ret < 0)
174 pr_err("Failed to add freq constraint for CPU%d (%d)\n",
175 cpu, ret);
176 }
Viresh Kumard15ce412019-08-28 14:20:13 +0530177}
178
Rafael J. Wysocki3000ce32019-10-16 12:47:06 +0200179void acpi_processor_ppc_exit(struct cpufreq_policy *policy)
Viresh Kumard15ce412019-08-28 14:20:13 +0530180{
Rafael J. Wysockia1bb46c2019-10-25 02:41:40 +0200181 unsigned int cpu;
Viresh Kumard15ce412019-08-28 14:20:13 +0530182
Rafael J. Wysockia1bb46c2019-10-25 02:41:40 +0200183 for_each_cpu(cpu, policy->related_cpus) {
184 struct acpi_processor *pr = per_cpu(processors, cpu);
185
186 if (pr)
187 freq_qos_remove_request(&pr->perflib_req);
188 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700189}
190
Len Brown4be44fc2005-08-05 00:44:28 -0400191static int acpi_processor_get_performance_control(struct acpi_processor *pr)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700192{
Len Brown4be44fc2005-08-05 00:44:28 -0400193 int result = 0;
194 acpi_status status = 0;
195 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
196 union acpi_object *pct = NULL;
197 union acpi_object obj = { 0 };
Linus Torvalds1da177e2005-04-16 15:20:36 -0700198
Linus Torvalds1da177e2005-04-16 15:20:36 -0700199
200 status = acpi_evaluate_object(pr->handle, "_PCT", NULL, &buffer);
Len Brown4be44fc2005-08-05 00:44:28 -0400201 if (ACPI_FAILURE(status)) {
Thomas Renningera6fc6722006-06-26 23:58:43 -0400202 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PCT"));
Patrick Mocheld550d982006-06-27 00:41:40 -0400203 return -ENODEV;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700204 }
205
Len Brown4be44fc2005-08-05 00:44:28 -0400206 pct = (union acpi_object *)buffer.pointer;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700207 if (!pct || (pct->type != ACPI_TYPE_PACKAGE)
Len Brown4be44fc2005-08-05 00:44:28 -0400208 || (pct->package.count != 2)) {
Len Brown64684632006-06-26 23:41:38 -0400209 printk(KERN_ERR PREFIX "Invalid _PCT data\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700210 result = -EFAULT;
211 goto end;
212 }
213
214 /*
215 * control_register
216 */
217
218 obj = pct->package.elements[0];
219
220 if ((obj.type != ACPI_TYPE_BUFFER)
Len Brown4be44fc2005-08-05 00:44:28 -0400221 || (obj.buffer.length < sizeof(struct acpi_pct_register))
222 || (obj.buffer.pointer == NULL)) {
Len Brown64684632006-06-26 23:41:38 -0400223 printk(KERN_ERR PREFIX "Invalid _PCT data (control_register)\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700224 result = -EFAULT;
225 goto end;
226 }
Len Brown4be44fc2005-08-05 00:44:28 -0400227 memcpy(&pr->performance->control_register, obj.buffer.pointer,
228 sizeof(struct acpi_pct_register));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700229
230 /*
231 * status_register
232 */
233
234 obj = pct->package.elements[1];
235
236 if ((obj.type != ACPI_TYPE_BUFFER)
Len Brown4be44fc2005-08-05 00:44:28 -0400237 || (obj.buffer.length < sizeof(struct acpi_pct_register))
238 || (obj.buffer.pointer == NULL)) {
Len Brown64684632006-06-26 23:41:38 -0400239 printk(KERN_ERR PREFIX "Invalid _PCT data (status_register)\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700240 result = -EFAULT;
241 goto end;
242 }
243
Len Brown4be44fc2005-08-05 00:44:28 -0400244 memcpy(&pr->performance->status_register, obj.buffer.pointer,
245 sizeof(struct acpi_pct_register));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700246
Len Brown4be44fc2005-08-05 00:44:28 -0400247 end:
Len Brown02438d82006-06-30 03:19:10 -0400248 kfree(buffer.pointer);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700249
Patrick Mocheld550d982006-06-27 00:41:40 -0400250 return result;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700251}
252
Matthew Garrettf5940652012-09-04 08:28:06 +0000253#ifdef CONFIG_X86
254/*
255 * Some AMDs have 50MHz frequency multiples, but only provide 100MHz rounding
256 * in their ACPI data. Calculate the real values and fix up the _PSS data.
257 */
258static void amd_fixup_frequency(struct acpi_processor_px *px, int i)
259{
260 u32 hi, lo, fid, did;
261 int index = px->control & 0x00000007;
262
263 if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD)
264 return;
265
266 if ((boot_cpu_data.x86 == 0x10 && boot_cpu_data.x86_model < 10)
267 || boot_cpu_data.x86 == 0x11) {
268 rdmsr(MSR_AMD_PSTATE_DEF_BASE + index, lo, hi);
Stefan Bader9855d8c2013-01-22 13:37:21 +0100269 /*
270 * MSR C001_0064+:
271 * Bit 63: PstateEn. Read-write. If set, the P-state is valid.
272 */
273 if (!(hi & BIT(31)))
274 return;
275
Matthew Garrettf5940652012-09-04 08:28:06 +0000276 fid = lo & 0x3f;
277 did = (lo >> 6) & 7;
278 if (boot_cpu_data.x86 == 0x10)
279 px->core_frequency = (100 * (fid + 0x10)) >> did;
280 else
281 px->core_frequency = (100 * (fid + 8)) >> did;
282 }
283}
284#else
285static void amd_fixup_frequency(struct acpi_processor_px *px, int i) {};
286#endif
287
Len Brown4be44fc2005-08-05 00:44:28 -0400288static int acpi_processor_get_performance_states(struct acpi_processor *pr)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700289{
Len Brown4be44fc2005-08-05 00:44:28 -0400290 int result = 0;
291 acpi_status status = AE_OK;
292 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
293 struct acpi_buffer format = { sizeof("NNNNNN"), "NNNNNN" };
294 struct acpi_buffer state = { 0, NULL };
295 union acpi_object *pss = NULL;
296 int i;
Marco Aurelio da Costad8e725f2012-05-04 18:53:44 +0200297 int last_invalid = -1;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700298
Linus Torvalds1da177e2005-04-16 15:20:36 -0700299
300 status = acpi_evaluate_object(pr->handle, "_PSS", NULL, &buffer);
Len Brown4be44fc2005-08-05 00:44:28 -0400301 if (ACPI_FAILURE(status)) {
Thomas Renningera6fc6722006-06-26 23:58:43 -0400302 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PSS"));
Patrick Mocheld550d982006-06-27 00:41:40 -0400303 return -ENODEV;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700304 }
305
Jan Engelhardt50dd0962006-10-01 00:28:50 +0200306 pss = buffer.pointer;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700307 if (!pss || (pss->type != ACPI_TYPE_PACKAGE)) {
Len Brown64684632006-06-26 23:41:38 -0400308 printk(KERN_ERR PREFIX "Invalid _PSS data\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700309 result = -EFAULT;
310 goto end;
311 }
312
313 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found %d performance states\n",
Len Brown4be44fc2005-08-05 00:44:28 -0400314 pss->package.count));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700315
316 pr->performance->state_count = pss->package.count;
Len Brown4be44fc2005-08-05 00:44:28 -0400317 pr->performance->states =
Kees Cook6da2ec52018-06-12 13:55:00 -0700318 kmalloc_array(pss->package.count,
319 sizeof(struct acpi_processor_px),
320 GFP_KERNEL);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700321 if (!pr->performance->states) {
322 result = -ENOMEM;
323 goto end;
324 }
325
326 for (i = 0; i < pr->performance->state_count; i++) {
327
328 struct acpi_processor_px *px = &(pr->performance->states[i]);
329
330 state.length = sizeof(struct acpi_processor_px);
331 state.pointer = px;
332
333 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Extracting state %d\n", i));
334
335 status = acpi_extract_package(&(pss->package.elements[i]),
Len Brown4be44fc2005-08-05 00:44:28 -0400336 &format, &state);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700337 if (ACPI_FAILURE(status)) {
Thomas Renningera6fc6722006-06-26 23:58:43 -0400338 ACPI_EXCEPTION((AE_INFO, status, "Invalid _PSS data"));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700339 result = -EFAULT;
340 kfree(pr->performance->states);
341 goto end;
342 }
343
Matthew Garrettf5940652012-09-04 08:28:06 +0000344 amd_fixup_frequency(px, i);
345
Linus Torvalds1da177e2005-04-16 15:20:36 -0700346 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
Len Brown4be44fc2005-08-05 00:44:28 -0400347 "State [%d]: core_frequency[%d] power[%d] transition_latency[%d] bus_master_latency[%d] control[0x%x] status[0x%x]\n",
348 i,
349 (u32) px->core_frequency,
350 (u32) px->power,
351 (u32) px->transition_latency,
352 (u32) px->bus_master_latency,
353 (u32) px->control, (u32) px->status));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700354
Len Brown34d531e2009-05-26 15:11:06 -0400355 /*
Maximilian Luzc6237b22020-11-05 03:06:00 +0100356 * Check that ACPI's u64 MHz will be valid as u32 KHz in cpufreq
Len Brown34d531e2009-05-26 15:11:06 -0400357 */
358 if (!px->core_frequency ||
359 ((u32)(px->core_frequency * 1000) !=
360 (px->core_frequency * 1000))) {
361 printk(KERN_ERR FW_BUG PREFIX
Marco Aurelio da Costad8e725f2012-05-04 18:53:44 +0200362 "Invalid BIOS _PSS frequency found for processor %d: 0x%llx MHz\n",
363 pr->id, px->core_frequency);
364 if (last_invalid == -1)
365 last_invalid = i;
366 } else {
367 if (last_invalid != -1) {
368 /*
369 * Copy this valid entry over last_invalid entry
370 */
371 memcpy(&(pr->performance->states[last_invalid]),
372 px, sizeof(struct acpi_processor_px));
373 ++last_invalid;
374 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700375 }
376 }
377
Marco Aurelio da Costad8e725f2012-05-04 18:53:44 +0200378 if (last_invalid == 0) {
379 printk(KERN_ERR FW_BUG PREFIX
380 "No valid BIOS _PSS frequency found for processor %d\n", pr->id);
381 result = -EFAULT;
382 kfree(pr->performance->states);
383 pr->performance->states = NULL;
384 }
385
386 if (last_invalid > 0)
387 pr->performance->state_count = last_invalid;
388
Len Brown4be44fc2005-08-05 00:44:28 -0400389 end:
Len Brown02438d82006-06-30 03:19:10 -0400390 kfree(buffer.pointer);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700391
Patrick Mocheld550d982006-06-27 00:41:40 -0400392 return result;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700393}
394
Konrad Rzeszutek Wilkc705c782013-03-05 13:42:54 -0500395int acpi_processor_get_performance_info(struct acpi_processor *pr)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700396{
Len Brown4be44fc2005-08-05 00:44:28 -0400397 int result = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700398
Linus Torvalds1da177e2005-04-16 15:20:36 -0700399 if (!pr || !pr->performance || !pr->handle)
Patrick Mocheld550d982006-06-27 00:41:40 -0400400 return -EINVAL;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700401
Jiang Liu952c63e2013-06-29 00:24:38 +0800402 if (!acpi_has_method(pr->handle, "_PCT")) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700403 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
Len Brown4be44fc2005-08-05 00:44:28 -0400404 "ACPI-based processor performance control unavailable\n"));
Patrick Mocheld550d982006-06-27 00:41:40 -0400405 return -ENODEV;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700406 }
407
408 result = acpi_processor_get_performance_control(pr);
409 if (result)
Thomas Renninger910dfae2008-09-01 14:27:04 +0200410 goto update_bios;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700411
412 result = acpi_processor_get_performance_states(pr);
413 if (result)
Thomas Renninger910dfae2008-09-01 14:27:04 +0200414 goto update_bios;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700415
Darrick J. Wong455c0d72010-02-18 10:28:20 -0800416 /* We need to call _PPC once when cpufreq starts */
417 if (ignore_ppc != 1)
418 result = acpi_processor_get_platform_limit(pr);
419
420 return result;
Thomas Renninger910dfae2008-09-01 14:27:04 +0200421
422 /*
423 * Having _PPC but missing frequencies (_PSS, _PCT) is a very good hint that
424 * the BIOS is older than the CPU and does not know its frequencies
425 */
426 update_bios:
Miao Xie16be87e2008-10-24 17:22:04 +0800427#ifdef CONFIG_X86
Jiang Liu952c63e2013-06-29 00:24:38 +0800428 if (acpi_has_method(pr->handle, "_PPC")) {
Thomas Renninger910dfae2008-09-01 14:27:04 +0200429 if(boot_cpu_has(X86_FEATURE_EST))
430 printk(KERN_WARNING FW_BUG "BIOS needs update for CPU "
431 "frequency support\n");
432 }
Miao Xie16be87e2008-10-24 17:22:04 +0800433#endif
Thomas Renninger910dfae2008-09-01 14:27:04 +0200434 return result;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700435}
Konrad Rzeszutek Wilkc705c782013-03-05 13:42:54 -0500436EXPORT_SYMBOL_GPL(acpi_processor_get_performance_info);
Rafael J. Wysockid0ea59e2016-11-17 22:47:47 +0100437
438int acpi_processor_pstate_control(void)
Len Brown4be44fc2005-08-05 00:44:28 -0400439{
440 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700441
Rafael J. Wysockid0ea59e2016-11-17 22:47:47 +0100442 if (!acpi_gbl_FADT.smi_command || !acpi_gbl_FADT.pstate_control)
443 return 0;
444
445 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
446 "Writing pstate_control [0x%x] to smi_command [0x%x]\n",
447 acpi_gbl_FADT.pstate_control, acpi_gbl_FADT.smi_command));
448
449 status = acpi_os_write_port(acpi_gbl_FADT.smi_command,
450 (u32)acpi_gbl_FADT.pstate_control, 8);
451 if (ACPI_SUCCESS(status))
452 return 1;
453
454 ACPI_EXCEPTION((AE_INFO, status,
455 "Failed to write pstate_control [0x%x] to smi_command [0x%x]",
456 acpi_gbl_FADT.pstate_control, acpi_gbl_FADT.smi_command));
457 return -EIO;
458}
459
460int acpi_processor_notify_smm(struct module *calling_module)
461{
462 static int is_done = 0;
463 int result;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700464
Viresh Kumard15ce412019-08-28 14:20:13 +0530465 if (!acpi_processor_cpufreq_init)
Patrick Mocheld550d982006-06-27 00:41:40 -0400466 return -EBUSY;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700467
468 if (!try_module_get(calling_module))
Patrick Mocheld550d982006-06-27 00:41:40 -0400469 return -EINVAL;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700470
Lucas De Marchi58f87ed2010-09-07 12:49:45 -0400471 /* is_done is set to negative if an error occurred,
472 * and to postitive if _no_ error occurred, but SMM
Linus Torvalds1da177e2005-04-16 15:20:36 -0700473 * was already notified. This avoids double notification
474 * which might lead to unexpected results...
475 */
476 if (is_done > 0) {
477 module_put(calling_module);
Patrick Mocheld550d982006-06-27 00:41:40 -0400478 return 0;
Len Brown4be44fc2005-08-05 00:44:28 -0400479 } else if (is_done < 0) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700480 module_put(calling_module);
Patrick Mocheld550d982006-06-27 00:41:40 -0400481 return is_done;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700482 }
483
484 is_done = -EIO;
485
Rafael J. Wysockid0ea59e2016-11-17 22:47:47 +0100486 result = acpi_processor_pstate_control();
487 if (!result) {
Alexey Starikovskiyad71860a2007-02-02 19:48:19 +0300488 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No SMI port or pstate_control\n"));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700489 module_put(calling_module);
Patrick Mocheld550d982006-06-27 00:41:40 -0400490 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700491 }
Rafael J. Wysockid0ea59e2016-11-17 22:47:47 +0100492 if (result < 0) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700493 module_put(calling_module);
Rafael J. Wysockid0ea59e2016-11-17 22:47:47 +0100494 return result;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700495 }
496
497 /* Success. If there's no _PPC, we need to fear nothing, so
498 * we can allow the cpufreq driver to be rmmod'ed. */
499 is_done = 1;
500
Viresh Kumard15ce412019-08-28 14:20:13 +0530501 if (!acpi_processor_ppc_in_use)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700502 module_put(calling_module);
503
Patrick Mocheld550d982006-06-27 00:41:40 -0400504 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700505}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700506
Len Brown4be44fc2005-08-05 00:44:28 -0400507EXPORT_SYMBOL(acpi_processor_notify_smm);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700508
Joao Martins4d0f1ce2018-03-15 14:22:05 +0000509int acpi_processor_get_psd(acpi_handle handle, struct acpi_psd_package *pdomain)
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500510{
511 int result = 0;
512 acpi_status status = AE_OK;
513 struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
514 struct acpi_buffer format = {sizeof("NNNNN"), "NNNNN"};
515 struct acpi_buffer state = {0, NULL};
516 union acpi_object *psd = NULL;
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500517
Joao Martins4d0f1ce2018-03-15 14:22:05 +0000518 status = acpi_evaluate_object(handle, "_PSD", NULL, &buffer);
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500519 if (ACPI_FAILURE(status)) {
Len Brown9011bff42006-05-11 00:28:12 -0400520 return -ENODEV;
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500521 }
522
Jan Engelhardt50dd0962006-10-01 00:28:50 +0200523 psd = buffer.pointer;
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500524 if (!psd || (psd->type != ACPI_TYPE_PACKAGE)) {
Lin Ming55ac9a02008-09-28 14:51:56 +0800525 printk(KERN_ERR PREFIX "Invalid _PSD data\n");
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500526 result = -EFAULT;
527 goto end;
528 }
529
530 if (psd->package.count != 1) {
Lin Ming55ac9a02008-09-28 14:51:56 +0800531 printk(KERN_ERR PREFIX "Invalid _PSD data\n");
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500532 result = -EFAULT;
533 goto end;
534 }
535
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500536 state.length = sizeof(struct acpi_psd_package);
537 state.pointer = pdomain;
538
539 status = acpi_extract_package(&(psd->package.elements[0]),
540 &format, &state);
541 if (ACPI_FAILURE(status)) {
Lin Ming55ac9a02008-09-28 14:51:56 +0800542 printk(KERN_ERR PREFIX "Invalid _PSD data\n");
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500543 result = -EFAULT;
544 goto end;
545 }
546
547 if (pdomain->num_entries != ACPI_PSD_REV0_ENTRIES) {
Lin Ming55ac9a02008-09-28 14:51:56 +0800548 printk(KERN_ERR PREFIX "Unknown _PSD:num_entries\n");
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500549 result = -EFAULT;
550 goto end;
551 }
552
553 if (pdomain->revision != ACPI_PSD_REV0_REVISION) {
Lin Ming55ac9a02008-09-28 14:51:56 +0800554 printk(KERN_ERR PREFIX "Unknown _PSD:revision\n");
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500555 result = -EFAULT;
556 goto end;
557 }
558
Stanislaw Gruszkae1eb4772009-03-24 13:41:59 +0100559 if (pdomain->coord_type != DOMAIN_COORD_TYPE_SW_ALL &&
560 pdomain->coord_type != DOMAIN_COORD_TYPE_SW_ANY &&
561 pdomain->coord_type != DOMAIN_COORD_TYPE_HW_ALL) {
562 printk(KERN_ERR PREFIX "Invalid _PSD:coord_type\n");
563 result = -EFAULT;
564 goto end;
565 }
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500566end:
Len Brown02438d82006-06-30 03:19:10 -0400567 kfree(buffer.pointer);
Len Brown9011bff42006-05-11 00:28:12 -0400568 return result;
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500569}
Joao Martins4d0f1ce2018-03-15 14:22:05 +0000570EXPORT_SYMBOL(acpi_processor_get_psd);
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500571
572int acpi_processor_preregister_performance(
Tejun Heoa29d8b82010-02-02 14:39:15 +0900573 struct acpi_processor_performance __percpu *performance)
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500574{
Lan Tianyu09d5ca82013-06-25 10:06:45 +0800575 int count_target;
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500576 int retval = 0;
577 unsigned int i, j;
Rusty Russell2fdf66b2008-12-31 18:08:47 -0800578 cpumask_var_t covered_cpus;
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500579 struct acpi_processor *pr;
580 struct acpi_psd_package *pdomain;
581 struct acpi_processor *match_pr;
582 struct acpi_psd_package *match_pdomain;
583
Li Zefan79f55992009-06-15 14:58:26 +0800584 if (!zalloc_cpumask_var(&covered_cpus, GFP_KERNEL))
Rusty Russell2fdf66b2008-12-31 18:08:47 -0800585 return -ENOMEM;
586
Len Brown785fccc2006-06-15 22:19:31 -0400587 mutex_lock(&performance_mutex);
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500588
Stanislaw Gruszkae1eb4772009-03-24 13:41:59 +0100589 /*
590 * Check if another driver has already registered, and abort before
591 * changing pr->performance if it has. Check input data as well.
592 */
KAMEZAWA Hiroyuki193de0c2006-04-27 05:25:00 -0400593 for_each_possible_cpu(i) {
Mike Travis706546d2008-06-09 16:22:23 -0700594 pr = per_cpu(processors, i);
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500595 if (!pr) {
596 /* Look only at processors in ACPI namespace */
597 continue;
598 }
599
600 if (pr->performance) {
601 retval = -EBUSY;
Stanislaw Gruszkae1eb4772009-03-24 13:41:59 +0100602 goto err_out;
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500603 }
604
Rusty Russellb36128c2009-02-20 16:29:08 +0900605 if (!performance || !per_cpu_ptr(performance, i)) {
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500606 retval = -EINVAL;
Stanislaw Gruszkae1eb4772009-03-24 13:41:59 +0100607 goto err_out;
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500608 }
Stanislaw Gruszkae1eb4772009-03-24 13:41:59 +0100609 }
610
611 /* Call _PSD for all CPUs */
612 for_each_possible_cpu(i) {
613 pr = per_cpu(processors, i);
614 if (!pr)
615 continue;
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500616
Rusty Russellb36128c2009-02-20 16:29:08 +0900617 pr->performance = per_cpu_ptr(performance, i);
Joao Martins4d0f1ce2018-03-15 14:22:05 +0000618 pdomain = &(pr->performance->domain_info);
619 if (acpi_processor_get_psd(pr->handle, pdomain)) {
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500620 retval = -EINVAL;
621 continue;
622 }
623 }
624 if (retval)
625 goto err_ret;
626
627 /*
Maximilian Luzc6237b22020-11-05 03:06:00 +0100628 * Now that we have _PSD data from all CPUs, lets setup P-state
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500629 * domain info.
630 */
KAMEZAWA Hiroyuki193de0c2006-04-27 05:25:00 -0400631 for_each_possible_cpu(i) {
Mike Travis706546d2008-06-09 16:22:23 -0700632 pr = per_cpu(processors, i);
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500633 if (!pr)
634 continue;
635
Rusty Russell2fdf66b2008-12-31 18:08:47 -0800636 if (cpumask_test_cpu(i, covered_cpus))
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500637 continue;
638
639 pdomain = &(pr->performance->domain_info);
Rusty Russell2fdf66b2008-12-31 18:08:47 -0800640 cpumask_set_cpu(i, pr->performance->shared_cpu_map);
641 cpumask_set_cpu(i, covered_cpus);
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500642 if (pdomain->num_processors <= 1)
643 continue;
644
645 /* Validate the Domain info */
646 count_target = pdomain->num_processors;
Venkatesh Pallipadi46f18e32006-06-26 00:34:43 -0400647 if (pdomain->coord_type == DOMAIN_COORD_TYPE_SW_ALL)
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500648 pr->performance->shared_type = CPUFREQ_SHARED_TYPE_ALL;
Venkatesh Pallipadi46f18e32006-06-26 00:34:43 -0400649 else if (pdomain->coord_type == DOMAIN_COORD_TYPE_HW_ALL)
650 pr->performance->shared_type = CPUFREQ_SHARED_TYPE_HW;
651 else if (pdomain->coord_type == DOMAIN_COORD_TYPE_SW_ANY)
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500652 pr->performance->shared_type = CPUFREQ_SHARED_TYPE_ANY;
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500653
KAMEZAWA Hiroyuki193de0c2006-04-27 05:25:00 -0400654 for_each_possible_cpu(j) {
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500655 if (i == j)
656 continue;
657
Mike Travis706546d2008-06-09 16:22:23 -0700658 match_pr = per_cpu(processors, j);
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500659 if (!match_pr)
660 continue;
661
662 match_pdomain = &(match_pr->performance->domain_info);
663 if (match_pdomain->domain != pdomain->domain)
664 continue;
665
666 /* Here i and j are in the same domain */
667
668 if (match_pdomain->num_processors != count_target) {
669 retval = -EINVAL;
670 goto err_ret;
671 }
672
673 if (pdomain->coord_type != match_pdomain->coord_type) {
674 retval = -EINVAL;
675 goto err_ret;
676 }
677
Rusty Russell2fdf66b2008-12-31 18:08:47 -0800678 cpumask_set_cpu(j, covered_cpus);
679 cpumask_set_cpu(j, pr->performance->shared_cpu_map);
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500680 }
681
KAMEZAWA Hiroyuki193de0c2006-04-27 05:25:00 -0400682 for_each_possible_cpu(j) {
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500683 if (i == j)
684 continue;
685
Mike Travis706546d2008-06-09 16:22:23 -0700686 match_pr = per_cpu(processors, j);
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500687 if (!match_pr)
688 continue;
689
690 match_pdomain = &(match_pr->performance->domain_info);
691 if (match_pdomain->domain != pdomain->domain)
692 continue;
693
Maximilian Luzc6237b22020-11-05 03:06:00 +0100694 match_pr->performance->shared_type =
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500695 pr->performance->shared_type;
Rusty Russell2fdf66b2008-12-31 18:08:47 -0800696 cpumask_copy(match_pr->performance->shared_cpu_map,
697 pr->performance->shared_cpu_map);
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500698 }
699 }
700
701err_ret:
KAMEZAWA Hiroyuki193de0c2006-04-27 05:25:00 -0400702 for_each_possible_cpu(i) {
Mike Travis706546d2008-06-09 16:22:23 -0700703 pr = per_cpu(processors, i);
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500704 if (!pr || !pr->performance)
705 continue;
706
707 /* Assume no coordination on any error parsing domain info */
708 if (retval) {
Rusty Russell2fdf66b2008-12-31 18:08:47 -0800709 cpumask_clear(pr->performance->shared_cpu_map);
710 cpumask_set_cpu(i, pr->performance->shared_cpu_map);
Ionela Voinescubca3e432020-12-14 12:07:40 +0000711 pr->performance->shared_type = CPUFREQ_SHARED_TYPE_NONE;
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500712 }
713 pr->performance = NULL; /* Will be set for real in register */
714 }
715
Stanislaw Gruszkae1eb4772009-03-24 13:41:59 +0100716err_out:
Len Brown785fccc2006-06-15 22:19:31 -0400717 mutex_unlock(&performance_mutex);
Rusty Russell2fdf66b2008-12-31 18:08:47 -0800718 free_cpumask_var(covered_cpus);
Len Brown9011bff42006-05-11 00:28:12 -0400719 return retval;
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500720}
721EXPORT_SYMBOL(acpi_processor_preregister_performance);
722
Linus Torvalds1da177e2005-04-16 15:20:36 -0700723int
Len Brown4be44fc2005-08-05 00:44:28 -0400724acpi_processor_register_performance(struct acpi_processor_performance
725 *performance, unsigned int cpu)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700726{
727 struct acpi_processor *pr;
728
Viresh Kumard15ce412019-08-28 14:20:13 +0530729 if (!acpi_processor_cpufreq_init)
Patrick Mocheld550d982006-06-27 00:41:40 -0400730 return -EINVAL;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700731
Arjan van de Ven65c19bb2006-04-27 05:25:00 -0400732 mutex_lock(&performance_mutex);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700733
Mike Travis706546d2008-06-09 16:22:23 -0700734 pr = per_cpu(processors, cpu);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700735 if (!pr) {
Arjan van de Ven65c19bb2006-04-27 05:25:00 -0400736 mutex_unlock(&performance_mutex);
Patrick Mocheld550d982006-06-27 00:41:40 -0400737 return -ENODEV;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700738 }
739
740 if (pr->performance) {
Arjan van de Ven65c19bb2006-04-27 05:25:00 -0400741 mutex_unlock(&performance_mutex);
Patrick Mocheld550d982006-06-27 00:41:40 -0400742 return -EBUSY;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700743 }
744
Andrew Mortona913f502006-06-10 09:54:13 -0700745 WARN_ON(!performance);
746
Linus Torvalds1da177e2005-04-16 15:20:36 -0700747 pr->performance = performance;
748
749 if (acpi_processor_get_performance_info(pr)) {
750 pr->performance = NULL;
Arjan van de Ven65c19bb2006-04-27 05:25:00 -0400751 mutex_unlock(&performance_mutex);
Patrick Mocheld550d982006-06-27 00:41:40 -0400752 return -EIO;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700753 }
754
Arjan van de Ven65c19bb2006-04-27 05:25:00 -0400755 mutex_unlock(&performance_mutex);
Patrick Mocheld550d982006-06-27 00:41:40 -0400756 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700757}
Len Brown4be44fc2005-08-05 00:44:28 -0400758
Linus Torvalds1da177e2005-04-16 15:20:36 -0700759EXPORT_SYMBOL(acpi_processor_register_performance);
760
Rafael J. Wysockib2f8dc42015-07-22 22:11:16 +0200761void acpi_processor_unregister_performance(unsigned int cpu)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700762{
763 struct acpi_processor *pr;
764
Arjan van de Ven65c19bb2006-04-27 05:25:00 -0400765 mutex_lock(&performance_mutex);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700766
Mike Travis706546d2008-06-09 16:22:23 -0700767 pr = per_cpu(processors, cpu);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700768 if (!pr) {
Arjan van de Ven65c19bb2006-04-27 05:25:00 -0400769 mutex_unlock(&performance_mutex);
Patrick Mocheld550d982006-06-27 00:41:40 -0400770 return;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700771 }
772
Andrew Mortona913f502006-06-10 09:54:13 -0700773 if (pr->performance)
774 kfree(pr->performance->states);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700775 pr->performance = NULL;
776
Arjan van de Ven65c19bb2006-04-27 05:25:00 -0400777 mutex_unlock(&performance_mutex);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700778
Patrick Mocheld550d982006-06-27 00:41:40 -0400779 return;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700780}
Len Brown4be44fc2005-08-05 00:44:28 -0400781
Linus Torvalds1da177e2005-04-16 15:20:36 -0700782EXPORT_SYMBOL(acpi_processor_unregister_performance);