From patchwork Tue Feb 11 17:10:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Moll X-Patchwork-Id: 24480 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f70.google.com (mail-pb0-f70.google.com [209.85.160.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EDE03203F3 for ; Tue, 11 Feb 2014 17:12:04 +0000 (UTC) Received: by mail-pb0-f70.google.com with SMTP id rq2sf17257457pbb.9 for ; Tue, 11 Feb 2014 09:12:04 -0800 (PST) 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=o+rsoC3zsC9ZMAO+TFwCqKiDnPoZxvrXs2pkBS67Rlo=; b=lNWC7DdZAuFBj4wVm6JWEEQQZby2rfpKIfkCmvcK+TkKQjUAFudJ4vPA5chcFlDc+J HL6KIq6Zd0zgMIFe9NOX8pneJ5Gy6bDAjtlSW27x3Q9wSrN7qNto0Ht7IB07ExqH8h3w oD/9TTU1CSX4JsAnNUlREsHYWsr0275UROBoC3BKqmcOKAONegAAT6AuxAry+Y4MORyb lrCdTS80+6Uy9EOH0L08W4zsjGkEGQIOuoUlIqn0GsaMj4Oq7kQv8odidS9WOFlpAHfG 8K3LLZ5/LXyCtznRl35pv+5OzXRqCtg7FRTOtxaOyC9xQMNmcGK3KnYWLI0A0ryGzzcb Dv6g== X-Gm-Message-State: ALoCoQmfDV3W3OyiiFoMOf5tihCFCxqOHiXbeOwc85KfkbKmZZRiZNCVjDlQr2878YLplpB9BF8x X-Received: by 10.66.250.200 with SMTP id ze8mr145529pac.29.1392138723935; Tue, 11 Feb 2014 09:12:03 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.50.5 with SMTP id r5ls2388568qga.22.gmail; Tue, 11 Feb 2014 09:12:03 -0800 (PST) X-Received: by 10.58.12.132 with SMTP id y4mr164621veb.66.1392138723807; Tue, 11 Feb 2014 09:12:03 -0800 (PST) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id y3si6120712vdo.110.2014.02.11.09.12.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 11 Feb 2014 09:12:03 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.173; Received: by mail-vc0-f173.google.com with SMTP id ld13so6004264vcb.4 for ; Tue, 11 Feb 2014 09:12:03 -0800 (PST) X-Received: by 10.58.219.1 with SMTP id pk1mr195130vec.49.1392138723714; Tue, 11 Feb 2014 09:12:03 -0800 (PST) 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.174.196 with SMTP id u4csp262279vcz; Tue, 11 Feb 2014 09:12:03 -0800 (PST) X-Received: by 10.66.118.71 with SMTP id kk7mr33692240pab.14.1392138722720; Tue, 11 Feb 2014 09:12:02 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cf2si19620280pad.227.2014.02.11.09.12.01; Tue, 11 Feb 2014 09:12:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752618AbaBKRLt (ORCPT + 27 others); Tue, 11 Feb 2014 12:11:49 -0500 Received: from fw-tnat.austin.arm.com ([217.140.110.23]:25702 "EHLO collaborate-mta1.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752189AbaBKRK4 (ORCPT ); Tue, 11 Feb 2014 12:10:56 -0500 Received: from hornet.Cambridge.Arm.com (hornet.cambridge.arm.com [10.2.201.45]) by collaborate-mta1.arm.com (Postfix) with ESMTP id 50DBB1401C9; Tue, 11 Feb 2014 11:10:55 -0600 (CST) From: Pawel Moll To: arm@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Sudeep KarkadaNagesha , Pawel Moll Subject: [PATCH 10/12] ARM: vexpress: remove redundant vexpress_dt_cpus_num to get cpu count Date: Tue, 11 Feb 2014 17:10:34 +0000 Message-Id: <1392138636-29240-11-git-send-email-pawel.moll@arm.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1392138636-29240-1-git-send-email-pawel.moll@arm.com> References: <1392138636-29240-1-git-send-email-pawel.moll@arm.com> 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: pawel.moll@arm.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) 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: , From: Sudeep KarkadaNagesha arm_dt_init_cpu_maps parses the device tree, validates and sets the cpu_possible_mask appropriately. It is unnecessary to do another DT parse to get the number of cpus, use num_possible_cpus instead. This patch also removes setting cpu_present_mask as platforms should only re-initialize it in smp_prepare_cpus() if present != possible. Signed-off-by: Sudeep KarkadaNagesha Signed-off-by: Pawel Moll --- arch/arm/mach-vexpress/platsmp.c | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/arch/arm/mach-vexpress/platsmp.c b/arch/arm/mach-vexpress/platsmp.c index 993c9ae..12a8751 100644 --- a/arch/arm/mach-vexpress/platsmp.c +++ b/arch/arm/mach-vexpress/platsmp.c @@ -77,39 +77,13 @@ void __init vexpress_dt_smp_map_io(void) WARN_ON(of_scan_flat_dt(vexpress_dt_find_scu, NULL)); } -static int __init vexpress_dt_cpus_num(unsigned long node, const char *uname, - int depth, void *data) -{ - static int prev_depth = -1; - static int nr_cpus = -1; - - if (prev_depth > depth && nr_cpus > 0) - return nr_cpus; - - if (nr_cpus < 0 && strcmp(uname, "cpus") == 0) - nr_cpus = 0; - - if (nr_cpus >= 0) { - const char *device_type = of_get_flat_dt_prop(node, - "device_type", NULL); - - if (device_type && strcmp(device_type, "cpu") == 0) - nr_cpus++; - } - - prev_depth = depth; - - return 0; -} - static void __init vexpress_dt_smp_init_cpus(void) { int ncores = 0, i; switch (vexpress_dt_scu) { case GENERIC_SCU: - ncores = of_scan_flat_dt(vexpress_dt_cpus_num, NULL); - break; + return; case CORTEX_A9_SCU: ncores = scu_get_core_count(vexpress_dt_cortex_a9_scu_base); break; @@ -133,12 +107,9 @@ static void __init vexpress_dt_smp_init_cpus(void) static void __init vexpress_dt_smp_prepare_cpus(unsigned int max_cpus) { - int i; switch (vexpress_dt_scu) { case GENERIC_SCU: - for (i = 0; i < max_cpus; i++) - set_cpu_present(i, true); break; case CORTEX_A9_SCU: scu_enable(vexpress_dt_cortex_a9_scu_base);