From patchwork Thu Jul 24 13:00:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 34205 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3A85220C7F for ; Thu, 24 Jul 2014 13:01:41 +0000 (UTC) Received: by mail-wi0-f199.google.com with SMTP id hi2sf2696244wib.6 for ; Thu, 24 Jul 2014 06:01:40 -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=NbX2tcn/xes7aLsIuGes+wcM7NkyxGm901Qyw0cdnEU=; b=c1l4tX77SWn6UoBh32vY/vElC13v1QIXgFpeZtvxUqrg9eAxolzpE4YQlYnbwDLV3Q ciwRgNMLIeSeDaL/Xawln2SS+SmSz8rRe/rBObsIqEyMjOaY4vcKVeVHqfUbIvzWLEWM 6SDYc1kB4ztAZEXO2EnGFi8By/zfQq37/jPI6wLU4SmSzAyTZHCm4DHnG/u6i6cWFA6A mPjeV51doV+t+FByz68yx2ILc3lRN5Oml/gY9K55H+GqtavkER/pfhhWmmlkJB7V3sKO mFyJAnbUs1C+L3roU5ZJr5jNQ5IxgIk7gqbgrvMa9lLlK9HoX3FMmEr169K9wtCmhsas MWTg== X-Gm-Message-State: ALoCoQkcKRYO8KjXHxrm+YA8+ZAboTFMd+64dpKpZ07l/LOwxhh8fNERv9vHua3CZwNoZRICy3Py X-Received: by 10.180.85.39 with SMTP id e7mr3330815wiz.0.1406206899775; Thu, 24 Jul 2014 06:01:39 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.36.37 with SMTP id o34ls752058qgo.67.gmail; Thu, 24 Jul 2014 06:01:39 -0700 (PDT) X-Received: by 10.52.0.177 with SMTP id 17mr10192119vdf.12.1406206898485; Thu, 24 Jul 2014 06:01:38 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id py5si4870364vec.57.2014.07.24.06.01.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 24 Jul 2014 06:01:37 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.182 as permitted sender) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id hy4so4944105vcb.27 for ; Thu, 24 Jul 2014 06:01:37 -0700 (PDT) X-Received: by 10.52.120.38 with SMTP id kz6mr9989697vdb.86.1406206897203; Thu, 24 Jul 2014 06:01:37 -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 tc5csp362826vcb; Thu, 24 Jul 2014 06:01:36 -0700 (PDT) X-Received: by 10.70.118.5 with SMTP id ki5mr10147514pdb.104.1406206896194; Thu, 24 Jul 2014 06:01:36 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id do1si2984354pdb.111.2014.07.24.06.01.35 for ; Thu, 24 Jul 2014 06:01:36 -0700 (PDT) Received-SPF: none (google.com: linux-acpi-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 S1759062AbaGXNBc (ORCPT + 8 others); Thu, 24 Jul 2014 09:01:32 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:56256 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759055AbaGXNBa (ORCPT ); Thu, 24 Jul 2014 09:01:30 -0400 Received: by mail-pa0-f50.google.com with SMTP id et14so3922459pad.9 for ; Thu, 24 Jul 2014 06:01:30 -0700 (PDT) X-Received: by 10.70.65.100 with SMTP id w4mr9848223pds.128.1406206889113; Thu, 24 Jul 2014 06:01:29 -0700 (PDT) Received: from localhost ([183.247.163.231]) by mx.google.com with ESMTPSA id t12sm7378359pdj.12.2014.07.24.06.01.21 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 24 Jul 2014 06:01:27 -0700 (PDT) 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-acpi-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-acpi@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.182 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. 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);