diff options
author | Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> | 2018-04-19 17:53:05 +0200 |
---|---|---|
committer | Daniel Lezcano <daniel.lezcano@linaro.org> | 2018-05-18 22:59:40 +0200 |
commit | 6bd9549d8a7dd06087a06fa7a6df651b02d6f21e (patch) | |
tree | 95bd150a3cf61525f7622f477c6cc4cbc684fe99 /drivers/clocksource/arc_timer.c | |
parent | clocksource/drivers/mips-gic-timer: Add pr_fmt and reword pr_* messages (diff) | |
download | linux-6bd9549d8a7dd06087a06fa7a6df651b02d6f21e.tar.xz linux-6bd9549d8a7dd06087a06fa7a6df651b02d6f21e.zip |
clocksource/drivers/arc_timer: Add comments about locking while read GFRC
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>
Diffstat (limited to 'drivers/clocksource/arc_timer.c')
-rw-r--r-- | drivers/clocksource/arc_timer.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/clocksource/arc_timer.c b/drivers/clocksource/arc_timer.c index 471b428d8034..20da9b1d7f7d 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); |