From patchwork Mon Apr 28 17:57:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Moll X-Patchwork-Id: 29263 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f199.google.com (mail-ob0-f199.google.com [209.85.214.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 225D620553 for ; Mon, 28 Apr 2014 18:00:39 +0000 (UTC) Received: by mail-ob0-f199.google.com with SMTP id gq1sf42562985obb.2 for ; Mon, 28 Apr 2014 11:00:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:content-type:content-transfer-encoding; bh=x7Y0imzB430/2+giAudxEc5XJdZKd0+ns3dp3cs0N6c=; b=cHcaMIuiH2cPG3rHoaOY2gwTpeorChjOFzdGqUFpV5LUKXRligkHZU5vahLIn4WSip fquyzMzpYPdbuxJo9kwdnRONu0ZJ41ib7ft7vb3LCwwiBBDb0mZfh2hsi9mXRH/yAwiq U738JzGyzugfZnluS8zSb9nuNcxbQ0fK92uCemOlz1UpDbwNYcK/icysN6AEetJS46WD +MxGW0BdKAaTbCEJ33IfI3QTUkqcJWFCp+gU+s5D3YZBk6rDu8x7D4nTJVeQBLfTUHtT AC4C04zx0EFB1B+RvRsRvTmROsBhWbGGNEc+Rm8TXbJ+r5nWTVdWzFy3Ok/TCoG1USRB SKUA== X-Gm-Message-State: ALoCoQnFHUxz/kPsqvCc5h1piAhygQ/SGDkmfI6EBO5Yoz7VvnkI/PQO8HNGVQDFF2w0ST8n79sf X-Received: by 10.50.35.229 with SMTP id l5mr1263348igj.0.1398708038651; Mon, 28 Apr 2014 11:00:38 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.40.209 with SMTP id x75ls2612487qgx.46.gmail; Mon, 28 Apr 2014 11:00:38 -0700 (PDT) X-Received: by 10.221.30.14 with SMTP id sa14mr1342264vcb.44.1398708038458; Mon, 28 Apr 2014 11:00:38 -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 jb7si3817878vec.143.2014.04.28.11.00.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 28 Apr 2014 11:00:38 -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.177; Received: by mail-vc0-f177.google.com with SMTP id if17so8491872vcb.22 for ; Mon, 28 Apr 2014 11:00:38 -0700 (PDT) X-Received: by 10.220.10.2 with SMTP id n2mr4148406vcn.26.1398708038331; Mon, 28 Apr 2014 11:00:38 -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 ib8csp136083vcb; Mon, 28 Apr 2014 11:00:38 -0700 (PDT) X-Received: by 10.224.12.74 with SMTP id w10mr35703470qaw.34.1398708037887; Mon, 28 Apr 2014 11:00:37 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id v6si8212537qas.22.2014.04.28.11.00.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Apr 2014 11:00:37 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; 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 1Weppa-0003Mm-4m; Mon, 28 Apr 2014 17:59:06 +0000 Received: from fw-tnat.austin.arm.com ([217.140.110.23] helo=collaborate-mta1.arm.com) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WeppB-00034M-FP for linux-arm-kernel@lists.infradead.org; Mon, 28 Apr 2014 17:58:42 +0000 Received: from hornet.Cambridge.Arm.com (hornet.cambridge.arm.com [10.2.201.45]) by collaborate-mta1.arm.com (Postfix) with ESMTP id 6F33013FEF5; Mon, 28 Apr 2014 12:58:12 -0500 (CDT) From: Pawel Moll To: Grant Likely , Rob Herring , Samuel Ortiz , Lee Jones , Arnd Bergmann , Greg Kroah-Hartman , Russell King Subject: [PATCH 07/10] ARM: vexpress: remove redundant vexpress_dt_cpus_num to get cpu count Date: Mon, 28 Apr 2014 18:57:54 +0100 Message-Id: <1398707877-22596-8-git-send-email-pawel.moll@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1398707877-22596-1-git-send-email-pawel.moll@arm.com> References: <1398707877-22596-1-git-send-email-pawel.moll@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140428_105841_586480_ABD729FD X-CRM114-Status: GOOD ( 13.18 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.3.2 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record Cc: Sudeep KarkadaNagesha , arm@kernel.org, Pawel Moll , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.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: 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 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);