Alucard

patch

Jan 31st, 2012
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. --- a/drivers/acpi/processor_core.c
  2. +++ b/drivers/acpi/processor_core.c
  3. @@ -173,8 +173,30 @@ int acpi_get_cpuid(acpi_handle handle, int type, u32 acpi_id)
  4. apic_id = map_mat_entry(handle, type, acpi_id);
  5. if (apic_id == -1)
  6. apic_id = map_madt_entry(type, acpi_id);
  7. - if (apic_id == -1)
  8. - return apic_id;
  9. + if (apic_id == -1) {
  10. + /*
  11. + * On UP processor, there is no _MAT or MADT table.
  12. + * So above apic_id is always set to -1.
  13. + *
  14. + * BIOS may define multiple CPU handles even for UP processor.
  15. + * For example,
  16. + *
  17. + * Scope (_PR)
  18. + * {
  19. + * Processor (CPU0, 0x00, 0x00000410, 0x06) {}
  20. + * Processor (CPU1, 0x01, 0x00000410, 0x06) {}
  21. + * Processor (CPU2, 0x02, 0x00000410, 0x06) {}
  22. + * Processor (CPU3, 0x03, 0x00000410, 0x06) {}
  23. + * }
  24. + *
  25. + * Ignores apic_id and always return 0 for CPU0's handle.
  26. + * Return -1 for other CPU's handle.
  27. + */
  28. + if (acpi_id == 0)
  29. + return acpi_id;
  30. + else
  31. + return apic_id;
  32. + }
  33. #ifdef CONFIG_SMP
  34. for_each_possible_cpu(i) {
Advertisement
Add Comment
Please, Sign In to add comment