提交 47db4547 编写于 作者: T Toshi Kani 提交者: Rafael J. Wysocki

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: NToshi Kani <toshi.kani@hp.com>
Tested-by: NVijay Mohan Pandarathil <vijaymohan.pandarathil@hp.com>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 fbfddae6
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include <linux/moduleparam.h> #include <linux/moduleparam.h>
#include <linux/cpuidle.h> #include <linux/cpuidle.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/acpi.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/cpu.h> #include <asm/cpu.h>
...@@ -282,7 +283,9 @@ static int acpi_processor_get_info(struct acpi_device *device) ...@@ -282,7 +283,9 @@ static int acpi_processor_get_info(struct acpi_device *device)
/* Declared with "Processor" statement; match ProcessorID */ /* Declared with "Processor" statement; match ProcessorID */
status = acpi_evaluate_object(pr->handle, NULL, NULL, &buffer); status = acpi_evaluate_object(pr->handle, NULL, NULL, &buffer);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
printk(KERN_ERR PREFIX "Evaluating processor object\n"); dev_err(&device->dev,
"Failed to evaluate processor object (0x%x)\n",
status);
return -ENODEV; return -ENODEV;
} }
...@@ -301,8 +304,9 @@ static int acpi_processor_get_info(struct acpi_device *device) ...@@ -301,8 +304,9 @@ static int acpi_processor_get_info(struct acpi_device *device)
status = acpi_evaluate_integer(pr->handle, METHOD_NAME__UID, status = acpi_evaluate_integer(pr->handle, METHOD_NAME__UID,
NULL, &value); NULL, &value);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
printk(KERN_ERR PREFIX dev_err(&device->dev,
"Evaluating processor _UID [%#x]\n", status); "Failed to evaluate processor _UID (0x%x)\n",
status);
return -ENODEV; return -ENODEV;
} }
device_declaration = 1; device_declaration = 1;
...@@ -345,7 +349,7 @@ static int acpi_processor_get_info(struct acpi_device *device) ...@@ -345,7 +349,7 @@ static int acpi_processor_get_info(struct acpi_device *device)
if (!object.processor.pblk_address) if (!object.processor.pblk_address)
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No PBLK (NULL address)\n")); ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No PBLK (NULL address)\n"));
else if (object.processor.pblk_length != 6) else if (object.processor.pblk_length != 6)
printk(KERN_ERR PREFIX "Invalid PBLK length [%d]\n", dev_err(&device->dev, "Invalid PBLK length [%d]\n",
object.processor.pblk_length); object.processor.pblk_length);
else { else {
pr->throttling.address = object.processor.pblk_address; pr->throttling.address = object.processor.pblk_address;
...@@ -430,8 +434,8 @@ static int acpi_cpu_soft_notify(struct notifier_block *nfb, ...@@ -430,8 +434,8 @@ static int acpi_cpu_soft_notify(struct notifier_block *nfb,
* Initialize missing things * Initialize missing things
*/ */
if (pr->flags.need_hotplug_init) { if (pr->flags.need_hotplug_init) {
printk(KERN_INFO "Will online and init hotplugged " pr_info("Will online and init hotplugged CPU: %d\n",
"CPU: %d\n", pr->id); pr->id);
WARN(acpi_processor_start(pr), "Failed to start CPU:" WARN(acpi_processor_start(pr), "Failed to start CPU:"
" %d\n", pr->id); " %d\n", pr->id);
pr->flags.need_hotplug_init = 0; pr->flags.need_hotplug_init = 0;
...@@ -492,14 +496,16 @@ static __ref int acpi_processor_start(struct acpi_processor *pr) ...@@ -492,14 +496,16 @@ static __ref int acpi_processor_start(struct acpi_processor *pr)
&pr->cdev->device.kobj, &pr->cdev->device.kobj,
"thermal_cooling"); "thermal_cooling");
if (result) { if (result) {
printk(KERN_ERR PREFIX "Create sysfs link\n"); dev_err(&device->dev,
"Failed to create sysfs link 'thermal_cooling'\n");
goto err_thermal_unregister; goto err_thermal_unregister;
} }
result = sysfs_create_link(&pr->cdev->device.kobj, result = sysfs_create_link(&pr->cdev->device.kobj,
&device->dev.kobj, &device->dev.kobj,
"device"); "device");
if (result) { if (result) {
printk(KERN_ERR PREFIX "Create sysfs link\n"); dev_err(&pr->cdev->device,
"Failed to create sysfs link 'device'\n");
goto err_remove_sysfs_thermal; goto err_remove_sysfs_thermal;
} }
...@@ -561,8 +567,9 @@ static int __cpuinit acpi_processor_add(struct acpi_device *device) ...@@ -561,8 +567,9 @@ static int __cpuinit acpi_processor_add(struct acpi_device *device)
*/ */
if (per_cpu(processor_device_array, pr->id) != NULL && if (per_cpu(processor_device_array, pr->id) != NULL &&
per_cpu(processor_device_array, pr->id) != device) { per_cpu(processor_device_array, pr->id) != device) {
printk(KERN_WARNING "BIOS reported wrong ACPI id " dev_warn(&device->dev,
"for the processor\n"); "BIOS reported wrong ACPI id %d for the processor\n",
pr->id);
result = -ENODEV; result = -ENODEV;
goto err_free_cpumask; goto err_free_cpumask;
} }
...@@ -716,7 +723,7 @@ static void acpi_processor_hotplug_notify(acpi_handle handle, ...@@ -716,7 +723,7 @@ static void acpi_processor_hotplug_notify(acpi_handle handle,
result = acpi_processor_device_add(handle, &device); result = acpi_processor_device_add(handle, &device);
if (result) { if (result) {
printk(KERN_ERR PREFIX "Unable to add the device\n"); acpi_handle_err(handle, "Unable to add the device\n");
break; break;
} }
...@@ -728,17 +735,19 @@ static void acpi_processor_hotplug_notify(acpi_handle handle, ...@@ -728,17 +735,19 @@ static void acpi_processor_hotplug_notify(acpi_handle handle,
"received ACPI_NOTIFY_EJECT_REQUEST\n")); "received ACPI_NOTIFY_EJECT_REQUEST\n"));
if (acpi_bus_get_device(handle, &device)) { if (acpi_bus_get_device(handle, &device)) {
pr_err(PREFIX "Device don't exist, dropping EJECT\n"); acpi_handle_err(handle,
"Device don't exist, dropping EJECT\n");
break; break;
} }
if (!acpi_driver_data(device)) { if (!acpi_driver_data(device)) {
pr_err(PREFIX "Driver data is NULL, dropping EJECT\n"); acpi_handle_err(handle,
"Driver data is NULL, dropping EJECT\n");
break; break;
} }
ej_event = kmalloc(sizeof(*ej_event), GFP_KERNEL); ej_event = kmalloc(sizeof(*ej_event), GFP_KERNEL);
if (!ej_event) { if (!ej_event) {
pr_err(PREFIX "No memory, dropping EJECT\n"); acpi_handle_err(handle, "No memory, dropping EJECT\n");
break; break;
} }
...@@ -848,7 +857,7 @@ static acpi_status acpi_processor_hotadd_init(struct acpi_processor *pr) ...@@ -848,7 +857,7 @@ static acpi_status acpi_processor_hotadd_init(struct acpi_processor *pr)
* and do it when the CPU gets online the first time * and do it when the CPU gets online the first time
* TBD: Cleanup above functions and try to do this more elegant. * TBD: Cleanup above functions and try to do this more elegant.
*/ */
printk(KERN_INFO "CPU %d got hotplugged\n", pr->id); pr_info("CPU %d got hotplugged\n", pr->id);
pr->flags.need_hotplug_init = 1; pr->flags.need_hotplug_init = 1;
return AE_OK; return AE_OK;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册