Commit 4a35a46bf1cda4737c428380d1db5d15e2590d18

Authored by Len Brown
1 parent 2413d2c12c

[ACPI] revert bad processor_core.c patch for bug 5128

Signed-off-by: Len Brown <len.brown@intel.com>

Showing 1 changed file with 10 additions and 13 deletions Side-by-side Diff

drivers/acpi/processor_core.c
... ... @@ -400,7 +400,7 @@
400 400  
401 401 /* Use the acpiid in MADT to map cpus in case of SMP */
402 402 #ifndef CONFIG_SMP
403   -#define convert_acpiid_to_cpu(acpi_id, cpu_indexp) (0xff)
  403 +#define convert_acpiid_to_cpu(acpi_id) (0xff)
404 404 #else
405 405  
406 406 #ifdef CONFIG_IA64
407 407  
408 408  
... ... @@ -413,20 +413,18 @@
413 413 #define ARCH_BAD_APICID (0xff)
414 414 #endif
415 415  
416   -static int convert_acpiid_to_cpu(u8 acpi_id, unsigned int *cpu_index)
  416 +static u8 convert_acpiid_to_cpu(u8 acpi_id)
417 417 {
418 418 u16 apic_id;
419   - unsigned int i;
  419 + int i;
420 420  
421 421 apic_id = arch_acpiid_to_apicid[acpi_id];
422 422 if (apic_id == ARCH_BAD_APICID)
423 423 return -1;
424 424  
425 425 for (i = 0; i < NR_CPUS; i++) {
426   - if (arch_cpu_to_apicid[i] == apic_id) {
427   - *cpu_index = i;
428   - return 0;
429   - }
  426 + if (arch_cpu_to_apicid[i] == apic_id)
  427 + return i;
430 428 }
431 429 return -1;
432 430 }
... ... @@ -441,8 +439,7 @@
441 439 acpi_status status = 0;
442 440 union acpi_object object = { 0 };
443 441 struct acpi_buffer buffer = { sizeof(union acpi_object), &object };
444   - unsigned int cpu_index;
445   - int retval;
  442 + u8 cpu_index;
446 443 static int cpu0_initialized;
447 444  
448 445 ACPI_FUNCTION_TRACE("acpi_processor_get_info");
449 446  
... ... @@ -485,10 +482,10 @@
485 482 */
486 483 pr->acpi_id = object.processor.proc_id;
487 484  
488   - retval = convert_acpiid_to_cpu(pr->acpi_id, &cpu_index);
  485 + cpu_index = convert_acpiid_to_cpu(pr->acpi_id);
489 486  
490 487 /* Handle UP system running SMP kernel, with no LAPIC in MADT */
491   - if (!cpu0_initialized && retval &&
  488 + if (!cpu0_initialized && (cpu_index == 0xff) &&
492 489 (num_online_cpus() == 1)) {
493 490 cpu_index = 0;
494 491 }
495 492  
... ... @@ -502,10 +499,10 @@
502 499 * less than the max # of CPUs. They should be ignored _iff
503 500 * they are physically not present.
504 501 */
505   - if (retval) {
  502 + if (cpu_index >= NR_CPUS) {
506 503 if (ACPI_FAILURE
507 504 (acpi_processor_hotadd_init(pr->handle, &pr->id))) {
508   - ACPI_DEBUG_PRINT((ACPI_DB_INFO,
  505 + ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
509 506 "Error getting cpuindex for acpiid 0x%x\n",
510 507 pr->acpi_id));
511 508 return_VALUE(-ENODEV);