From patchwork Thu Feb 2 00:50:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vineet Gupta X-Patchwork-Id: 722722 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 3vDLyn1qWmz9ryj for ; Thu, 2 Feb 2017 11:50:55 +1100 (AEDT) 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 1cZ5by-00031k-2h; Thu, 02 Feb 2017 00:50:54 +0000 Received: from smtprelay2.synopsys.com ([198.182.60.111] helo=smtprelay.synopsys.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cZ5bu-0002xJ-5l for linux-snps-arc@lists.infradead.org; Thu, 02 Feb 2017 00:50:52 +0000 Received: from mailhost.synopsys.com (mailhost3.synopsys.com [10.12.238.238]) by smtprelay.synopsys.com (Postfix) with ESMTP id 564D310C050F; Wed, 1 Feb 2017 16:50:29 -0800 (PST) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 1D7AEFE2; Wed, 1 Feb 2017 16:50:29 -0800 (PST) Received: from us01wehtc1.internal.synopsys.com (us01wehtc1-vip.internal.synopsys.com [10.12.239.236]) by mailhost.synopsys.com (Postfix) with ESMTP id D314DFD9; Wed, 1 Feb 2017 16:50:28 -0800 (PST) Received: from IN01WEHTCA.internal.synopsys.com (10.144.199.104) by us01wehtc1.internal.synopsys.com (10.12.239.235) with Microsoft SMTP Server (TLS) id 14.3.266.1; Wed, 1 Feb 2017 16:50:28 -0800 Received: from IN01WEHTCB.internal.synopsys.com (10.144.199.105) by IN01WEHTCA.internal.synopsys.com (10.144.199.103) with Microsoft SMTP Server (TLS) id 14.3.266.1; Thu, 2 Feb 2017 06:20:25 +0530 Received: from vineetg-Latitude-E7450.internal.synopsys.com (10.10.161.38) by IN01WEHTCB.internal.synopsys.com (10.144.199.243) with Microsoft SMTP Server (TLS) id 14.3.266.1; Thu, 2 Feb 2017 06:20:25 +0530 From: Vineet Gupta To: Subject: [PATCH] clocksource: arc_timer: RTC: allow registration despite SMP Date: Wed, 1 Feb 2017 16:50:15 -0800 Message-ID: <1485996615-2511-1-git-send-email-vgupta@synopsys.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.10.161.38] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170201_165050_229255_7EF9BAD8 X-CRM114-Status: UNSURE ( 8.66 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.9 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 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [198.182.60.111 listed in wl.mailspike.net] -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 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 , Daniel Lezcano , John Stultz , linux-kernel@vger.kernel.org, Thomas Gleixner Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org So far we didn't allow CPU private 64-bit RTC timer to register in SMP as the individual counters may not be synchronized across cores. However there is a situation when we build SMP kernel but want to use the same image on UP as well as SMP hardware. Here we would certainly want to use RTC, but current code doesn't allow as it only uses build info (CONFIG_SMP) and not runtime info (num_online_cpus() or some such). We can't possibly use num_online_cpus() anyways because clocksource probe happens before other cpus are brought online The simple fix is allow ETC probe for SMP and rely on higher rating of GFRC to take over in general SMP case. We leave the pr_warn to notify the user. Cc: John Stultz Cc: Thomas Gleixner Cc: Daniel Lezcano Signed-off-by: Vineet Gupta --- drivers/clocksource/arc_timer.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/clocksource/arc_timer.c b/drivers/clocksource/arc_timer.c index 7517f959cba7..87f193794bf2 100644 --- a/drivers/clocksource/arc_timer.c +++ b/drivers/clocksource/arc_timer.c @@ -145,10 +145,8 @@ static int __init arc_cs_setup_rtc(struct device_node *node) } /* Local to CPU hence not usable in SMP */ - if (IS_ENABLED(CONFIG_SMP)) { + if (IS_ENABLED(CONFIG_SMP)) pr_warn("Local-64-bit-Ctr not usable in SMP"); - return -EINVAL; - } ret = arc_get_timer_clk(node); if (ret)