mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: tglx@linutronix.de
Cc: linux-kernel@vger.kernel.org,
	Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>,
	Vineet Gupta <vgupta@synopsys.com>,
	linux-snps-arc@lists.infradead.org (open list:SYNOPSYS ARC
	ARCHITECTURE)
Subject: [PATCH 3/7] clocksource/drivers/arc_timer: Add comments about locking while read GFRC
Date: Tue, 29 May 2018 20:26:38 +0200	[thread overview]
Message-ID: <1527618402-31974-3-git-send-email-daniel.lezcano@linaro.org> (raw)
In-Reply-To: <1527618402-31974-1-git-send-email-daniel.lezcano@linaro.org>

From: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>

This came to light in some internal discussions and it is nice to have
this documented rather than digging up the PRM (Prog Ref Manual) again.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Acked-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/arc_timer.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/clocksource/arc_timer.c b/drivers/clocksource/arc_timer.c
index 471b428..20da9b1 100644
--- a/drivers/clocksource/arc_timer.c
+++ b/drivers/clocksource/arc_timer.c
@@ -61,6 +61,20 @@ static u64 arc_read_gfrc(struct clocksource *cs)
 	unsigned long flags;
 	u32 l, h;
 
+	/*
+	 * From a programming model pov, there seems to be just one instance of
+	 * MCIP_CMD/MCIP_READBACK however micro-architecturally there's
+	 * an instance PER ARC CORE (not per cluster), and there are dedicated
+	 * hardware decode logic (per core) inside ARConnect to handle
+	 * simultaneous read/write accesses from cores via those two registers.
+	 * So several concurrent commands to ARConnect are OK if they are
+	 * trying to access two different sub-components (like GFRC,
+	 * inter-core interrupt, etc...). HW also supports simultaneously
+	 * accessing GFRC by multiple cores.
+	 * That's why it is safe to disable hard interrupts on the local CPU
+	 * before access to GFRC instead of taking global MCIP spinlock
+	 * defined in arch/arc/kernel/mcip.c
+	 */
 	local_irq_save(flags);
 
 	__mcip_cmd(CMD_GFRC_READ_LO, 0);
-- 
2.7.4

  parent reply	other threads:[~2018-05-29 18:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-29 18:25 [GIT PULL] clockevents / clocksource changes for 4.18 Daniel Lezcano
2018-05-29 18:26 ` [PATCH 1/7] clocksource/drivers/sprd: Fix Kconfig dependency Daniel Lezcano
2018-05-29 18:26   ` [PATCH 2/7] clocksource/drivers/mips-gic-timer: Add pr_fmt and reword pr_* messages Daniel Lezcano
2018-05-29 18:26   ` Daniel Lezcano [this message]
2018-05-29 18:26   ` [PATCH 4/7] clocksource/drivers/timer-imx-gpt: Remove outdated file path Daniel Lezcano
2018-05-29 18:26   ` [PATCH 5/7] clocksource/drivers/timer-imx-gpt: Switch to SPDX identifier Daniel Lezcano
2018-05-29 18:26   ` [PATCH 6/7] clocksource/drivers/timer-imx-tpm: " Daniel Lezcano
2018-05-29 18:26   ` [PATCH 7/7] clocksource/drivers/mxs_timer: " Daniel Lezcano

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=1527618402-31974-3-git-send-email-daniel.lezcano@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=Eugeniy.Paltsev@synopsys.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=tglx@linutronix.de \
    --cc=vgupta@synopsys.com \
    /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

all inboxes | Powered by JetHome®