Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759086AbaGXNBf (ORCPT ); Thu, 24 Jul 2014 09:01:35 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:52566 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759057AbaGXNBa (ORCPT ); Thu, 24 Jul 2014 09:01:30 -0400 From: Hanjun Guo To: Catalin Marinas , "Rafael J. Wysocki" , Mark Rutland Cc: Graeme Gregory , Arnd Bergmann , Grant Likely , Sudeep Holla , Will Deacon , Jason Cooper , Marc Zyngier , Bjorn Helgaas , Daniel Lezcano , Mark Brown , Robert Richter , Lv Zheng , Robert Moore , Lorenzo Pieralisi , Liviu Dudau , Randy Dunlap , Charles.Garcia-Tobin@arm.com, linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linaro-acpi-private@linaro.org, Hanjun Guo Subject: [PATCH 04/19] ARM64 / ACPI: Introduce arch_fix_phys_package_id() for cpu topology Date: Thu, 24 Jul 2014 21:00:10 +0800 Message-Id: <1406206825-15590-5-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1406206825-15590-1-git-send-email-hanjun.guo@linaro.org> References: <1406206825-15590-1-git-send-email-hanjun.guo@linaro.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org arch_fix_phys_package_id() will be called in ACPI core to use the slot number provided by ACPI to update the physical package id, then we can get the right value in the "physical id" field of /proc/cpuinfo. Signed-off-by: Hanjun Guo --- arch/arm64/include/asm/topology.h | 2 ++ arch/arm64/kernel/topology.c | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/arch/arm64/include/asm/topology.h b/arch/arm64/include/asm/topology.h index 7ebcd31..2b216d4 100644 --- a/arch/arm64/include/asm/topology.h +++ b/arch/arm64/include/asm/topology.h @@ -23,11 +23,13 @@ extern struct cpu_topology cpu_topology[NR_CPUS]; void init_cpu_topology(void); void store_cpu_topology(unsigned int cpuid); const struct cpumask *cpu_coregroup_mask(int cpu); +void arch_fix_phys_package_id(int num, u32 slot); #else static inline void init_cpu_topology(void) { } static inline void store_cpu_topology(unsigned int cpuid) { } +static inline void arch_fix_phys_package_id(int num, u32 slot) { } #endif diff --git a/arch/arm64/kernel/topology.c b/arch/arm64/kernel/topology.c index 43514f9..c547885 100644 --- a/arch/arm64/kernel/topology.c +++ b/arch/arm64/kernel/topology.c @@ -281,3 +281,17 @@ void __init init_cpu_topology(void) if (parse_dt_topology()) reset_cpu_topology(); } + +/* + * Use the CPU slot number provided by ACPI to update the physical + * package id when cpuid_topo->cluster_id is not available, then we + * can get the right value in the "physical id" field of /proc/cpuinfo. + */ +void arch_fix_phys_package_id(int num, u32 slot) +{ + struct cpu_topology *cpuid_topo = &cpu_topology[num]; + + if (cpuid_topo->cluster_id == -1) + cpuid_topo->cluster_id = slot; +} +EXPORT_SYMBOL_GPL(arch_fix_phys_package_id); -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/