From patchwork Fri Apr 25 13:20:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 29078 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f72.google.com (mail-qa0-f72.google.com [209.85.216.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 69AD8202E6 for ; Fri, 25 Apr 2014 13:23:35 +0000 (UTC) Received: by mail-qa0-f72.google.com with SMTP id hw13sf11315181qab.7 for ; Fri, 25 Apr 2014 06:23:35 -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=9l51Z3CYezMdSz+J/8M7UYUB8feFarwt9OBtLoyRAl8=; b=hHX8oRngthoAAti5xUO9Ci5lT2nbmB6Gi6xBTPurzy47tBBQrPsntxF4bP9hp8SdPR CLaVkePFRDa4c1+6udBkb56PM7CZ3PML9yzwEHrqm9kq1fG1B3nfenlGpUkrlW5KF/CB f+RIoG17lbK3N+7GBcK963TFp6DkxevX5kMdhf5/hi6fwjcIF/VfSTBsBPV3u1KsJRu7 3KRuUopMWb4oYHhqm1n2h0/Abf8wRbqBHGN9VqsUKTZkyOUJ9Aa0A/hhhBftQVNK4v7X wkVB4vgp3Lof4PqJXzPQZSREyCkbv5I4epbxknG2icST7eYFrhR6JfhRpQLIA4h+j0BY iZQw== X-Gm-Message-State: ALoCoQkHjIAoJnVdxN/4aVUWQpJOlEGf/72U4AVUQxEaUYSqm0GXMbd1VN+FbvpPKCAJCjRWnfME X-Received: by 10.236.209.97 with SMTP id r61mr1686726yho.33.1398432215068; Fri, 25 Apr 2014 06:23:35 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.51.132 with SMTP id u4ls264164qga.36.gmail; Fri, 25 Apr 2014 06:23:34 -0700 (PDT) X-Received: by 10.52.130.225 with SMTP id oh1mr5724755vdb.8.1398432214744; Fri, 25 Apr 2014 06:23:34 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id k2si506822vcz.206.2014.04.25.06.23.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 25 Apr 2014 06:23:34 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id lh14so4691786vcb.34 for ; Fri, 25 Apr 2014 06:23:34 -0700 (PDT) X-Received: by 10.52.166.18 with SMTP id zc18mr39156vdb.65.1398432214670; Fri, 25 Apr 2014 06:23:34 -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.220.221.72 with SMTP id ib8csp97406vcb; Fri, 25 Apr 2014 06:23:34 -0700 (PDT) X-Received: by 10.68.254.5 with SMTP id ae5mr7725482pbd.83.1398432213974; Fri, 25 Apr 2014 06:23:33 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qd9si4861087pac.64.2014.04.25.06.23.33; Fri, 25 Apr 2014 06:23:33 -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 S1753924AbaDYNX3 (ORCPT + 8 others); Fri, 25 Apr 2014 09:23:29 -0400 Received: from mail-pd0-f181.google.com ([209.85.192.181]:36815 "EHLO mail-pd0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752622AbaDYNX0 (ORCPT ); Fri, 25 Apr 2014 09:23:26 -0400 Received: by mail-pd0-f181.google.com with SMTP id w10so3097912pde.26 for ; Fri, 25 Apr 2014 06:23:26 -0700 (PDT) X-Received: by 10.67.29.131 with SMTP id jw3mr7791535pad.141.1398432206566; Fri, 25 Apr 2014 06:23:26 -0700 (PDT) Received: from localhost ([218.17.215.175]) by mx.google.com with ESMTPSA id sv10sm15932343pbc.74.2014.04.25.06.23.17 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 25 Apr 2014 06:23:25 -0700 (PDT) From: Hanjun Guo To: linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org Cc: "Rafael J. Wysocki" , Catalin Marinas , Arnd Bergmann , Mark Brown , Grant Likely , Sudeep Holla , Olof Johansson , Mark Rutland , Rob Herring , Will Deacon , Charles.Garcia-Tobin@arm.com, linaro-acpi@lists.linaro.org, Hanjun Guo Subject: [PATCH v3 part1 07/11] ARM64 / ACPI: Introduce arch_fix_phys_package_id() for cpu topology Date: Fri, 25 Apr 2014 21:20:13 +0800 Message-Id: <1398432017-8506-8-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1398432017-8506-1-git-send-email-hanjun.guo@linaro.org> References: <1398432017-8506-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=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) 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 0172e6d..0b0e24f 100644 --- a/arch/arm64/include/asm/topology.h +++ b/arch/arm64/include/asm/topology.h @@ -26,11 +26,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 3e06b0b..51ea4a1 100644 --- a/arch/arm64/kernel/topology.c +++ b/arch/arm64/kernel/topology.c @@ -93,3 +93,17 @@ void __init init_cpu_topology(void) cpumask_clear(&cpu_topo->thread_sibling); } } + +/* + * Use the CPU 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. + */ +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);