From: Alex Chiang on
Now that the early _PDC evaluation path knows how to correctly
evaluate _PDC on only physically present processors, there's no
need for the processor driver to evaluate it later when it loads.

To cover the hotplug case, push _PDC evaluation down into the
hotplug paths.

Cc: x86(a)kernel.org
Cc: Tony Luck <tony.luck(a)intel.com>
Acked-by: Venkatesh Pallipadi <venkatesh.pallipadi(a)intel.com>
Signed-off-by: Alex Chiang <achiang(a)hp.com>
---

arch/ia64/kernel/acpi.c | 3 +++
arch/x86/kernel/acpi/boot.c | 3 +++
drivers/acpi/processor_core.c | 7 -------
drivers/acpi/processor_driver.c | 3 ---
4 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
index 40574ae..394742a 100644
--- a/arch/ia64/kernel/acpi.c
+++ b/arch/ia64/kernel/acpi.c
@@ -44,6 +44,7 @@
#include <linux/efi.h>
#include <linux/mmzone.h>
#include <linux/nodemask.h>
+#include <acpi/processor.h>
#include <asm/io.h>
#include <asm/iosapic.h>
#include <asm/machvec.h>
@@ -936,6 +937,8 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu)
cpu_set(cpu, cpu_present_map);
ia64_cpu_to_sapicid[cpu] = physid;

+ acpi_processor_set_pdc(handle);
+
*pcpu = cpu;
return (0);
}
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 97229f3..124de35 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -480,6 +480,7 @@ int acpi_register_gsi(struct device *dev, u32 gsi, int trigger, int polarity)
* ACPI based hotplug support for CPU
*/
#ifdef CONFIG_ACPI_HOTPLUG_CPU
+#include <acpi/processor.h>

static int __cpuinit _acpi_map_lsapic(acpi_handle handle, int *pcpu)
{
@@ -538,6 +539,8 @@ static int __cpuinit _acpi_map_lsapic(acpi_handle handle, int *pcpu)
goto free_new_map;
}

+ acpi_processor_set_pdc(handle);
+
cpu = cpumask_first(new_map);

*pcpu = cpu;
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index ef34faa..626c754 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -317,8 +317,6 @@ acpi_processor_eval_pdc(acpi_handle handle, struct acpi_object_list *pdc_in)
return status;
}

-static int early_pdc_done;
-
void acpi_processor_set_pdc(acpi_handle handle)
{
struct acpi_object_list *obj_list;
@@ -326,9 +324,6 @@ void acpi_processor_set_pdc(acpi_handle handle)
if (arch_has_acpi_pdc() == false)
return;

- if (early_pdc_done)
- return;
-
obj_list = acpi_processor_alloc_pdc();
if (!obj_list)
return;
@@ -369,6 +364,4 @@ void __init acpi_early_processor_set_pdc(void)
acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX,
early_init_pdc, NULL, NULL, NULL);
-
- early_pdc_done = 1;
}
diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
index 777d046..7e8e1ba 100644
--- a/drivers/acpi/processor_driver.c
+++ b/drivers/acpi/processor_driver.c
@@ -606,9 +606,6 @@ static int __cpuinit acpi_processor_add(struct acpi_device *device)
goto err_remove_fs;
}

- /* _PDC call should be done before doing anything else (if reqd.). */
- acpi_processor_set_pdc(pr->handle);
-
#ifdef CONFIG_CPU_FREQ
acpi_processor_ppc_has_changed(pr, 0);
#endif

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/