diff options
author | Toshi Kani <toshi.kani@hp.com> | 2012-11-20 18:42:27 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2012-11-21 17:20:22 -0500 |
commit | 47db4547ffe5aa2eb5b053e6c02f0561fbbfa221 (patch) | |
tree | 53f4d7162800993bec66522fe17d171f6d3535f2 /drivers/acpi | |
parent | fbfddae696572e57a441252abbd65f7220e06030 (diff) |
ACPI: Update CPU hotplug error messages
Updated CPU hotplug error messages with acpi_handle_<level>(),
dev_<level>() and pr_<level>(). Modified some messages for
clarity. Added error status / id info to the messages where
needed.
Signed-off-by: Toshi Kani <toshi.kani@hp.com>
Tested-by: Vijay Mohan Pandarathil <vijaymohan.pandarathil@hp.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/processor_driver.c | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c index 8cc33d0e5d8f..e83311bf1ebd 100644 --- a/drivers/acpi/processor_driver.c +++ b/drivers/acpi/processor_driver.c | |||
@@ -44,6 +44,7 @@ | |||
44 | #include <linux/moduleparam.h> | 44 | #include <linux/moduleparam.h> |
45 | #include <linux/cpuidle.h> | 45 | #include <linux/cpuidle.h> |
46 | #include <linux/slab.h> | 46 | #include <linux/slab.h> |
47 | #include <linux/acpi.h> | ||
47 | 48 | ||
48 | #include <asm/io.h> | 49 | #include <asm/io.h> |
49 | #include <asm/cpu.h> | 50 | #include <asm/cpu.h> |
@@ -282,7 +283,9 @@ static int acpi_processor_get_info(struct acpi_device *device) | |||
282 | /* Declared with "Processor" statement; match ProcessorID */ | 283 | /* Declared with "Processor" statement; match ProcessorID */ |
283 | status = acpi_evaluate_object(pr->handle, NULL, NULL, &buffer); | 284 | status = acpi_evaluate_object(pr->handle, NULL, NULL, &buffer); |
284 | if (ACPI_FAILURE(status)) { | 285 | if (ACPI_FAILURE(status)) { |
285 | printk(KERN_ERR PREFIX "Evaluating processor object\n"); | 286 | dev_err(&device->dev, |
287 | "Failed to evaluate processor object (0x%x)\n", | ||
288 | status); | ||
286 | return -ENODEV; | 289 | return -ENODEV; |
287 | } | 290 | } |
288 | 291 | ||
@@ -301,8 +304,9 @@ static int acpi_processor_get_info(struct acpi_device *device) | |||
301 | status = acpi_evaluate_integer(pr->handle, METHOD_NAME__UID, | 304 | status = acpi_evaluate_integer(pr->handle, METHOD_NAME__UID, |
302 | NULL, &value); | 305 | NULL, &value); |
303 | if (ACPI_FAILURE(status)) { | 306 | if (ACPI_FAILURE(status)) { |
304 | printk(KERN_ERR PREFIX | 307 | dev_err(&device->dev, |
305 | "Evaluating processor _UID [%#x]\n", status); | 308 | "Failed to evaluate processor _UID (0x%x)\n", |
309 | status); | ||
306 | return -ENODEV; | 310 | return -ENODEV; |
307 | } | 311 | } |
308 | device_declaration = 1; | 312 | device_declaration = 1; |
@@ -345,7 +349,7 @@ static int acpi_processor_get_info(struct acpi_device *device) | |||
345 | if (!object.processor.pblk_address) | 349 | if (!object.processor.pblk_address) |
346 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No PBLK (NULL address)\n")); | 350 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No PBLK (NULL address)\n")); |
347 | else if (object.processor.pblk_length != 6) | 351 | else if (object.processor.pblk_length != 6) |
348 | printk(KERN_ERR PREFIX "Invalid PBLK length [%d]\n", | 352 | dev_err(&device->dev, "Invalid PBLK length [%d]\n", |
349 | object.processor.pblk_length); | 353 | object.processor.pblk_length); |
350 | else { | 354 | else { |
351 | pr->throttling.address = object.processor.pblk_address; | 355 | pr->throttling.address = object.processor.pblk_address; |
@@ -430,8 +434,8 @@ static int acpi_cpu_soft_notify(struct notifier_block *nfb, | |||
430 | * Initialize missing things | 434 | * Initialize missing things |
431 | */ | 435 | */ |
432 | if (pr->flags.need_hotplug_init) { | 436 | if (pr->flags.need_hotplug_init) { |
433 | printk(KERN_INFO "Will online and init hotplugged " | 437 | pr_info("Will online and init hotplugged CPU: %d\n", |
434 | "CPU: %d\n", pr->id); | 438 | pr->id); |
435 | WARN(acpi_processor_start(pr), "Failed to start CPU:" | 439 | WARN(acpi_processor_start(pr), "Failed to start CPU:" |
436 | " %d\n", pr->id); | 440 | " %d\n", pr->id); |
437 | pr->flags.need_hotplug_init = 0; | 441 | pr->flags.need_hotplug_init = 0; |
@@ -492,14 +496,16 @@ static __ref int acpi_processor_start(struct acpi_processor *pr) | |||
492 | &pr->cdev->device.kobj, | 496 | &pr->cdev->device.kobj, |
493 | "thermal_cooling"); | 497 | "thermal_cooling"); |
494 | if (result) { | 498 | if (result) { |
495 | printk(KERN_ERR PREFIX "Create sysfs link\n"); | 499 | dev_err(&device->dev, |
500 | "Failed to create sysfs link 'thermal_cooling'\n"); | ||
496 | goto err_thermal_unregister; | 501 | goto err_thermal_unregister; |
497 | } | 502 | } |
498 | result = sysfs_create_link(&pr->cdev->device.kobj, | 503 | result = sysfs_create_link(&pr->cdev->device.kobj, |
499 | &device->dev.kobj, | 504 | &device->dev.kobj, |
500 | "device"); | 505 | "device"); |
501 | if (result) { | 506 | if (result) { |
502 | printk(KERN_ERR PREFIX "Create sysfs link\n"); | 507 | dev_err(&pr->cdev->device, |
508 | "Failed to create sysfs link 'device'\n"); | ||
503 | goto err_remove_sysfs_thermal; | 509 | goto err_remove_sysfs_thermal; |
504 | } | 510 | } |
505 | 511 | ||
@@ -561,8 +567,9 @@ static int __cpuinit acpi_processor_add(struct acpi_device *device) | |||
561 | */ | 567 | */ |
562 | if (per_cpu(processor_device_array, pr->id) != NULL && | 568 | if (per_cpu(processor_device_array, pr->id) != NULL && |
563 | per_cpu(processor_device_array, pr->id) != device) { | 569 | per_cpu(processor_device_array, pr->id) != device) { |
564 | printk(KERN_WARNING "BIOS reported wrong ACPI id " | 570 | dev_warn(&device->dev, |
565 | "for the processor\n"); | 571 | "BIOS reported wrong ACPI id %d for the processor\n", |
572 | pr->id); | ||
566 | result = -ENODEV; | 573 | result = -ENODEV; |
567 | goto err_free_cpumask; | 574 | goto err_free_cpumask; |
568 | } | 575 | } |
@@ -716,7 +723,7 @@ static void acpi_processor_hotplug_notify(acpi_handle handle, | |||
716 | 723 | ||
717 | result = acpi_processor_device_add(handle, &device); | 724 | result = acpi_processor_device_add(handle, &device); |
718 | if (result) { | 725 | if (result) { |
719 | printk(KERN_ERR PREFIX "Unable to add the device\n"); | 726 | acpi_handle_err(handle, "Unable to add the device\n"); |
720 | break; | 727 | break; |
721 | } | 728 | } |
722 | 729 | ||
@@ -728,17 +735,19 @@ static void acpi_processor_hotplug_notify(acpi_handle handle, | |||
728 | "received ACPI_NOTIFY_EJECT_REQUEST\n")); | 735 | "received ACPI_NOTIFY_EJECT_REQUEST\n")); |
729 | 736 | ||
730 | if (acpi_bus_get_device(handle, &device)) { | 737 | if (acpi_bus_get_device(handle, &device)) { |
731 | pr_err(PREFIX "Device don't exist, dropping EJECT\n"); | 738 | acpi_handle_err(handle, |
739 | "Device don't exist, dropping EJECT\n"); | ||
732 | break; | 740 | break; |
733 | } | 741 | } |
734 | if (!acpi_driver_data(device)) { | 742 | if (!acpi_driver_data(device)) { |
735 | pr_err(PREFIX "Driver data is NULL, dropping EJECT\n"); | 743 | acpi_handle_err(handle, |
744 | "Driver data is NULL, dropping EJECT\n"); | ||
736 | break; | 745 | break; |
737 | } | 746 | } |
738 | 747 | ||
739 | ej_event = kmalloc(sizeof(*ej_event), GFP_KERNEL); | 748 | ej_event = kmalloc(sizeof(*ej_event), GFP_KERNEL); |
740 | if (!ej_event) { | 749 | if (!ej_event) { |
741 | pr_err(PREFIX "No memory, dropping EJECT\n"); | 750 | acpi_handle_err(handle, "No memory, dropping EJECT\n"); |
742 | break; | 751 | break; |
743 | } | 752 | } |
744 | 753 | ||
@@ -848,7 +857,7 @@ static acpi_status acpi_processor_hotadd_init(struct acpi_processor *pr) | |||
848 | * and do it when the CPU gets online the first time | 857 | * and do it when the CPU gets online the first time |
849 | * TBD: Cleanup above functions and try to do this more elegant. | 858 | * TBD: Cleanup above functions and try to do this more elegant. |
850 | */ | 859 | */ |
851 | printk(KERN_INFO "CPU %d got hotplugged\n", pr->id); | 860 | pr_info("CPU %d got hotplugged\n", pr->id); |
852 | pr->flags.need_hotplug_init = 1; | 861 | pr->flags.need_hotplug_init = 1; |
853 | 862 | ||
854 | return AE_OK; | 863 | return AE_OK; |