Re: ACPI "_PDC" - acpi_processor_set_pdc()- execution regression -Linux-3.x

From: Lin Ming
Date: Sun Dec 11 2011 - 21:38:35 EST


On Mon, 2011-12-12 at 10:26 +0800, Lin Ming wrote:
> ---------- Forwarded message ----------
> From: <wallak@xxxxxxx>
> Date: Thu, Dec 8, 2011 at 6:38 AM
> Subject: ACPI "_PDC" - acpi_processor_set_pdc()- execution regression
> - Linux-3.x
> To: linux-kernel@xxxxxxxxxxxxxxx
>
>
> We have a regression on the ACPI stack of the last linux kernel line 3.x (3.1.4,
> 3.2-rc4...). The ACPI "_PDC" chunk is not executed on some computers (e.g. Dell
> X300; the function acpi_processor_set_pdc() is not called). This issue yield to
> an uninitialized state of some ACPI variables.
>
> A patch is available below. This patch come back to the previous linux behavior,
> and works fine.
>
> Best Regards,
> Wallak.
>
> --- linux-3.1.4-mdf/drivers/acpi/processor_core.c.orig 2011-12-07
> 23:12:57.000000000 +0100
> +++ linux-3.1.4-mdf/drivers/acpi/processor_core.c 2011-12-07
> 23:13:39.000000000 +0100
> @@ -223,8 +223,8 @@
> type = (acpi_type == ACPI_TYPE_DEVICE) ? 1 : 0;
> cpuid = acpi_get_cpuid(handle, type, acpi_id);
>
> - if (cpuid == -1)
> - return false;
> + if ((cpuid == -1) && (num_possible_cpus() > 1))

Hi Wallak,

BIOS may define multiple CPU handles even for UP
processor(see below).

processor_physically_present(acpi_handle handle) will be called for each
CPU handles.

We should only return valid value for CPU0 on UP processor.
With your patch, processor_physically_present will return true for all
CPU handles(CPU0, CPU1, CPU2, CPU3). This is not we want.

I think below is the correct fix.
Could you help to test it?

Thanks.