aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen/xen-acpi-processor.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/xen/xen-acpi-processor.c')
-rw-r--r--drivers/xen/xen-acpi-processor.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/drivers/xen/xen-acpi-processor.c b/drivers/xen/xen-acpi-processor.c
index 8abd7d579037..13bc6c31c060 100644
--- a/drivers/xen/xen-acpi-processor.c
+++ b/drivers/xen/xen-acpi-processor.c
@@ -17,6 +17,8 @@
17 * 17 *
18 */ 18 */
19 19
20#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
21
20#include <linux/cpumask.h> 22#include <linux/cpumask.h>
21#include <linux/cpufreq.h> 23#include <linux/cpufreq.h>
22#include <linux/freezer.h> 24#include <linux/freezer.h>
@@ -34,8 +36,6 @@
34#include <xen/interface/platform.h> 36#include <xen/interface/platform.h>
35#include <asm/xen/hypercall.h> 37#include <asm/xen/hypercall.h>
36 38
37#define DRV_NAME "xen-acpi-processor: "
38
39static int no_hypercall; 39static int no_hypercall;
40MODULE_PARM_DESC(off, "Inhibit the hypercall."); 40MODULE_PARM_DESC(off, "Inhibit the hypercall.");
41module_param_named(off, no_hypercall, int, 0400); 41module_param_named(off, no_hypercall, int, 0400);
@@ -104,7 +104,7 @@ static int push_cxx_to_hypervisor(struct acpi_processor *_pr)
104 set_xen_guest_handle(dst_cx->dp, NULL); 104 set_xen_guest_handle(dst_cx->dp, NULL);
105 } 105 }
106 if (!ok) { 106 if (!ok) {
107 pr_debug(DRV_NAME "No _Cx for ACPI CPU %u\n", _pr->acpi_id); 107 pr_debug("No _Cx for ACPI CPU %u\n", _pr->acpi_id);
108 kfree(dst_cx_states); 108 kfree(dst_cx_states);
109 return -EINVAL; 109 return -EINVAL;
110 } 110 }
@@ -133,7 +133,7 @@ static int push_cxx_to_hypervisor(struct acpi_processor *_pr)
133 /* EINVAL means the ACPI ID is incorrect - meaning the ACPI 133 /* EINVAL means the ACPI ID is incorrect - meaning the ACPI
134 * table is referencing a non-existing CPU - which can happen 134 * table is referencing a non-existing CPU - which can happen
135 * with broken ACPI tables. */ 135 * with broken ACPI tables. */
136 pr_err(DRV_NAME "(CX): Hypervisor error (%d) for ACPI CPU%u\n", 136 pr_err("(CX): Hypervisor error (%d) for ACPI CPU%u\n",
137 ret, _pr->acpi_id); 137 ret, _pr->acpi_id);
138 138
139 kfree(dst_cx_states); 139 kfree(dst_cx_states);
@@ -239,7 +239,7 @@ static int push_pxx_to_hypervisor(struct acpi_processor *_pr)
239 dst_perf->flags |= XEN_PX_PSD; 239 dst_perf->flags |= XEN_PX_PSD;
240 240
241 if (dst_perf->flags != (XEN_PX_PSD | XEN_PX_PSS | XEN_PX_PCT | XEN_PX_PPC)) { 241 if (dst_perf->flags != (XEN_PX_PSD | XEN_PX_PSS | XEN_PX_PCT | XEN_PX_PPC)) {
242 pr_warn(DRV_NAME "ACPI CPU%u missing some P-state data (%x), skipping.\n", 242 pr_warn("ACPI CPU%u missing some P-state data (%x), skipping\n",
243 _pr->acpi_id, dst_perf->flags); 243 _pr->acpi_id, dst_perf->flags);
244 ret = -ENODEV; 244 ret = -ENODEV;
245 goto err_free; 245 goto err_free;
@@ -265,8 +265,8 @@ static int push_pxx_to_hypervisor(struct acpi_processor *_pr)
265 /* EINVAL means the ACPI ID is incorrect - meaning the ACPI 265 /* EINVAL means the ACPI ID is incorrect - meaning the ACPI
266 * table is referencing a non-existing CPU - which can happen 266 * table is referencing a non-existing CPU - which can happen
267 * with broken ACPI tables. */ 267 * with broken ACPI tables. */
268 pr_warn(DRV_NAME "(_PXX): Hypervisor error (%d) for ACPI CPU%u\n", 268 pr_warn("(_PXX): Hypervisor error (%d) for ACPI CPU%u\n",
269 ret, _pr->acpi_id); 269 ret, _pr->acpi_id);
270err_free: 270err_free:
271 if (!IS_ERR_OR_NULL(dst_states)) 271 if (!IS_ERR_OR_NULL(dst_states))
272 kfree(dst_states); 272 kfree(dst_states);
@@ -318,7 +318,7 @@ static unsigned int __init get_max_acpi_id(void)
318 max_acpi_id = max(info->acpi_id, max_acpi_id); 318 max_acpi_id = max(info->acpi_id, max_acpi_id);
319 } 319 }
320 max_acpi_id *= 2; /* Slack for CPU hotplug support. */ 320 max_acpi_id *= 2; /* Slack for CPU hotplug support. */
321 pr_debug(DRV_NAME "Max ACPI ID: %u\n", max_acpi_id); 321 pr_debug("Max ACPI ID: %u\n", max_acpi_id);
322 return max_acpi_id; 322 return max_acpi_id;
323} 323}
324/* 324/*
@@ -365,15 +365,14 @@ read_acpi_id(acpi_handle handle, u32 lvl, void *context, void **rv)
365 /* There are more ACPI Processor objects than in x2APIC or MADT. 365 /* There are more ACPI Processor objects than in x2APIC or MADT.
366 * This can happen with incorrect ACPI SSDT declerations. */ 366 * This can happen with incorrect ACPI SSDT declerations. */
367 if (acpi_id > nr_acpi_bits) { 367 if (acpi_id > nr_acpi_bits) {
368 pr_debug(DRV_NAME "We only have %u, trying to set %u\n", 368 pr_debug("We only have %u, trying to set %u\n",
369 nr_acpi_bits, acpi_id); 369 nr_acpi_bits, acpi_id);
370 return AE_OK; 370 return AE_OK;
371 } 371 }
372 /* OK, There is a ACPI Processor object */ 372 /* OK, There is a ACPI Processor object */
373 __set_bit(acpi_id, acpi_id_present); 373 __set_bit(acpi_id, acpi_id_present);
374 374
375 pr_debug(DRV_NAME "ACPI CPU%u w/ PBLK:0x%lx\n", acpi_id, 375 pr_debug("ACPI CPU%u w/ PBLK:0x%lx\n", acpi_id, (unsigned long)pblk);
376 (unsigned long)pblk);
377 376
378 status = acpi_evaluate_object(handle, "_CST", NULL, &buffer); 377 status = acpi_evaluate_object(handle, "_CST", NULL, &buffer);
379 if (ACPI_FAILURE(status)) { 378 if (ACPI_FAILURE(status)) {
@@ -476,7 +475,7 @@ static int xen_upload_processor_pm_data(void)
476 unsigned int i; 475 unsigned int i;
477 int rc = 0; 476 int rc = 0;
478 477
479 pr_info(DRV_NAME "Uploading Xen processor PM info\n"); 478 pr_info("Uploading Xen processor PM info\n");
480 479
481 for_each_possible_cpu(i) { 480 for_each_possible_cpu(i) {
482 struct acpi_processor *_pr; 481 struct acpi_processor *_pr;
@@ -523,7 +522,7 @@ static int __init xen_acpi_processor_init(void)
523 522
524 acpi_perf_data = alloc_percpu(struct acpi_processor_performance); 523 acpi_perf_data = alloc_percpu(struct acpi_processor_performance);
525 if (!acpi_perf_data) { 524 if (!acpi_perf_data) {
526 pr_debug(DRV_NAME "Memory allocation error for acpi_perf_data.\n"); 525 pr_debug("Memory allocation error for acpi_perf_data\n");
527 kfree(acpi_ids_done); 526 kfree(acpi_ids_done);
528 return -ENOMEM; 527 return -ENOMEM;
529 } 528 }