ACPI: processor: fix acpi_get_cpuid for UP processor
commit68e6689b9b35c8a2fa73e00947238d2c5cb0387c
authorLin Ming <ming.m.lin@intel.com>
Tue, 13 Dec 2011 01:36:03 +0000 (13 09:36 +0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 26 Jan 2012 01:24:59 +0000 (25 17:24 -0800)
tree1a25d95e681074d2e507326a0e06a3e9dfd67ab0
parent55bd02eb4c6e40c2870aee19c5e36d1a85713be8
ACPI: processor: fix acpi_get_cpuid for UP processor

commit d640113fe80e45ebd4a5b420b220d3f6bf37f682 upstream.

For UP processor, it is likely that no _MAT method or MADT table defined.
So currently acpi_get_cpuid(...) always return -1 for UP processor.
This is wrong. It should return valid value for CPU0.

In the other hand, BIOS may define multiple CPU handles even for UP
processor, for example

        Scope (_PR)
        {
            Processor (CPU0, 0x00, 0x00000410, 0x06) {}
            Processor (CPU1, 0x01, 0x00000410, 0x06) {}
            Processor (CPU2, 0x02, 0x00000410, 0x06) {}
            Processor (CPU3, 0x03, 0x00000410, 0x06) {}
        }

We should only return valid value for CPU0's acpi handle.
And return invalid value for others.

http://marc.info/?t=132329819900003&r=1&w=2

Reported-and-tested-by: wallak@free.fr
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/acpi/processor_core.c