blob: f0b4a981b8d38250f4954b7ef26d2edba5c8b2e1 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * processor_perflib.c - ACPI Processor P-States Library ($Revision: 71 $)
3 *
4 * Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
5 * Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
6 * Copyright (C) 2004 Dominik Brodowski <linux@brodo.de>
7 * Copyright (C) 2004 Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
8 * - Added processor hotplug support
9 *
10 *
11 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or (at
16 * your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * General Public License for more details.
22 *
Linus Torvalds1da177e2005-04-16 15:20:36 -070023 */
24
Linus Torvalds1da177e2005-04-16 15:20:36 -070025#include <linux/kernel.h>
26#include <linux/module.h>
27#include <linux/init.h>
28#include <linux/cpufreq.h>
Tejun Heo5a0e3ad2010-03-24 17:04:11 +090029#include <linux/slab.h>
Lv Zheng8b484632013-12-03 08:49:16 +080030#include <linux/acpi.h>
31#include <acpi/processor.h>
Miao Xie16be87e2008-10-24 17:22:04 +080032#ifdef CONFIG_X86
Thomas Renninger910dfae2008-09-01 14:27:04 +020033#include <asm/cpufeature.h>
Miao Xie16be87e2008-10-24 17:22:04 +080034#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070035
Len Browna192a952009-07-28 16:45:54 -040036#define PREFIX "ACPI: "
37
Linus Torvalds1da177e2005-04-16 15:20:36 -070038#define ACPI_PROCESSOR_CLASS "processor"
Linus Torvalds1da177e2005-04-16 15:20:36 -070039#define ACPI_PROCESSOR_FILE_PERFORMANCE "performance"
40#define _COMPONENT ACPI_PROCESSOR_COMPONENT
Len Brownf52fd662007-02-12 22:42:12 -050041ACPI_MODULE_NAME("processor_perflib");
Linus Torvalds1da177e2005-04-16 15:20:36 -070042
Arjan van de Ven65c19bb2006-04-27 05:25:00 -040043static DEFINE_MUTEX(performance_mutex);
Linus Torvalds1da177e2005-04-16 15:20:36 -070044
45/*
46 * _PPC support is implemented as a CPUfreq policy notifier:
47 * This means each time a CPUfreq driver registered also with
48 * the ACPI core is asked to change the speed policy, the maximum
49 * value is adjusted so that it is within the platform limit.
50 *
51 * Also, when a new platform limit value is detected, the CPUfreq
52 * policy is adjusted accordingly.
53 */
54
Thomas Renningera1531ac2008-07-29 22:32:58 -070055/* ignore_ppc:
56 * -1 -> cpufreq low level drivers not initialized -> _PSS, etc. not called yet
57 * ignore _PPC
58 * 0 -> cpufreq low level drivers initialized -> consider _PPC values
59 * 1 -> ignore _PPC totally -> forced by user through boot param
60 */
Milan Broz9f497bc2008-08-12 17:48:27 +020061static int ignore_ppc = -1;
Milan Broz613e5f32008-08-16 02:11:28 +020062module_param(ignore_ppc, int, 0644);
Thomas Renninger623b78c2007-05-18 21:59:28 -050063MODULE_PARM_DESC(ignore_ppc, "If the frequency of your machine gets wrongly" \
64 "limited by BIOS, this should help");
65
Linus Torvalds1da177e2005-04-16 15:20:36 -070066#define PPC_REGISTERED 1
67#define PPC_IN_USE 2
68
Thomas Renningera1531ac2008-07-29 22:32:58 -070069static int acpi_processor_ppc_status;
Linus Torvalds1da177e2005-04-16 15:20:36 -070070
71static int acpi_processor_ppc_notifier(struct notifier_block *nb,
Len Brown4be44fc2005-08-05 00:44:28 -040072 unsigned long event, void *data)
Linus Torvalds1da177e2005-04-16 15:20:36 -070073{
74 struct cpufreq_policy *policy = data;
75 struct acpi_processor *pr;
76 unsigned int ppc = 0;
77
Thomas Renningera1531ac2008-07-29 22:32:58 -070078 if (event == CPUFREQ_START && ignore_ppc <= 0) {
79 ignore_ppc = 0;
80 return 0;
81 }
82
Thomas Renninger623b78c2007-05-18 21:59:28 -050083 if (ignore_ppc)
84 return 0;
85
Viresh Kumar6bfb7c72015-08-03 08:36:14 +053086 if (event != CPUFREQ_ADJUST)
Thomas Renninger9b67c5d2008-07-29 22:32:59 -070087 return 0;
88
89 mutex_lock(&performance_mutex);
Linus Torvalds1da177e2005-04-16 15:20:36 -070090
Mike Travis706546d2008-06-09 16:22:23 -070091 pr = per_cpu(processors, policy->cpu);
Linus Torvalds1da177e2005-04-16 15:20:36 -070092 if (!pr || !pr->performance)
93 goto out;
94
Len Brown4be44fc2005-08-05 00:44:28 -040095 ppc = (unsigned int)pr->performance_platform_limit;
Linus Torvalds1da177e2005-04-16 15:20:36 -070096
Dave Jones0916bd32006-11-22 20:42:01 -050097 if (ppc >= pr->performance->state_count)
Linus Torvalds1da177e2005-04-16 15:20:36 -070098 goto out;
99
100 cpufreq_verify_within_limits(policy, 0,
Len Brown4be44fc2005-08-05 00:44:28 -0400101 pr->performance->states[ppc].
102 core_frequency * 1000);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700103
Len Brown4be44fc2005-08-05 00:44:28 -0400104 out:
Arjan van de Ven65c19bb2006-04-27 05:25:00 -0400105 mutex_unlock(&performance_mutex);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700106
107 return 0;
108}
109
Linus Torvalds1da177e2005-04-16 15:20:36 -0700110static struct notifier_block acpi_ppc_notifier_block = {
111 .notifier_call = acpi_processor_ppc_notifier,
112};
113
Len Brown4be44fc2005-08-05 00:44:28 -0400114static int acpi_processor_get_platform_limit(struct acpi_processor *pr)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700115{
Len Brown4be44fc2005-08-05 00:44:28 -0400116 acpi_status status = 0;
Matthew Wilcox27663c52008-10-10 02:22:59 -0400117 unsigned long long ppc = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700118
Linus Torvalds1da177e2005-04-16 15:20:36 -0700119
120 if (!pr)
Patrick Mocheld550d982006-06-27 00:41:40 -0400121 return -EINVAL;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700122
123 /*
124 * _PPC indicates the maximum state currently supported by the platform
125 * (e.g. 0 = states 0..n; 1 = states 1..n; etc.
126 */
127 status = acpi_evaluate_integer(pr->handle, "_PPC", NULL, &ppc);
128
129 if (status != AE_NOT_FOUND)
130 acpi_processor_ppc_status |= PPC_IN_USE;
131
Len Brown4be44fc2005-08-05 00:44:28 -0400132 if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
Thomas Renningera6fc6722006-06-26 23:58:43 -0400133 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PPC"));
Patrick Mocheld550d982006-06-27 00:41:40 -0400134 return -ENODEV;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700135 }
136
Dominik Brodowski2d06d8c2011-03-27 15:04:46 +0200137 pr_debug("CPU %d: _PPC is %d - frequency %s limited\n", pr->id,
Thomas Renninger919158d2007-10-31 15:41:42 +0100138 (int)ppc, ppc ? "" : "not");
139
Len Brown4be44fc2005-08-05 00:44:28 -0400140 pr->performance_platform_limit = (int)ppc;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700141
Patrick Mocheld550d982006-06-27 00:41:40 -0400142 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700143}
144
Zhao Yakuid81c45e12009-10-16 09:20:41 +0800145#define ACPI_PROCESSOR_NOTIFY_PERFORMANCE 0x80
146/*
147 * acpi_processor_ppc_ost: Notify firmware the _PPC evaluation status
148 * @handle: ACPI processor handle
149 * @status: the status code of _PPC evaluation
150 * 0: success. OSPM is now using the performance state specificed.
151 * 1: failure. OSPM has not changed the number of P-states in use
152 */
153static void acpi_processor_ppc_ost(acpi_handle handle, int status)
154{
Jiang Liu4a6172a2014-02-19 14:02:18 +0800155 if (acpi_has_method(handle, "_OST"))
156 acpi_evaluate_ost(handle, ACPI_PROCESSOR_NOTIFY_PERFORMANCE,
157 status, NULL);
Zhao Yakuid81c45e12009-10-16 09:20:41 +0800158}
159
Rafael J. Wysockibca5f552016-11-18 13:57:54 +0100160void acpi_processor_ppc_has_changed(struct acpi_processor *pr, int event_flag)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700161{
Thomas Renninger623b78c2007-05-18 21:59:28 -0500162 int ret;
163
Zhao Yakuid81c45e12009-10-16 09:20:41 +0800164 if (ignore_ppc) {
165 /*
166 * Only when it is notification event, the _OST object
167 * will be evaluated. Otherwise it is skipped.
168 */
169 if (event_flag)
170 acpi_processor_ppc_ost(pr->handle, 1);
Rafael J. Wysockibca5f552016-11-18 13:57:54 +0100171 return;
Zhao Yakuid81c45e12009-10-16 09:20:41 +0800172 }
Thomas Renninger623b78c2007-05-18 21:59:28 -0500173
174 ret = acpi_processor_get_platform_limit(pr);
Zhao Yakuid81c45e12009-10-16 09:20:41 +0800175 /*
176 * Only when it is notification event, the _OST object
177 * will be evaluated. Otherwise it is skipped.
178 */
179 if (event_flag) {
180 if (ret < 0)
181 acpi_processor_ppc_ost(pr->handle, 1);
182 else
183 acpi_processor_ppc_ost(pr->handle, 0);
184 }
Rafael J. Wysockibca5f552016-11-18 13:57:54 +0100185 if (ret >= 0)
186 cpufreq_update_policy(pr->id);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700187}
188
Thomas Renningere2f74f32009-11-19 12:31:01 +0100189int acpi_processor_get_bios_limit(int cpu, unsigned int *limit)
190{
191 struct acpi_processor *pr;
192
193 pr = per_cpu(processors, cpu);
194 if (!pr || !pr->performance || !pr->performance->state_count)
195 return -ENODEV;
196 *limit = pr->performance->states[pr->performance_platform_limit].
197 core_frequency * 1000;
198 return 0;
199}
200EXPORT_SYMBOL(acpi_processor_get_bios_limit);
201
Len Brown4be44fc2005-08-05 00:44:28 -0400202void acpi_processor_ppc_init(void)
203{
204 if (!cpufreq_register_notifier
205 (&acpi_ppc_notifier_block, CPUFREQ_POLICY_NOTIFIER))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700206 acpi_processor_ppc_status |= PPC_REGISTERED;
207 else
Len Brown4be44fc2005-08-05 00:44:28 -0400208 printk(KERN_DEBUG
209 "Warning: Processor Platform Limit not supported.\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700210}
211
Len Brown4be44fc2005-08-05 00:44:28 -0400212void acpi_processor_ppc_exit(void)
213{
Linus Torvalds1da177e2005-04-16 15:20:36 -0700214 if (acpi_processor_ppc_status & PPC_REGISTERED)
Len Brown4be44fc2005-08-05 00:44:28 -0400215 cpufreq_unregister_notifier(&acpi_ppc_notifier_block,
216 CPUFREQ_POLICY_NOTIFIER);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700217
218 acpi_processor_ppc_status &= ~PPC_REGISTERED;
219}
220
Len Brown4be44fc2005-08-05 00:44:28 -0400221static int acpi_processor_get_performance_control(struct acpi_processor *pr)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700222{
Len Brown4be44fc2005-08-05 00:44:28 -0400223 int result = 0;
224 acpi_status status = 0;
225 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
226 union acpi_object *pct = NULL;
227 union acpi_object obj = { 0 };
Linus Torvalds1da177e2005-04-16 15:20:36 -0700228
Linus Torvalds1da177e2005-04-16 15:20:36 -0700229
230 status = acpi_evaluate_object(pr->handle, "_PCT", NULL, &buffer);
Len Brown4be44fc2005-08-05 00:44:28 -0400231 if (ACPI_FAILURE(status)) {
Thomas Renningera6fc6722006-06-26 23:58:43 -0400232 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PCT"));
Patrick Mocheld550d982006-06-27 00:41:40 -0400233 return -ENODEV;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700234 }
235
Len Brown4be44fc2005-08-05 00:44:28 -0400236 pct = (union acpi_object *)buffer.pointer;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700237 if (!pct || (pct->type != ACPI_TYPE_PACKAGE)
Len Brown4be44fc2005-08-05 00:44:28 -0400238 || (pct->package.count != 2)) {
Len Brown64684632006-06-26 23:41:38 -0400239 printk(KERN_ERR PREFIX "Invalid _PCT data\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700240 result = -EFAULT;
241 goto end;
242 }
243
244 /*
245 * control_register
246 */
247
248 obj = pct->package.elements[0];
249
250 if ((obj.type != ACPI_TYPE_BUFFER)
Len Brown4be44fc2005-08-05 00:44:28 -0400251 || (obj.buffer.length < sizeof(struct acpi_pct_register))
252 || (obj.buffer.pointer == NULL)) {
Len Brown64684632006-06-26 23:41:38 -0400253 printk(KERN_ERR PREFIX "Invalid _PCT data (control_register)\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700254 result = -EFAULT;
255 goto end;
256 }
Len Brown4be44fc2005-08-05 00:44:28 -0400257 memcpy(&pr->performance->control_register, obj.buffer.pointer,
258 sizeof(struct acpi_pct_register));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700259
260 /*
261 * status_register
262 */
263
264 obj = pct->package.elements[1];
265
266 if ((obj.type != ACPI_TYPE_BUFFER)
Len Brown4be44fc2005-08-05 00:44:28 -0400267 || (obj.buffer.length < sizeof(struct acpi_pct_register))
268 || (obj.buffer.pointer == NULL)) {
Len Brown64684632006-06-26 23:41:38 -0400269 printk(KERN_ERR PREFIX "Invalid _PCT data (status_register)\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700270 result = -EFAULT;
271 goto end;
272 }
273
Len Brown4be44fc2005-08-05 00:44:28 -0400274 memcpy(&pr->performance->status_register, obj.buffer.pointer,
275 sizeof(struct acpi_pct_register));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700276
Len Brown4be44fc2005-08-05 00:44:28 -0400277 end:
Len Brown02438d82006-06-30 03:19:10 -0400278 kfree(buffer.pointer);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700279
Patrick Mocheld550d982006-06-27 00:41:40 -0400280 return result;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700281}
282
Matthew Garrettf5940652012-09-04 08:28:06 +0000283#ifdef CONFIG_X86
284/*
285 * Some AMDs have 50MHz frequency multiples, but only provide 100MHz rounding
286 * in their ACPI data. Calculate the real values and fix up the _PSS data.
287 */
288static void amd_fixup_frequency(struct acpi_processor_px *px, int i)
289{
290 u32 hi, lo, fid, did;
291 int index = px->control & 0x00000007;
292
293 if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD)
294 return;
295
296 if ((boot_cpu_data.x86 == 0x10 && boot_cpu_data.x86_model < 10)
297 || boot_cpu_data.x86 == 0x11) {
298 rdmsr(MSR_AMD_PSTATE_DEF_BASE + index, lo, hi);
Stefan Bader9855d8c2013-01-22 13:37:21 +0100299 /*
300 * MSR C001_0064+:
301 * Bit 63: PstateEn. Read-write. If set, the P-state is valid.
302 */
303 if (!(hi & BIT(31)))
304 return;
305
Matthew Garrettf5940652012-09-04 08:28:06 +0000306 fid = lo & 0x3f;
307 did = (lo >> 6) & 7;
308 if (boot_cpu_data.x86 == 0x10)
309 px->core_frequency = (100 * (fid + 0x10)) >> did;
310 else
311 px->core_frequency = (100 * (fid + 8)) >> did;
312 }
313}
314#else
315static void amd_fixup_frequency(struct acpi_processor_px *px, int i) {};
316#endif
317
Len Brown4be44fc2005-08-05 00:44:28 -0400318static int acpi_processor_get_performance_states(struct acpi_processor *pr)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700319{
Len Brown4be44fc2005-08-05 00:44:28 -0400320 int result = 0;
321 acpi_status status = AE_OK;
322 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
323 struct acpi_buffer format = { sizeof("NNNNNN"), "NNNNNN" };
324 struct acpi_buffer state = { 0, NULL };
325 union acpi_object *pss = NULL;
326 int i;
Marco Aurelio da Costad8e725f2012-05-04 18:53:44 +0200327 int last_invalid = -1;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700328
Linus Torvalds1da177e2005-04-16 15:20:36 -0700329
330 status = acpi_evaluate_object(pr->handle, "_PSS", NULL, &buffer);
Len Brown4be44fc2005-08-05 00:44:28 -0400331 if (ACPI_FAILURE(status)) {
Thomas Renningera6fc6722006-06-26 23:58:43 -0400332 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PSS"));
Patrick Mocheld550d982006-06-27 00:41:40 -0400333 return -ENODEV;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700334 }
335
Jan Engelhardt50dd0962006-10-01 00:28:50 +0200336 pss = buffer.pointer;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700337 if (!pss || (pss->type != ACPI_TYPE_PACKAGE)) {
Len Brown64684632006-06-26 23:41:38 -0400338 printk(KERN_ERR PREFIX "Invalid _PSS data\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700339 result = -EFAULT;
340 goto end;
341 }
342
343 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found %d performance states\n",
Len Brown4be44fc2005-08-05 00:44:28 -0400344 pss->package.count));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700345
346 pr->performance->state_count = pss->package.count;
Len Brown4be44fc2005-08-05 00:44:28 -0400347 pr->performance->states =
348 kmalloc(sizeof(struct acpi_processor_px) * pss->package.count,
349 GFP_KERNEL);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700350 if (!pr->performance->states) {
351 result = -ENOMEM;
352 goto end;
353 }
354
355 for (i = 0; i < pr->performance->state_count; i++) {
356
357 struct acpi_processor_px *px = &(pr->performance->states[i]);
358
359 state.length = sizeof(struct acpi_processor_px);
360 state.pointer = px;
361
362 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Extracting state %d\n", i));
363
364 status = acpi_extract_package(&(pss->package.elements[i]),
Len Brown4be44fc2005-08-05 00:44:28 -0400365 &format, &state);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700366 if (ACPI_FAILURE(status)) {
Thomas Renningera6fc6722006-06-26 23:58:43 -0400367 ACPI_EXCEPTION((AE_INFO, status, "Invalid _PSS data"));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700368 result = -EFAULT;
369 kfree(pr->performance->states);
370 goto end;
371 }
372
Matthew Garrettf5940652012-09-04 08:28:06 +0000373 amd_fixup_frequency(px, i);
374
Linus Torvalds1da177e2005-04-16 15:20:36 -0700375 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
Len Brown4be44fc2005-08-05 00:44:28 -0400376 "State [%d]: core_frequency[%d] power[%d] transition_latency[%d] bus_master_latency[%d] control[0x%x] status[0x%x]\n",
377 i,
378 (u32) px->core_frequency,
379 (u32) px->power,
380 (u32) px->transition_latency,
381 (u32) px->bus_master_latency,
382 (u32) px->control, (u32) px->status));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700383
Len Brown34d531e2009-05-26 15:11:06 -0400384 /*
385 * Check that ACPI's u64 MHz will be valid as u32 KHz in cpufreq
386 */
387 if (!px->core_frequency ||
388 ((u32)(px->core_frequency * 1000) !=
389 (px->core_frequency * 1000))) {
390 printk(KERN_ERR FW_BUG PREFIX
Marco Aurelio da Costad8e725f2012-05-04 18:53:44 +0200391 "Invalid BIOS _PSS frequency found for processor %d: 0x%llx MHz\n",
392 pr->id, px->core_frequency);
393 if (last_invalid == -1)
394 last_invalid = i;
395 } else {
396 if (last_invalid != -1) {
397 /*
398 * Copy this valid entry over last_invalid entry
399 */
400 memcpy(&(pr->performance->states[last_invalid]),
401 px, sizeof(struct acpi_processor_px));
402 ++last_invalid;
403 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700404 }
405 }
406
Marco Aurelio da Costad8e725f2012-05-04 18:53:44 +0200407 if (last_invalid == 0) {
408 printk(KERN_ERR FW_BUG PREFIX
409 "No valid BIOS _PSS frequency found for processor %d\n", pr->id);
410 result = -EFAULT;
411 kfree(pr->performance->states);
412 pr->performance->states = NULL;
413 }
414
415 if (last_invalid > 0)
416 pr->performance->state_count = last_invalid;
417
Len Brown4be44fc2005-08-05 00:44:28 -0400418 end:
Len Brown02438d82006-06-30 03:19:10 -0400419 kfree(buffer.pointer);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700420
Patrick Mocheld550d982006-06-27 00:41:40 -0400421 return result;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700422}
423
Konrad Rzeszutek Wilkc705c782013-03-05 13:42:54 -0500424int acpi_processor_get_performance_info(struct acpi_processor *pr)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700425{
Len Brown4be44fc2005-08-05 00:44:28 -0400426 int result = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700427
Linus Torvalds1da177e2005-04-16 15:20:36 -0700428 if (!pr || !pr->performance || !pr->handle)
Patrick Mocheld550d982006-06-27 00:41:40 -0400429 return -EINVAL;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700430
Jiang Liu952c63e2013-06-29 00:24:38 +0800431 if (!acpi_has_method(pr->handle, "_PCT")) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700432 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
Len Brown4be44fc2005-08-05 00:44:28 -0400433 "ACPI-based processor performance control unavailable\n"));
Patrick Mocheld550d982006-06-27 00:41:40 -0400434 return -ENODEV;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700435 }
436
437 result = acpi_processor_get_performance_control(pr);
438 if (result)
Thomas Renninger910dfae2008-09-01 14:27:04 +0200439 goto update_bios;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700440
441 result = acpi_processor_get_performance_states(pr);
442 if (result)
Thomas Renninger910dfae2008-09-01 14:27:04 +0200443 goto update_bios;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700444
Darrick J. Wong455c0d72010-02-18 10:28:20 -0800445 /* We need to call _PPC once when cpufreq starts */
446 if (ignore_ppc != 1)
447 result = acpi_processor_get_platform_limit(pr);
448
449 return result;
Thomas Renninger910dfae2008-09-01 14:27:04 +0200450
451 /*
452 * Having _PPC but missing frequencies (_PSS, _PCT) is a very good hint that
453 * the BIOS is older than the CPU and does not know its frequencies
454 */
455 update_bios:
Miao Xie16be87e2008-10-24 17:22:04 +0800456#ifdef CONFIG_X86
Jiang Liu952c63e2013-06-29 00:24:38 +0800457 if (acpi_has_method(pr->handle, "_PPC")) {
Thomas Renninger910dfae2008-09-01 14:27:04 +0200458 if(boot_cpu_has(X86_FEATURE_EST))
459 printk(KERN_WARNING FW_BUG "BIOS needs update for CPU "
460 "frequency support\n");
461 }
Miao Xie16be87e2008-10-24 17:22:04 +0800462#endif
Thomas Renninger910dfae2008-09-01 14:27:04 +0200463 return result;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700464}
Konrad Rzeszutek Wilkc705c782013-03-05 13:42:54 -0500465EXPORT_SYMBOL_GPL(acpi_processor_get_performance_info);
Rafael J. Wysockid0ea59e2016-11-17 22:47:47 +0100466
467int acpi_processor_pstate_control(void)
Len Brown4be44fc2005-08-05 00:44:28 -0400468{
469 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700470
Rafael J. Wysockid0ea59e2016-11-17 22:47:47 +0100471 if (!acpi_gbl_FADT.smi_command || !acpi_gbl_FADT.pstate_control)
472 return 0;
473
474 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
475 "Writing pstate_control [0x%x] to smi_command [0x%x]\n",
476 acpi_gbl_FADT.pstate_control, acpi_gbl_FADT.smi_command));
477
478 status = acpi_os_write_port(acpi_gbl_FADT.smi_command,
479 (u32)acpi_gbl_FADT.pstate_control, 8);
480 if (ACPI_SUCCESS(status))
481 return 1;
482
483 ACPI_EXCEPTION((AE_INFO, status,
484 "Failed to write pstate_control [0x%x] to smi_command [0x%x]",
485 acpi_gbl_FADT.pstate_control, acpi_gbl_FADT.smi_command));
486 return -EIO;
487}
488
489int acpi_processor_notify_smm(struct module *calling_module)
490{
491 static int is_done = 0;
492 int result;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700493
494 if (!(acpi_processor_ppc_status & PPC_REGISTERED))
Patrick Mocheld550d982006-06-27 00:41:40 -0400495 return -EBUSY;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700496
497 if (!try_module_get(calling_module))
Patrick Mocheld550d982006-06-27 00:41:40 -0400498 return -EINVAL;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700499
Lucas De Marchi58f87ed2010-09-07 12:49:45 -0400500 /* is_done is set to negative if an error occurred,
501 * and to postitive if _no_ error occurred, but SMM
Linus Torvalds1da177e2005-04-16 15:20:36 -0700502 * was already notified. This avoids double notification
503 * which might lead to unexpected results...
504 */
505 if (is_done > 0) {
506 module_put(calling_module);
Patrick Mocheld550d982006-06-27 00:41:40 -0400507 return 0;
Len Brown4be44fc2005-08-05 00:44:28 -0400508 } else if (is_done < 0) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700509 module_put(calling_module);
Patrick Mocheld550d982006-06-27 00:41:40 -0400510 return is_done;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700511 }
512
513 is_done = -EIO;
514
Rafael J. Wysockid0ea59e2016-11-17 22:47:47 +0100515 result = acpi_processor_pstate_control();
516 if (!result) {
Alexey Starikovskiyad71860a2007-02-02 19:48:19 +0300517 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No SMI port or pstate_control\n"));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700518 module_put(calling_module);
Patrick Mocheld550d982006-06-27 00:41:40 -0400519 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700520 }
Rafael J. Wysockid0ea59e2016-11-17 22:47:47 +0100521 if (result < 0) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700522 module_put(calling_module);
Rafael J. Wysockid0ea59e2016-11-17 22:47:47 +0100523 return result;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700524 }
525
526 /* Success. If there's no _PPC, we need to fear nothing, so
527 * we can allow the cpufreq driver to be rmmod'ed. */
528 is_done = 1;
529
530 if (!(acpi_processor_ppc_status & PPC_IN_USE))
531 module_put(calling_module);
532
Patrick Mocheld550d982006-06-27 00:41:40 -0400533 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700534}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700535
Len Brown4be44fc2005-08-05 00:44:28 -0400536EXPORT_SYMBOL(acpi_processor_notify_smm);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700537
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500538static int acpi_processor_get_psd(struct acpi_processor *pr)
539{
540 int result = 0;
541 acpi_status status = AE_OK;
542 struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
543 struct acpi_buffer format = {sizeof("NNNNN"), "NNNNN"};
544 struct acpi_buffer state = {0, NULL};
545 union acpi_object *psd = NULL;
546 struct acpi_psd_package *pdomain;
547
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500548 status = acpi_evaluate_object(pr->handle, "_PSD", NULL, &buffer);
549 if (ACPI_FAILURE(status)) {
Len Brown9011bff42006-05-11 00:28:12 -0400550 return -ENODEV;
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500551 }
552
Jan Engelhardt50dd0962006-10-01 00:28:50 +0200553 psd = buffer.pointer;
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500554 if (!psd || (psd->type != ACPI_TYPE_PACKAGE)) {
Lin Ming55ac9a02008-09-28 14:51:56 +0800555 printk(KERN_ERR PREFIX "Invalid _PSD data\n");
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500556 result = -EFAULT;
557 goto end;
558 }
559
560 if (psd->package.count != 1) {
Lin Ming55ac9a02008-09-28 14:51:56 +0800561 printk(KERN_ERR PREFIX "Invalid _PSD data\n");
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500562 result = -EFAULT;
563 goto end;
564 }
565
566 pdomain = &(pr->performance->domain_info);
567
568 state.length = sizeof(struct acpi_psd_package);
569 state.pointer = pdomain;
570
571 status = acpi_extract_package(&(psd->package.elements[0]),
572 &format, &state);
573 if (ACPI_FAILURE(status)) {
Lin Ming55ac9a02008-09-28 14:51:56 +0800574 printk(KERN_ERR PREFIX "Invalid _PSD data\n");
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500575 result = -EFAULT;
576 goto end;
577 }
578
579 if (pdomain->num_entries != ACPI_PSD_REV0_ENTRIES) {
Lin Ming55ac9a02008-09-28 14:51:56 +0800580 printk(KERN_ERR PREFIX "Unknown _PSD:num_entries\n");
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500581 result = -EFAULT;
582 goto end;
583 }
584
585 if (pdomain->revision != ACPI_PSD_REV0_REVISION) {
Lin Ming55ac9a02008-09-28 14:51:56 +0800586 printk(KERN_ERR PREFIX "Unknown _PSD:revision\n");
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500587 result = -EFAULT;
588 goto end;
589 }
590
Stanislaw Gruszkae1eb4772009-03-24 13:41:59 +0100591 if (pdomain->coord_type != DOMAIN_COORD_TYPE_SW_ALL &&
592 pdomain->coord_type != DOMAIN_COORD_TYPE_SW_ANY &&
593 pdomain->coord_type != DOMAIN_COORD_TYPE_HW_ALL) {
594 printk(KERN_ERR PREFIX "Invalid _PSD:coord_type\n");
595 result = -EFAULT;
596 goto end;
597 }
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500598end:
Len Brown02438d82006-06-30 03:19:10 -0400599 kfree(buffer.pointer);
Len Brown9011bff42006-05-11 00:28:12 -0400600 return result;
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500601}
602
603int acpi_processor_preregister_performance(
Tejun Heoa29d8b82010-02-02 14:39:15 +0900604 struct acpi_processor_performance __percpu *performance)
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500605{
Lan Tianyu09d5ca82013-06-25 10:06:45 +0800606 int count_target;
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500607 int retval = 0;
608 unsigned int i, j;
Rusty Russell2fdf66b2008-12-31 18:08:47 -0800609 cpumask_var_t covered_cpus;
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500610 struct acpi_processor *pr;
611 struct acpi_psd_package *pdomain;
612 struct acpi_processor *match_pr;
613 struct acpi_psd_package *match_pdomain;
614
Li Zefan79f55992009-06-15 14:58:26 +0800615 if (!zalloc_cpumask_var(&covered_cpus, GFP_KERNEL))
Rusty Russell2fdf66b2008-12-31 18:08:47 -0800616 return -ENOMEM;
617
Len Brown785fccc2006-06-15 22:19:31 -0400618 mutex_lock(&performance_mutex);
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500619
Stanislaw Gruszkae1eb4772009-03-24 13:41:59 +0100620 /*
621 * Check if another driver has already registered, and abort before
622 * changing pr->performance if it has. Check input data as well.
623 */
KAMEZAWA Hiroyuki193de0c2006-04-27 05:25:00 -0400624 for_each_possible_cpu(i) {
Mike Travis706546d2008-06-09 16:22:23 -0700625 pr = per_cpu(processors, i);
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500626 if (!pr) {
627 /* Look only at processors in ACPI namespace */
628 continue;
629 }
630
631 if (pr->performance) {
632 retval = -EBUSY;
Stanislaw Gruszkae1eb4772009-03-24 13:41:59 +0100633 goto err_out;
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500634 }
635
Rusty Russellb36128c2009-02-20 16:29:08 +0900636 if (!performance || !per_cpu_ptr(performance, i)) {
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500637 retval = -EINVAL;
Stanislaw Gruszkae1eb4772009-03-24 13:41:59 +0100638 goto err_out;
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500639 }
Stanislaw Gruszkae1eb4772009-03-24 13:41:59 +0100640 }
641
642 /* Call _PSD for all CPUs */
643 for_each_possible_cpu(i) {
644 pr = per_cpu(processors, i);
645 if (!pr)
646 continue;
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500647
Rusty Russellb36128c2009-02-20 16:29:08 +0900648 pr->performance = per_cpu_ptr(performance, i);
Rusty Russell2fdf66b2008-12-31 18:08:47 -0800649 cpumask_set_cpu(i, pr->performance->shared_cpu_map);
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500650 if (acpi_processor_get_psd(pr)) {
651 retval = -EINVAL;
652 continue;
653 }
654 }
655 if (retval)
656 goto err_ret;
657
658 /*
659 * Now that we have _PSD data from all CPUs, lets setup P-state
660 * domain info.
661 */
KAMEZAWA Hiroyuki193de0c2006-04-27 05:25:00 -0400662 for_each_possible_cpu(i) {
Mike Travis706546d2008-06-09 16:22:23 -0700663 pr = per_cpu(processors, i);
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500664 if (!pr)
665 continue;
666
Rusty Russell2fdf66b2008-12-31 18:08:47 -0800667 if (cpumask_test_cpu(i, covered_cpus))
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500668 continue;
669
670 pdomain = &(pr->performance->domain_info);
Rusty Russell2fdf66b2008-12-31 18:08:47 -0800671 cpumask_set_cpu(i, pr->performance->shared_cpu_map);
672 cpumask_set_cpu(i, covered_cpus);
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500673 if (pdomain->num_processors <= 1)
674 continue;
675
676 /* Validate the Domain info */
677 count_target = pdomain->num_processors;
Venkatesh Pallipadi46f18e32006-06-26 00:34:43 -0400678 if (pdomain->coord_type == DOMAIN_COORD_TYPE_SW_ALL)
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500679 pr->performance->shared_type = CPUFREQ_SHARED_TYPE_ALL;
Venkatesh Pallipadi46f18e32006-06-26 00:34:43 -0400680 else if (pdomain->coord_type == DOMAIN_COORD_TYPE_HW_ALL)
681 pr->performance->shared_type = CPUFREQ_SHARED_TYPE_HW;
682 else if (pdomain->coord_type == DOMAIN_COORD_TYPE_SW_ANY)
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500683 pr->performance->shared_type = CPUFREQ_SHARED_TYPE_ANY;
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500684
KAMEZAWA Hiroyuki193de0c2006-04-27 05:25:00 -0400685 for_each_possible_cpu(j) {
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500686 if (i == j)
687 continue;
688
Mike Travis706546d2008-06-09 16:22:23 -0700689 match_pr = per_cpu(processors, j);
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500690 if (!match_pr)
691 continue;
692
693 match_pdomain = &(match_pr->performance->domain_info);
694 if (match_pdomain->domain != pdomain->domain)
695 continue;
696
697 /* Here i and j are in the same domain */
698
699 if (match_pdomain->num_processors != count_target) {
700 retval = -EINVAL;
701 goto err_ret;
702 }
703
704 if (pdomain->coord_type != match_pdomain->coord_type) {
705 retval = -EINVAL;
706 goto err_ret;
707 }
708
Rusty Russell2fdf66b2008-12-31 18:08:47 -0800709 cpumask_set_cpu(j, covered_cpus);
710 cpumask_set_cpu(j, pr->performance->shared_cpu_map);
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500711 }
712
KAMEZAWA Hiroyuki193de0c2006-04-27 05:25:00 -0400713 for_each_possible_cpu(j) {
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500714 if (i == j)
715 continue;
716
Mike Travis706546d2008-06-09 16:22:23 -0700717 match_pr = per_cpu(processors, j);
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500718 if (!match_pr)
719 continue;
720
721 match_pdomain = &(match_pr->performance->domain_info);
722 if (match_pdomain->domain != pdomain->domain)
723 continue;
724
725 match_pr->performance->shared_type =
726 pr->performance->shared_type;
Rusty Russell2fdf66b2008-12-31 18:08:47 -0800727 cpumask_copy(match_pr->performance->shared_cpu_map,
728 pr->performance->shared_cpu_map);
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500729 }
730 }
731
732err_ret:
KAMEZAWA Hiroyuki193de0c2006-04-27 05:25:00 -0400733 for_each_possible_cpu(i) {
Mike Travis706546d2008-06-09 16:22:23 -0700734 pr = per_cpu(processors, i);
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500735 if (!pr || !pr->performance)
736 continue;
737
738 /* Assume no coordination on any error parsing domain info */
739 if (retval) {
Rusty Russell2fdf66b2008-12-31 18:08:47 -0800740 cpumask_clear(pr->performance->shared_cpu_map);
741 cpumask_set_cpu(i, pr->performance->shared_cpu_map);
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500742 pr->performance->shared_type = CPUFREQ_SHARED_TYPE_ALL;
743 }
744 pr->performance = NULL; /* Will be set for real in register */
745 }
746
Stanislaw Gruszkae1eb4772009-03-24 13:41:59 +0100747err_out:
Len Brown785fccc2006-06-15 22:19:31 -0400748 mutex_unlock(&performance_mutex);
Rusty Russell2fdf66b2008-12-31 18:08:47 -0800749 free_cpumask_var(covered_cpus);
Len Brown9011bff42006-05-11 00:28:12 -0400750 return retval;
Venkatesh Pallipadi3b2d9942005-12-14 15:05:00 -0500751}
752EXPORT_SYMBOL(acpi_processor_preregister_performance);
753
Linus Torvalds1da177e2005-04-16 15:20:36 -0700754int
Len Brown4be44fc2005-08-05 00:44:28 -0400755acpi_processor_register_performance(struct acpi_processor_performance
756 *performance, unsigned int cpu)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700757{
758 struct acpi_processor *pr;
759
Linus Torvalds1da177e2005-04-16 15:20:36 -0700760 if (!(acpi_processor_ppc_status & PPC_REGISTERED))
Patrick Mocheld550d982006-06-27 00:41:40 -0400761 return -EINVAL;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700762
Arjan van de Ven65c19bb2006-04-27 05:25:00 -0400763 mutex_lock(&performance_mutex);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700764
Mike Travis706546d2008-06-09 16:22:23 -0700765 pr = per_cpu(processors, cpu);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700766 if (!pr) {
Arjan van de Ven65c19bb2006-04-27 05:25:00 -0400767 mutex_unlock(&performance_mutex);
Patrick Mocheld550d982006-06-27 00:41:40 -0400768 return -ENODEV;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700769 }
770
771 if (pr->performance) {
Arjan van de Ven65c19bb2006-04-27 05:25:00 -0400772 mutex_unlock(&performance_mutex);
Patrick Mocheld550d982006-06-27 00:41:40 -0400773 return -EBUSY;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700774 }
775
Andrew Mortona913f502006-06-10 09:54:13 -0700776 WARN_ON(!performance);
777
Linus Torvalds1da177e2005-04-16 15:20:36 -0700778 pr->performance = performance;
779
780 if (acpi_processor_get_performance_info(pr)) {
781 pr->performance = NULL;
Arjan van de Ven65c19bb2006-04-27 05:25:00 -0400782 mutex_unlock(&performance_mutex);
Patrick Mocheld550d982006-06-27 00:41:40 -0400783 return -EIO;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700784 }
785
Arjan van de Ven65c19bb2006-04-27 05:25:00 -0400786 mutex_unlock(&performance_mutex);
Patrick Mocheld550d982006-06-27 00:41:40 -0400787 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700788}
Len Brown4be44fc2005-08-05 00:44:28 -0400789
Linus Torvalds1da177e2005-04-16 15:20:36 -0700790EXPORT_SYMBOL(acpi_processor_register_performance);
791
Rafael J. Wysockib2f8dc42015-07-22 22:11:16 +0200792void acpi_processor_unregister_performance(unsigned int cpu)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700793{
794 struct acpi_processor *pr;
795
Arjan van de Ven65c19bb2006-04-27 05:25:00 -0400796 mutex_lock(&performance_mutex);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700797
Mike Travis706546d2008-06-09 16:22:23 -0700798 pr = per_cpu(processors, cpu);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700799 if (!pr) {
Arjan van de Ven65c19bb2006-04-27 05:25:00 -0400800 mutex_unlock(&performance_mutex);
Patrick Mocheld550d982006-06-27 00:41:40 -0400801 return;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700802 }
803
Andrew Mortona913f502006-06-10 09:54:13 -0700804 if (pr->performance)
805 kfree(pr->performance->states);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700806 pr->performance = NULL;
807
Arjan van de Ven65c19bb2006-04-27 05:25:00 -0400808 mutex_unlock(&performance_mutex);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700809
Patrick Mocheld550d982006-06-27 00:41:40 -0400810 return;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700811}
Len Brown4be44fc2005-08-05 00:44:28 -0400812
Linus Torvalds1da177e2005-04-16 15:20:36 -0700813EXPORT_SYMBOL(acpi_processor_unregister_performance);