ACPI / processor: Fix failure of loading acpi-cpufreq driver
authorLan Tianyu <tianyu.lan@intel.com>
Wed, 30 Apr 2014 07:46:33 +0000 (15:46 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 May 2014 11:32:57 +0000 (13:32 +0200)
commitd79e8d496977266cbae7d14457e2a1e7aeeab78f
tree57c93d164d79cd5a9f461be13941eb0cd8683271
parent41cc996c022af590ff59971b37572d5a82c95955
ACPI / processor: Fix failure of loading acpi-cpufreq driver

commit 4985c32ee4241d1aba1beeac72294faa46aaff10 upstream.

According commit d640113fe (ACPI: processor: fix acpi_get_cpuid for UP
processor),  BIOS may not provide _MAT or MADT tables and acpi_get_apicid()
always returns -1. For these cases, original code will pass apic_id with
vaule of -1 to acpi_map_cpuid() and it will check the acpi_id. If acpi_id
is equal to zero, ignores apic_id and return zero for CPU0.

Commit b981513 (ACPI / scan: bail out early if failed to parse APIC
ID for CPU) changed the behavior. Return ENODEV when find apic_id is
less than zero after calling acpi_get_apicid(). This causes acpi-cpufreq
driver fails to be loaded on some machines. This patch is to fix it.

Fixes: b981513f806d (ACPI / scan: bail out early if failed to parse APIC ID for CPU)
References: https://bugzilla.kernel.org/show_bug.cgi?id=73781
Reported-and-tested-by: KATO Hiroshi <katoh@mikage.ne.jp>
Reported-and-tested-by: Stuart Foster <smf.linux@ntlworld.com>
Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/acpi/acpi_processor.c