Re: [PATCH] ACPI/Processor: Fix failure of loading acpi-cpufreq driver

2014-04-29 Thread Lan Tianyu
On 2014年04月30日 13:16, Jiang Liu wrote: > Hi Tianyu, > Found another issue at the second glance. > In case of x2apic, "if (apic_id < 0)" should be replaced > by "if (apic_id == -1)" for safety. Hi Jiang: Thanks for suggestion. I will update soon. > Best Regards! > Gerry > >

Re: [PATCH] ACPI/Processor: Fix failure of loading acpi-cpufreq driver

2014-04-29 Thread Jiang Liu
Hi Tianyu, Found another issue at the second glance. In case of x2apic, "if (apic_id < 0)" should be replaced by "if (apic_id == -1)" for safety. Best Regards! Gerry On 2014/4/30 13:08, Jiang Liu wrote: > Hi Tianyu, > With the suggested fix, we still need to protect > acpi_processor_

Re: [PATCH] ACPI/Processor: Fix failure of loading acpi-cpufreq driver

2014-04-29 Thread Jiang Liu
Hi Tianyu, With the suggested fix, we still need to protect acpi_processor_hotadd_init() when pr->apic_id is -1, otherwise it may cause invalid memory access. Best Regards! Gerry diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c index c29c2c3ec0ad..e17befc54c34 10

[PATCH] ACPI/Processor: Fix failure of loading acpi-cpufreq driver

2014-04-29 Thread Lan Tianyu
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 equ