]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[IA64] Provide ACPI fixup for /proc/cpuinfo/physical_id
authorAlex Chiang <achiang@hp.com>
Tue, 29 Apr 2008 22:05:29 +0000 (15:05 -0700)
committerTony Luck <tony.luck@intel.com>
Tue, 29 Apr 2008 22:05:29 +0000 (15:05 -0700)
Legacy HP ia64 platforms currently cannot provide
/proc/cpuinfo/physical_id due to legacy SAL/PAL implementations.
However, that physical topology information can be obtained
via ACPI.

Provide an interface that gives ACPI one last chance to provide
physical_id for these legacy platforms. This logic only comes
into play iff:

- ACPI actually provides slot information for the CPU
- we lack a valid socket_id

Otherwise, we don't do anything.

Since x86 uses the ACPI processor driver as well, we provide a nop
stub function for arch_fix_phys_package_id() in asm-x86/topology.h

Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
arch/ia64/kernel/topology.c
drivers/acpi/processor_core.c
include/asm-ia64/topology.h
include/asm-x86/topology.h

index a2484fc1a06c43482e575888ca1991d45faf43e7..abb17a613b172f2feac86f38981c255d226864ac 100644 (file)
 
 static struct ia64_cpu *sysfs_cpus;
 
+void arch_fix_phys_package_id(int num, u32 slot)
+{
+#ifdef CONFIG_SMP
+       if (cpu_data(num)->socket_id == -1)
+               cpu_data(num)->socket_id = slot;
+#endif
+}
+EXPORT_SYMBOL_GPL(arch_fix_phys_package_id);
+
 int arch_register_cpu(int num)
 {
 #if defined (CONFIG_ACPI) && defined (CONFIG_HOTPLUG_CPU)
index dd28c912e84f7a0927f7b3148dee47f3c8404e72..5241e3ff50803f6048e5084f6c3135678f7465b2 100644 (file)
@@ -603,6 +603,15 @@ static int acpi_processor_get_info(struct acpi_processor *pr, unsigned has_uid)
                request_region(pr->throttling.address, 6, "ACPI CPU throttle");
        }
 
+       /*
+        * If ACPI describes a slot number for this CPU, we can use it
+        * ensure we get the right value in the "physical id" field
+        * of /proc/cpuinfo
+        */
+       status = acpi_evaluate_object(pr->handle, "_SUN", NULL, &buffer);
+       if (ACPI_SUCCESS(status))
+               arch_fix_phys_package_id(pr->id, object.integer.value);
+
        return 0;
 }
 
index f2f72ef2a8974cc3496dc0fd92435626f708a7e8..32863b3bb1d3e9bdd8cba30a5eb3356b3cbbb467 100644 (file)
@@ -116,6 +116,8 @@ void build_cpu_to_node_map(void);
 #define smt_capable()                          (smp_num_siblings > 1)
 #endif
 
+extern void arch_fix_phys_package_id(int num, u32 slot);
+
 #define pcibus_to_cpumask(bus) (pcibus_to_node(bus) == -1 ? \
                                        CPU_MASK_ALL : \
                                        node_to_cpumask(pcibus_to_node(bus)) \
index 0e6d6b03affe13071ab3f6da6b5ffa7b369a0766..4f35a0fb4f22ac5ba6d459a45f4eb8971eb50cac 100644 (file)
@@ -193,6 +193,10 @@ extern cpumask_t cpu_coregroup_map(int cpu);
 #define topology_thread_siblings(cpu)          (per_cpu(cpu_sibling_map, cpu))
 #endif
 
+static inline void arch_fix_phys_package_id(int num, u32 slot)
+{
+}
+
 struct pci_bus;
 void set_pci_bus_resources_arch_default(struct pci_bus *b);