All of lore.kernel.org
 help / color / mirror / Atom feed
From: "tip-bot2 for Vincent Whitchurch" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Vincent Whitchurch <vincent.whitchurch@axis.com>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: timers/core] clocksource/drivers/exynos_mct: Support frc-shared property
Date: Tue, 04 Oct 2022 09:27:22 -0000	[thread overview]
Message-ID: <166487564281.401.7789863630231982917.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20220609112738.359385-3-vincent.whitchurch@axis.com>

The following commit has been merged into the timers/core branch of tip:

Commit-ID:     e8550f0e7bde9bd31697e3c534d386f7f3b5787b
Gitweb:        https://git.kernel.org/tip/e8550f0e7bde9bd31697e3c534d386f7f3b5787b
Author:        Vincent Whitchurch <vincent.whitchurch@axis.com>
AuthorDate:    Thu, 09 Jun 2022 13:27:36 +02:00
Committer:     Daniel Lezcano <daniel.lezcano@linaro.org>
CommitterDate: Tue, 20 Sep 2022 10:49:45 +02:00

clocksource/drivers/exynos_mct: Support frc-shared property

When the FRC is shared with another main processor, the other processor
is assumed to have started it and this processor should not write to the
global registers.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
Link: https://lore.kernel.org/r/20220609112738.359385-3-vincent.whitchurch@axis.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/exynos_mct.c | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c
index f29c812..1202383 100644
--- a/drivers/clocksource/exynos_mct.c
+++ b/drivers/clocksource/exynos_mct.c
@@ -233,9 +233,16 @@ static cycles_t exynos4_read_current_timer(void)
 }
 #endif
 
-static int __init exynos4_clocksource_init(void)
+static int __init exynos4_clocksource_init(bool frc_shared)
 {
-	exynos4_mct_frc_start();
+	/*
+	 * When the frc is shared, the main processer should have already
+	 * turned it on and we shouldn't be writing to TCON.
+	 */
+	if (frc_shared)
+		mct_frc.resume = NULL;
+	else
+		exynos4_mct_frc_start();
 
 #if defined(CONFIG_ARM)
 	exynos4_delay_timer.read_current_timer = &exynos4_read_current_timer;
@@ -605,6 +612,7 @@ out_irq:
 
 static int __init mct_init_dt(struct device_node *np, unsigned int int_type)
 {
+	bool frc_shared = of_property_read_bool(np, "samsung,frc-shared");
 	int ret;
 
 	ret = exynos4_timer_resources(np);
@@ -615,10 +623,17 @@ static int __init mct_init_dt(struct device_node *np, unsigned int int_type)
 	if (ret)
 		return ret;
 
-	ret = exynos4_clocksource_init();
+	ret = exynos4_clocksource_init(frc_shared);
 	if (ret)
 		return ret;
 
+	/*
+	 * When the FRC is shared with a main processor, this secondary
+	 * processor cannot use the global comparator.
+	 */
+	if (frc_shared)
+		return ret;
+
 	return exynos4_clockevent_init();
 }
 

  reply	other threads:[~2022-10-04  9:30 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-09 11:27 [PATCH v4 0/4] clocksource: Add MCT support for ARTPEC-8 Vincent Whitchurch
2022-06-09 11:27 ` Vincent Whitchurch
2022-06-09 11:27 ` [PATCH v4 1/4] dt-bindings: timer: exynos4210-mct: Add ARTPEC-8 MCT support Vincent Whitchurch
2022-06-09 11:27   ` Vincent Whitchurch
2022-10-04  9:27   ` [tip: timers/core] " tip-bot2 for Vincent Whitchurch
2022-06-09 11:27 ` [PATCH v4 2/4] clocksource/drivers/exynos_mct: Support frc-shared property Vincent Whitchurch
2022-06-09 11:27   ` Vincent Whitchurch
2022-10-04  9:27   ` tip-bot2 for Vincent Whitchurch [this message]
2022-06-09 11:27 ` [PATCH v4 3/4] clocksource/drivers/exynos_mct: Support local-timers property Vincent Whitchurch
2022-06-09 11:27   ` Vincent Whitchurch
2022-06-21 13:11   ` Krzysztof Kozlowski
2022-06-21 13:11     ` Krzysztof Kozlowski
2022-09-07  8:59     ` Vincent Whitchurch
2022-09-07  8:59       ` Vincent Whitchurch
2022-09-07  9:07       ` Daniel Lezcano
2022-09-07  9:07         ` Daniel Lezcano
2022-10-04  9:27   ` [tip: timers/core] " tip-bot2 for Vincent Whitchurch
2022-06-09 11:27 ` [PATCH v4 4/4] clocksource/drivers/exynos_mct: Enable building on ARTPEC Vincent Whitchurch
2022-06-09 11:27   ` Vincent Whitchurch
2022-10-04  9:27   ` [tip: timers/core] " tip-bot2 for Vincent Whitchurch
2022-09-07  9:08 ` [PATCH v4 0/4] clocksource: Add MCT support for ARTPEC-8 Daniel Lezcano
2022-09-07  9:08   ` 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=166487564281.401.7789863630231982917.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=daniel.lezcano@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=vincent.whitchurch@axis.com \
    --cc=x86@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.