From patchwork Wed Nov 25 10:43:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell King X-Patchwork-Id: 7697381 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 334579F1D3 for ; Wed, 25 Nov 2015 10:48:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 55122208DA for ; Wed, 25 Nov 2015 10:48:20 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 528FE2084C for ; Wed, 25 Nov 2015 10:48:19 +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 1a1XZw-0002Ix-KG; Wed, 25 Nov 2015 10:45:36 +0000 Received: from pandora.arm.linux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a1XZr-00082P-EO for linux-arm-kernel@lists.infradead.org; Wed, 25 Nov 2015 10:45:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=arm.linux.org.uk; s=pandora-2014; h=Date:Sender:Message-Id:Content-Type:Content-Transfer-Encoding:MIME-Version:Subject:To:From; bh=9HNthjcJPzp0VDkBXiDszmzMAeaI0Mro3XM/gToDmxQ=; b=iOdJjZie0DG9R+P/FGxq/F9qRdsd6Ho5sWDtF8SLinlr6kSkRWHA1cQwKh9ykvxuOhFCK89T2PwigEzorIKcptQZD3QSci9iOlfD20ZQwSoDiSu3IyEunoZVaPWdfHYopz80aqsXMAuKRD/rW0zAzf1tVrFoVHm/DAvuRM7p3Bk=; Received: from e0022681537dd.dyn.arm.linux.org.uk ([2001:4d48:ad52:3201:222:68ff:fe15:37dd]:53358 helo=rmk-PC.arm.linux.org.uk) by pandora.arm.linux.org.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1a1XXT-0004Iq-W8 for linux-arm-kernel@lists.infradead.org; Wed, 25 Nov 2015 10:43:04 +0000 Received: from rmk by rmk-PC.arm.linux.org.uk with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1a1XXS-00060O-GS for linux-arm-kernel@lists.infradead.org; Wed, 25 Nov 2015 10:43:02 +0000 From: Russell King To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: avoid SMP DT initialisation on UP-only capable systems MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Wed, 25 Nov 2015 10:43:02 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151125_024532_073309_393DA5F6 X-CRM114-Status: GOOD ( 15.40 ) X-Spam-Score: -4.9 (----) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 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=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 arm_dt_init_cpu_maps() initialises the CPU possible map even when the boot CPU indicates that it is not SMP capable. This can happen with SoCs where the SoC may have a single UP-only CPU, or may have a pair of SMP CPUs - and this is the only difference. One solution is to increase the number of DT files by forcing peopl to properly describe the hardware: this means all the iMX6DL DT files need to be duplicated for iMX6S and a whole raft of updates to boot loaders and the like. Another solution is to decide that it is inappropriate to initialise the cpu_possible map with anything but the boot CPU on non-SMP capable systems. This is implemented by this patch. The situation currently may provoke a warning on earlier kernels, printed during SMP bringup where we attempt to bring CPU1 online inspite of CPU0 being a UP-only CPU, and this only failing due to the lack of SMP operations. Signed-off-by: Russell King Acked-by: Mark Rutland --- arch/arm/kernel/devtree.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c index 65addcbf5b30..bd72ce91d7a2 100644 --- a/arch/arm/kernel/devtree.c +++ b/arch/arm/kernel/devtree.c @@ -170,15 +170,18 @@ void __init arm_dt_init_cpu_maps(void) return; } - /* - * Since the boot CPU node contains proper data, and all nodes have - * a reg property, the DT CPU list can be considered valid and the - * logical map created in smp_setup_processor_id() can be overridden - */ - for (i = 0; i < cpuidx; i++) { - set_cpu_possible(i, true); - cpu_logical_map(i) = tmp_map[i]; - pr_debug("cpu logical map 0x%x\n", cpu_logical_map(i)); + if (is_smp()) { + /* + * Since the boot CPU node contains proper data, and all + * nodes have a reg property, the DT CPU list can be + * considered valid and the logical map created in + * smp_setup_processor_id() can be overridden + */ + for (i = 0; i < cpuidx; i++) { + set_cpu_possible(i, true); + cpu_logical_map(i) = tmp_map[i]; + pr_debug("cpu logical map 0x%x\n", cpu_logical_map(i)); + } } }