aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/processor_core.c53
1 files changed, 32 insertions, 21 deletions
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index 6893c0bffb5..eacf9a25201 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -377,7 +377,7 @@ static int acpi_processor_remove_fs(struct acpi_device *device)
377/* Use the acpiid in MADT to map cpus in case of SMP */ 377/* Use the acpiid in MADT to map cpus in case of SMP */
378 378
379#ifndef CONFIG_SMP 379#ifndef CONFIG_SMP
380#define convert_acpiid_to_cpu(acpi_id) (-1) 380static int get_cpu_id(acpi_handle handle, u32 acpi_id) {return -1;}
381#else 381#else
382 382
383static struct acpi_table_madt *madt; 383static struct acpi_table_madt *madt;
@@ -483,7 +483,7 @@ exit:
483 return apic_id; 483 return apic_id;
484} 484}
485 485
486static int get_apic_id(acpi_handle handle, u32 acpi_id) 486static int get_cpu_id(acpi_handle handle, u32 acpi_id)
487{ 487{
488 int i; 488 int i;
489 int apic_id = -1; 489 int apic_id = -1;
@@ -506,7 +506,7 @@ static int get_apic_id(acpi_handle handle, u32 acpi_id)
506 Driver Interface 506 Driver Interface
507 -------------------------------------------------------------------------- */ 507 -------------------------------------------------------------------------- */
508 508
509static int acpi_processor_get_info(struct acpi_processor *pr) 509static int acpi_processor_get_info(struct acpi_processor *pr, unsigned has_uid)
510{ 510{
511 acpi_status status = 0; 511 acpi_status status = 0;
512 union acpi_object object = { 0 }; 512 union acpi_object object = { 0 };
@@ -535,24 +535,35 @@ static int acpi_processor_get_info(struct acpi_processor *pr)
535 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 535 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
536 "No bus mastering arbitration control\n")); 536 "No bus mastering arbitration control\n"));
537 537
538 /* 538 /* Check if it is a Device with HID and UID */
539 * Evalute the processor object. Note that it is common on SMP to 539 if (has_uid) {
540 * have the first (boot) processor with a valid PBLK address while 540 unsigned long value;
541 * all others have a NULL address. 541 status = acpi_evaluate_integer(pr->handle, METHOD_NAME__UID,
542 */ 542 NULL, &value);
543 status = acpi_evaluate_object(pr->handle, NULL, NULL, &buffer); 543 if (ACPI_FAILURE(status)) {
544 if (ACPI_FAILURE(status)) { 544 printk(KERN_ERR PREFIX "Evaluating processor _UID\n");
545 printk(KERN_ERR PREFIX "Evaluating processor object\n"); 545 return -ENODEV;
546 return -ENODEV; 546 }
547 } 547 pr->acpi_id = value;
548 548 } else {
549 /* 549 /*
550 * TBD: Synch processor ID (via LAPIC/LSAPIC structures) on SMP. 550 * Evalute the processor object. Note that it is common on SMP to
551 * >>> 'acpi_get_processor_id(acpi_id, &id)' in arch/xxx/acpi.c 551 * have the first (boot) processor with a valid PBLK address while
552 */ 552 * all others have a NULL address.
553 pr->acpi_id = object.processor.proc_id; 553 */
554 status = acpi_evaluate_object(pr->handle, NULL, NULL, &buffer);
555 if (ACPI_FAILURE(status)) {
556 printk(KERN_ERR PREFIX "Evaluating processor object\n");
557 return -ENODEV;
558 }
554 559
555 cpu_index = get_apic_id(pr->handle, pr->acpi_id); 560 /*
561 * TBD: Synch processor ID (via LAPIC/LSAPIC structures) on SMP.
562 * >>> 'acpi_get_processor_id(acpi_id, &id)' in arch/xxx/acpi.c
563 */
564 pr->acpi_id = object.processor.proc_id;
565 }
566 cpu_index = get_cpu_id(pr->handle, pr->acpi_id);
556 567
557 /* Handle UP system running SMP kernel, with no LAPIC in MADT */ 568 /* Handle UP system running SMP kernel, with no LAPIC in MADT */
558 if (!cpu0_initialized && (cpu_index == -1) && 569 if (!cpu0_initialized && (cpu_index == -1) &&
@@ -621,7 +632,7 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device)
621 632
622 pr = acpi_driver_data(device); 633 pr = acpi_driver_data(device);
623 634
624 result = acpi_processor_get_info(pr); 635 result = acpi_processor_get_info(pr, device->flags.unique_id);
625 if (result) { 636 if (result) {
626 /* Processor is physically not present */ 637 /* Processor is physically not present */
627 return 0; 638 return 0;