linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vineet Gupta <Vineet.Gupta1@synopsys.com>
To: <linux-snps-arc@lists.infradead.org>
Cc: <linux-kernel@vger.kernel.org>,
	Vineet Gupta <Vineet.Gupta1@synopsys.com>,
	"John Stultz" <john.stultz@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Daniel Lezcano <daniel.lezcano@linaro.org>
Subject: [PATCH] clocksource: arc_timer: RTC: allow registration despite SMP
Date: Wed, 1 Feb 2017 16:50:15 -0800	[thread overview]
Message-ID: <1485996615-2511-1-git-send-email-vgupta@synopsys.com> (raw)

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 <john.stultz@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
---
 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)
-- 
2.7.4

             reply	other threads:[~2017-02-02  0:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-02  0:50 Vineet Gupta [this message]
2017-02-02 14:27 ` [PATCH] clocksource: arc_timer: RTC: allow registration despite SMP Daniel Lezcano
2017-02-22  1:16   ` Vineet Gupta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1485996615-2511-1-git-send-email-vgupta@synopsys.com \
    --to=vineet.gupta1@synopsys.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).