From patchwork Fri Jun 27 03:49:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 32609 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f70.google.com (mail-pa0-f70.google.com [209.85.220.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5807C201EF for ; Fri, 27 Jun 2014 03:52:33 +0000 (UTC) Received: by mail-pa0-f70.google.com with SMTP id lj1sf17815904pab.9 for ; Thu, 26 Jun 2014 20:52:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=bQ7s6YT9qbkN71dR6snDAhYI/LCcS/WLlnQOiwly0FQ=; b=EXRfszlEStvFpcggY45IbL3wNHjCSaJKHsoMHxEtHY+kI1hH47iZUQuaxXkyrYHyE2 oeok+EKGBy9HI/RJBTN2Dm7CgMqIKBMCgaWdXc6bhpFKFmB3546cQpISlr+7D6Es3ckC g+Vb2au6ab4Cb06dSErXFW5PNvWyEg3Or9en70FaCUjSwqZacp0mPHdqkdfZgsr8yVO8 FzQ8a5png1Cu25WTNyKaqKuxLKEU/kewkTzmTkD6iBFrkgQuc9nJn1exx6PhordAHFNu T9pubP/zAxuQDaT7sR9PkpKVqVBqwAhsOtn3YTXZmoPxpS6ClcJ+oi4rusYxONQ4GN3m NUoA== X-Gm-Message-State: ALoCoQl6StuZzlcOE++lTz8bmkHvytGClz+E3j8BUnNUW1yE/tRbrmrlHe3dRWXjnsUNTT+7mNR9 X-Received: by 10.66.231.68 with SMTP id te4mr10788403pac.29.1403841152629; Thu, 26 Jun 2014 20:52:32 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.104.177 with SMTP id a46ls463660qgf.7.gmail; Thu, 26 Jun 2014 20:52:32 -0700 (PDT) X-Received: by 10.52.159.226 with SMTP id xf2mr14831371vdb.14.1403841152468; Thu, 26 Jun 2014 20:52:32 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id eh6si5714235vcb.78.2014.06.26.20.52.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 26 Jun 2014 20:52:32 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.177 as permitted sender) client-ip=209.85.220.177; Received: by mail-vc0-f177.google.com with SMTP id ij19so4462736vcb.22 for ; Thu, 26 Jun 2014 20:52:32 -0700 (PDT) X-Received: by 10.220.253.132 with SMTP id na4mr962843vcb.39.1403841152362; Thu, 26 Jun 2014 20:52:32 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp77072vcb; Thu, 26 Jun 2014 20:52:31 -0700 (PDT) X-Received: by 10.68.136.5 with SMTP id pw5mr27336704pbb.106.1403841151598; Thu, 26 Jun 2014 20:52:31 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id sg10si12382960pbb.249.2014.06.26.20.52.30; Thu, 26 Jun 2014 20:52:31 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752840AbaF0DwX (ORCPT + 27 others); Thu, 26 Jun 2014 23:52:23 -0400 Received: from mail-pb0-f54.google.com ([209.85.160.54]:57055 "EHLO mail-pb0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752812AbaF0DwU (ORCPT ); Thu, 26 Jun 2014 23:52:20 -0400 Received: by mail-pb0-f54.google.com with SMTP id un15so3997830pbc.41 for ; Thu, 26 Jun 2014 20:52:20 -0700 (PDT) X-Received: by 10.69.20.74 with SMTP id ha10mr27225454pbd.127.1403841139714; Thu, 26 Jun 2014 20:52:19 -0700 (PDT) Received: from localhost ([183.247.163.231]) by mx.google.com with ESMTPSA id ln2sm44312158pab.35.2014.06.26.20.52.15 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 26 Jun 2014 20:52:19 -0700 (PDT) From: Hanjun Guo To: "Rafael J. Wysocki" , Catalin Marinas , linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Arnd Bergmann , Bjorn Helgaas , rric@kernel.org, Grant Likely , Sudeep Holla , Mark Rutland , Charles.Garcia-Tobin@arm.com, lorenzo.pieralisi@arm.com, linaro-acpi@lists.linaro.org, Hanjun Guo Subject: [PATCH v4 08/13] ARM64 / ACPI: Introduce arch_fix_phys_package_id() for cpu topology Date: Fri, 27 Jun 2014 11:49:31 +0800 Message-Id: <1403840976-7456-9-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1403840976-7456-1-git-send-email-hanjun.guo@linaro.org> References: <1403840976-7456-1-git-send-email-hanjun.guo@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: hanjun.guo@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.177 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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. Reviewed-by: Grant Likely 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);