Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp397453imm; Fri, 6 Jul 2018 23:17:36 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcW3FNuCqxx3zVjfw08mtkQqO0ZJEC9SKP2Ap82QDOdyjpvBGDmIUpsYt7scQbjSRx9M6RG X-Received: by 2002:a62:c8c2:: with SMTP id i63-v6mr13351292pfk.73.1530944256381; Fri, 06 Jul 2018 23:17:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530944256; cv=none; d=google.com; s=arc-20160816; b=v1OHZVbxkXxjMlqQOxpmKCiTBxg4FBaBnAjr+VS5b0XxJ7X6dTjtMoG5bXMj3xJakN OrJs4WP6Q53frs4MWx3PJIu9T1X6rPiWa35LS8syRFRfP9W7wUSOlJUBRGAt+W4w/iOf RkfoXUw337E5fzIQol9JLT9XmntBKn0eVfPZxm2VnYqwrncDOUfNZFNEIYC8V8tRp+tw KJw6tAvmihhe3MRZLVho/aE6AGumNWJy3Hd6HlylxAWarcmzSR1+oGcv9HN9Fk2pTGtm Km62zMGKHpylWHK7IRGJKLfbBT7+w/N7Mw/BXUv7xVOYhcK/qbnuINh02pADOnTO3qeR BdTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=l8BNqXDG20VKptRsZmC10F1FRoVy0RBQmuo3SdknFOw=; b=D5sQgNVkaZBM3SwUF5ipb6hdJavOH5+yRY7ouS0nXQwQwF1OchzZJnHjA2nPpCEPNd uTZr3KfR60+jFHJ4YP1oNKcbOOanUvndCIeBC/q0qBBs+hhmsmNJtxUnkXpsgrcV0us7 TAyWgnge23IxFfqOIw2N30b03NXoVdAIzzHfOUrEmZQ5bMCgEVYGJ9i5dUVbO+JUTr+F JdHAd4o2rhgNYFHnxopHZU96EMdqRS+yMuUnKs/z7K3ixP3cNgkhOBLBLz6Imrx8FDgb NRvP5fP4Tgj3UnbzmbnJPduymG32nFaKsfBPqirDXE/Dce+TGzaO1iF/Z/lLNeLLcZ3X X+Gw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d14-v6si9651355pfo.339.2018.07.06.23.17.20; Fri, 06 Jul 2018 23:17:36 -0700 (PDT) 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; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751882AbeGGGQm (ORCPT + 99 others); Sat, 7 Jul 2018 02:16:42 -0400 Received: from smtp2200-217.mail.aliyun.com ([121.197.200.217]:35555 "EHLO smtp2200-217.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750949AbeGGGQl (ORCPT ); Sat, 7 Jul 2018 02:16:41 -0400 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.1416438|-1;CH=green;FP=0|0|0|0|0|-1|-1|-1;HT=e02c03305;MF=ren_guo@c-sky.com;NM=1;PH=DS;RN=12;RT=12;SR=0;TI=SMTPD_---.CNM-2hy_1530944166; Received: from localhost(mailfrom:ren_guo@c-sky.com fp:SMTPD_---.CNM-2hy_1530944166) by smtp.aliyun-inc.com(10.147.40.7); Sat, 07 Jul 2018 14:16:06 +0800 Date: Sat, 7 Jul 2018 14:16:06 +0800 From: Guo Ren To: Mark Rutland Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, daniel.lezcano@linaro.org, jason@lakedaemon.net, arnd@arndb.de, c-sky_gcc_upstream@c-sky.com, gnu-csky@mentor.com, thomas.petazzoni@bootlin.com, wbx@uclibc-ng.org, green.hu@gmail.com Subject: Re: [PATCH V2 16/19] csky: SMP support Message-ID: <20180707061606.GA26276@guoren> References: <21d859826fe19aecaa2aefe3103d6d33e6f1b925.1530465326.git.ren_guo@c-sky.com> <20180706052432.q74gql32dtj5gj3b@salmiak> <20180706113200.GA27148@guoren> <20180706114352.6r7zkjunoafqtr3s@lakrids.cambridge.arm.com> <20180706122631.GA30265@guoren> <20180706162100.3iimik242cied2c6@lakrids.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180706162100.3iimik242cied2c6@lakrids.cambridge.arm.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 06, 2018 at 05:21:00PM +0100, Mark Rutland wrote: > Please don't open-code this. Use of_device_is_available(), which checks > the status property itself. e.g. > > void __init setup_smp(void) > { > struct device_node *node = NULL; > > while ((node = of_find_node_by_type(node, "cpu"))) { > if (!of_device_is_available(node)) > continue; > > ... > } > } Ok, approve. > Please use the reg property, you need it to describe which particular > CPUs are available. > > You probably also want a mapping from Linux logical CPU id to your > physical CPU id, and a sanity check on this. See arm64 for an example. Yes, you are right. Reg property could determine which bit of CPU in cr<0, 29> could be booted. Thx for the tips. Guo Ren