From patchwork Wed Nov 29 08:21:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Brodkin X-Patchwork-Id: 842617 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="jn1YMli5"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yn4Dv5bkKz9s5L for ; Thu, 30 Nov 2017 02:28:31 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=/eLWpsUKCBUzwEsHyaYNTHlF0zwusFaVKgOuqBqrV3Y=; b=jn1 YMli5Q+MP3AWJR0RdTl+7YbrdBsZGkthfyi5HJV/waNdCIfyM8OaYIvpiQ5s9BZGZJAiKKOFuXH+E 2O7aHjmZsdOH63v1kRflctWGrvnOwaYJ19bcZx7tUJQh/E1lzUQqSmIdwgZr51T+05U4uAsFpfb8I Yxf8GGeMzrlcUMjLAk7vrzTutK5YPmN5Ov7rgipglS+05cOSOt+HtG2vEQoNwP2uND3/vedqlZd9b h+pYDOe1YmAh92Evz30Po20BT+GE96GK4QByCxCEaF2uGBW1x9Dy6EzFRtfgwNZrkiMyc2+vdeK2z TCdb/+vlM4n7EggOc8JoeqvAsSDeYxg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eK4Hm-0004dA-Aq; Wed, 29 Nov 2017 15:28:30 +0000 Received: from us01smtprelay-2.synopsys.com ([198.182.60.111] helo=smtprelay.synopsys.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eK4Hi-0004LQ-LG for linux-snps-arc@lists.infradead.org; Wed, 29 Nov 2017 15:28:28 +0000 Received: from mailhost.synopsys.com (mailhost3.synopsys.com [10.12.238.238]) by smtprelay.synopsys.com (Postfix) with ESMTP id 50E9B10C1376; Wed, 29 Nov 2017 07:28:03 -0800 (PST) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 0A01B656; Wed, 29 Nov 2017 07:28:03 -0800 (PST) Received: from ru20arcgnu1.internal.synopsys.com (ru20arcgnu1.internal.synopsys.com [10.121.9.48]) by mailhost.synopsys.com (Postfix) with ESMTP id C9821612; Wed, 29 Nov 2017 07:28:01 -0800 (PST) From: Alexey Brodkin To: linux-snps-arc@lists.infradead.org Subject: [PATCH] ARC: Enable machine_desc->init_per_cpu for non-SMP configs Date: Wed, 29 Nov 2017 11:21:45 +0300 Message-Id: <20171129082145.23327-1-abrodkin@synopsys.com> X-Mailer: git-send-email 2.11.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171129_072826_720493_F57115AD X-CRM114-Status: UNSURE ( 9.97 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.4 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [198.182.60.111 listed in list.dnswl.org] -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain 1.5 DATE_IN_PAST_06_12 Date: is 6 to 12 hours before Received: date -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vineet Gupta , Alexey Brodkin , linux-kernel@vger.kernel.org MIME-Version: 1.0 Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org As of today we assumed that "machine_desc->init_per_cpu" calls are only usable on SMP systems when we want to run some piece of code on early boot for each and every core, I guess assumption was we have "machine_desc->init_early" for single-core cases where the one and only master core can do all the things. But it turned out for platforms which might be both UP and SMP it might be benificial to use "init_per_cpu" for both UP and SMP cases with which we achieve 2 things simultaneously: 1) Exactly the same one code will be used for UP&SMP for things required to be done on each an every core regardless if it's a master and the only core in UP system or any other slave core in SMP setup. 1) There will be no "ifdef CONFIG_SMP" around "init_per_cpu". Signed-off-by: Alexey Brodkin --- arch/arc/include/asm/mach_desc.h | 2 -- arch/arc/kernel/irq.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/arc/include/asm/mach_desc.h b/arch/arc/include/asm/mach_desc.h index c28e6c347b49..871f3cb16af9 100644 --- a/arch/arc/include/asm/mach_desc.h +++ b/arch/arc/include/asm/mach_desc.h @@ -34,9 +34,7 @@ struct machine_desc { const char *name; const char **dt_compat; void (*init_early)(void); -#ifdef CONFIG_SMP void (*init_per_cpu)(unsigned int); -#endif void (*init_machine)(void); void (*init_late)(void); diff --git a/arch/arc/kernel/irq.c b/arch/arc/kernel/irq.c index 538b36afe89e..62b185057c04 100644 --- a/arch/arc/kernel/irq.c +++ b/arch/arc/kernel/irq.c @@ -31,10 +31,10 @@ void __init init_IRQ(void) /* a SMP H/w block could do IPI IRQ request here */ if (plat_smp_ops.init_per_cpu) plat_smp_ops.init_per_cpu(smp_processor_id()); +#endif if (machine_desc->init_per_cpu) machine_desc->init_per_cpu(smp_processor_id()); -#endif } /*