From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C7755CCA473 for ; Thu, 9 Jun 2022 11:31:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yhxy/Vwq5oOHN/kCOfqpca3K19XDK0uswqNG3DsVkXA=; b=s2Sd2aCUQ77TLI WYltr91bzevDoYNaVFtdvYJoBsBUy6NQQwzlRnRO/PLqMXrIprXb4n7Vp3Fhbe0ayLs75foHe8DqL UCqrUzGM4M+EI6AyX7cFy2kMO8v71Xg70AkwsbAfel0MoKkgmg2Ej1iWKh+rWFArtIvmaPyS6i4vF pEjlLa9c5+EvBPM25IUZHScH7bzyzP7OChT4y9nbs2S+uAY8LX8KckS5XMb+MdUjVCP7BlIEjJNT9 OWiRTjazd9dOCDs5ch59Vo4KBwhp70MeLKg28+j64MB9fENWozD802TbQ6yqfl4mnd3IXchnFRiuz 30jcsx95IxlPYPh5HQmA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nzGMR-001KVT-KC; Thu, 09 Jun 2022 11:29:59 +0000 Received: from smtp2.axis.com ([195.60.68.18]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nzGKO-001JDi-Ur for linux-arm-kernel@lists.infradead.org; Thu, 09 Jun 2022 11:27:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1654774073; x=1686310073; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=H+8MIR1OuQsaVNfsbihNB9tS+9/wynO4WohspQZNd1M=; b=FukJDo/WbkCfHLkluWCuiPSdVghXEEPyqi6CmfJBg45hhpq6+mh+Om+W Dos+eiXdQIpva3uHlmk37La8y5dPeRE99oWRv8iUfDkKy+FoG9GQRWuWv KkfLsH6hcG+EP8mjSAEJNW3v/kkP9VB9v5qxzP8SuO8IjjyKGeQVfLGE9 KcnN4k9jwQT1q8LRScMIvk+E3p4OXH6D4+/HADhmB3NF353JzILVQMm/B 6mPZ/4Bt4KnoQ4BYhKS49R7nbm9KmEzyV2D8okrlWDr1Dn+9EkuJ6chTf 9kJqf4slyUernnTmwinYOjBr+mVIm8ad6yRgdfNE4BlWWmLMrK77ZUopn w==; From: Vincent Whitchurch To: , , CC: , Vincent Whitchurch , , , , , , Subject: [PATCH v4 2/4] clocksource/drivers/exynos_mct: Support frc-shared property Date: Thu, 9 Jun 2022 13:27:36 +0200 Message-ID: <20220609112738.359385-3-vincent.whitchurch@axis.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220609112738.359385-1-vincent.whitchurch@axis.com> References: <20220609112738.359385-1-vincent.whitchurch@axis.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220609_042753_351755_5F2EE603 X-CRM114-Status: GOOD ( 14.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 Signed-off-by: Vincent Whitchurch --- Notes: v4: - Add Krzysztof's Reviewed-by. v3: - Split FRC sharing handling from local timer indices handling - Remove addition of global variable. 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 f29c812b70c9..12023831dedf 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 @@ static int __init exynos4_timer_interrupts(struct device_node *np, 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(); } -- 2.34.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel