From patchwork Sat Jun 28 01:12:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 4439121 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9AFC69F319 for ; Sat, 28 Jun 2014 01:14:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D900E203AB for ; Sat, 28 Jun 2014 01:14:40 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0A2CE2038C for ; Sat, 28 Jun 2014 01:14:40 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1X0hBw-00017K-NS; Sat, 28 Jun 2014 01:12:32 +0000 Received: from mail-ig0-x234.google.com ([2607:f8b0:4001:c05::234]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1X0hBu-000145-Ap for linux-arm-kernel@lists.infradead.org; Sat, 28 Jun 2014 01:12:30 +0000 Received: by mail-ig0-f180.google.com with SMTP id h18so2557942igc.13 for ; Fri, 27 Jun 2014 18:12:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:to:from:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=Vrh9QlnVQ8eZ1gm2hbcjjnK2yGSVs8zyitvPDcHFkmc=; b=XiD0Gx4vZQS1CtZZzGqS+fKE/2ouHTG4LfmOphT28hVA3b35W3i3lKo2gRj7QGaFuN ErAAwWBAVUohiB1AXQHqiAfifKPCrdb7XPvESCb5FCpB5m1AJovfCo4kVNXOIBGwwvmm ssHiFBy/iI+pMKoc2PUlJ+jQpTzqKsIYqDh+bIDLg0KQkrgBKZHUHHReLBB5lnSFZApm NCpC6MhlRJ/9Q+bRKKaWN3gK7DP2MWHj+3eZ7Uu0ONTV5n0HAVC2NIuO7p8oqqxVctsB jv1u5fYZWp5XWiM1dFqIXQ9LbdD76UyhGE2bscc1r8MUz6J91QKmvRylJkyGR5jB8IKH ap5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:from:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding; bh=Vrh9QlnVQ8eZ1gm2hbcjjnK2yGSVs8zyitvPDcHFkmc=; b=LtVqfgxYEyO46kn4/sfv5N+7j5MHaJ/qYgOT/LkArw9PiEWnoCPOiUXrBzHQRh9G0u kK6/kRf0bZsIYbYux9Wsrm2hwN9IV7gfemJGwp8PCNKpPT6hn0SNKIv8BTriUPeTPnw9 ZQ3H/0n7M7X9rjvptAj5IpmYBPzPSQcroGfJBzRG2LnDBPmiVHNZ1P+ptZ/7Qv3oSXqG m8U4cXlgFryMrX9cMHBnEefew9g6/F75oJfn5YFOUALfRC56girSfVWRY1vRoHTwKlEb IRpIdAbcu12neE0UFvUmeuCrUbJE2muH7UETlMO0jLuCTQ/42eGeufgWx5g1LkZcQVsa V3zA== X-Gm-Message-State: ALoCoQm4mntN7rIsVCgt6W+ahdAviNyd05QMW15G3XfbN4akHWIldH7nF/2HY4xi17OymLGxPfNH X-Received: by 10.50.43.134 with SMTP id w6mr16301584igl.17.1403917929054; Fri, 27 Jun 2014 18:12:09 -0700 (PDT) Received: from localhost ([172.16.48.235]) by mx.google.com with ESMTPSA id aw9sm2083864igc.9.2014.06.27.18.12.08 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 27 Jun 2014 18:12:08 -0700 (PDT) Subject: [PATCH 1/2] arm64: add MIDR to per-CPU information To: Catalin Marinas , Will Deacon From: Bjorn Helgaas Date: Fri, 27 Jun 2014 19:12:06 -0600 Message-ID: <20140628011206.9839.2351.stgit@bhelgaas-glaptop.roam.corp.google.com> In-Reply-To: <20140628010440.9839.9366.stgit@bhelgaas-glaptop.roam.corp.google.com> References: <20140628010440.9839.9366.stgit@bhelgaas-glaptop.roam.corp.google.com> User-Agent: StGit/0.16 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140627_181230_435335_15528DC1 X-CRM114-Status: GOOD ( 13.38 ) X-Spam-Score: -0.1 (/) Cc: linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Save the MIDR of each CPU we bring online instead of assuming they're all the same. Based on e8d432c9cf0a ("ARM: kernel: add MIDR to per-CPU information data"). Signed-off-by: Bjorn Helgaas --- arch/arm64/kernel/setup.c | 13 +++++++------ arch/arm64/kernel/smp.c | 5 +++++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index 46d1125571f6..37cc2bb9f3ae 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c @@ -45,6 +45,7 @@ #include #include +#include #include #include #include @@ -417,16 +418,16 @@ static int __init arm64_device_init(void) } arch_initcall_sync(arm64_device_init); -static DEFINE_PER_CPU(struct cpu, cpu_data); +DEFINE_PER_CPU(struct cpuinfo_arm, cpu_data); static int __init topology_init(void) { - int i; + int cpu; - for_each_possible_cpu(i) { - struct cpu *cpu = &per_cpu(cpu_data, i); - cpu->hotpluggable = 1; - register_cpu(cpu, i); + for_each_possible_cpu(cpu) { + struct cpuinfo_arm *cpuinfo = &per_cpu(cpu_data, cpu); + cpuinfo->cpu.hotpluggable = 1; + register_cpu(&cpuinfo->cpu, cpu); } return 0; diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index 40f38f46c8e0..c69963496dc6 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -39,6 +39,7 @@ #include #include +#include #include #include #include @@ -118,6 +119,10 @@ int __cpu_up(unsigned int cpu, struct task_struct *idle) static void smp_store_cpu_info(unsigned int cpuid) { + struct cpuinfo_arm *cpu_info = &per_cpu(cpu_data, cpuid); + + cpu_info->cpuid = read_cpuid_id(); + store_cpu_topology(cpuid); }