Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2064007pxb; Wed, 30 Mar 2022 15:45:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5z8IUgC6tFjLk628hbeo7iG4Tvple43Ni2OICHH83sbC46SSoUS0VejhUrEza0y877h20 X-Received: by 2002:a63:c048:0:b0:381:7aad:57c5 with SMTP id z8-20020a63c048000000b003817aad57c5mr8013864pgi.595.1648680358535; Wed, 30 Mar 2022 15:45:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648680358; cv=none; d=google.com; s=arc-20160816; b=woSrQ2x5ZHYDgmwYYTXLJv4JCZn7azuOQWpmwsg9APmaWkW4Szsrk6r0oQ7c99yLgG 1n3AbgqL13umaE44JcFNQaNP1OIOrd39sP+W9eem+wfiCaEkTbyBQ6of6jbTR8szIsc1 mLVZCQWpSWhKj42jLkKgmtaaD3Ow6dh5P4HHYr7Y2WgBHWEFx5QiF/dDsu/eoJIpyZmG LYi02sjDvJnyz1gYYr+zq44ZARcbvFVZsCcSWlA7iSfz6lJ5mgTYu836FyPTt3bLUksl m1ciMoe+bdJlvmBX/59Urv2zRbl2wzDDoHf02mbmqWrlzOBxB7tf6XKavjA5sGk4AmMy uRVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=AH+4xQbZM08WZt8qm/l3tTz+5fAhec0WZ52E5BgUGxc=; b=gFnGNfj3tClN1JfMkt0TlKJGi+VKCsLsvqH8/P++UGQYXoflHXFh2IkIhK9TiZ1GVH 8TvSkN/IU9yd/0orDxUyH0uqQXYZ7SA2zGg+PBR1DSrJDbE2lKznnfWdNFVU307Kd+xB IKMe8gzatTBeVURD3scYXkpGBoypjosetqGYBakB/E2AHQ3HKb4p97gzsHkCDj224rAd fSrgpdZnYsZtjqfu4gRA14XNq1RyYfkilelz81W1n7dSSfXYX7XcmzsJXcJc7wl1otIV S1WUu2ocWNPSf95Oei7i5VaHJUNZbv8XciYNbyWzl3Gg+HaA79Tqc0D+FoSn9YLhZT60 VAdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@axis.com header.s=axis-central1 header.b=dsOxHm2w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=axis.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a20-20020a634d14000000b003816043ef1fsi20995246pgb.276.2022.03.30.15.45.44; Wed, 30 Mar 2022 15:45:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@axis.com header.s=axis-central1 header.b=dsOxHm2w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=axis.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243617AbiC3IXq (ORCPT + 99 others); Wed, 30 Mar 2022 04:23:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244407AbiC3IX3 (ORCPT ); Wed, 30 Mar 2022 04:23:29 -0400 Received: from smtp2.axis.com (smtp2.axis.com [195.60.68.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6FE532EE0; Wed, 30 Mar 2022 01:21:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1648628503; x=1680164503; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=AH+4xQbZM08WZt8qm/l3tTz+5fAhec0WZ52E5BgUGxc=; b=dsOxHm2wNOiFvRmqiE98ot35tpcWiFtTvkvwup5ov/K6Q2XzEDOpgwsQ XcxFQOfxiGgQakGVld8FSQoH6agDp+UvQAyXDAcWRhQkaCuu2EvhHwiUw qXxpPA0E9c1/bBgEwRzOe0WBNrE59G4fOyp7BqyP+i9Fb/+LSnFpMo0tw YXM3CiSLUoeHPOMY5x7CDcPOOfVUMTsjNyVGLg5GTdqJdFULrojMwzUGK IpYMYpWGdIqSgJRFXObZRRAJPNqMoAX+ZheMSKAZJdvl3a8zp+tdr/Jdn LgSaLa6peKUassyO0mIdc5k7OEItSrVKIn4+dH5KbwJR6NgyXOFMWkUtE g==; Date: Wed, 30 Mar 2022 10:21:37 +0200 From: Vincent Whitchurch To: Marek Szyprowski CC: Krzysztof Kozlowski , "tglx@linutronix.de" , "daniel.lezcano@linaro.org" , kernel , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-samsung-soc@vger.kernel.org" , "devicetree@vger.kernel.org" , "alim.akhtar@samsung.com" , "robh+dt@kernel.org" Subject: Re: [PATCH v2 3/4] clocksource/drivers/exynos_mct: Support local-timer-index property Message-ID: <20220330082137.GA21079@axis.com> References: <20220308142410.3193729-1-vincent.whitchurch@axis.com> <20220308142410.3193729-4-vincent.whitchurch@axis.com> <226dcb1b-d141-f0d3-68c4-11d2466ca571@canonical.com> <20220311113543.GA17877@axis.com> <69be9f88-b69b-c149-4387-c5002219bf0a@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 21, 2022 at 09:00:08AM +0100, Marek Szyprowski wrote: > Right, I've played a bit with MCT on some older Exynos SoCs (ARM 32bit > based and even Exynos5433) and it looked that none of it enabled MCT FRC > timer in their proprietary firmware. I've even proposed a patch for this > once ([1]), but such approach has been rejected. I think that calling > exynos4_mct_frc_start() unconditionally won't hurt. Thank you for looking into this. The proposal was however not to avoid changing when exynos4_mct_frc_start() is called, but to instead skip the write to the Timer Enable bit of the G_TCON register if it is already set, like in the below patch. (This is needed to avoid races when the FRC is shared between CPUs in an AMP configuration, since TCON can be modified for other reasons from the CPU which is using the global comparator.) If I understand your comment correctly, such a change should not cause any difference at least on the platforms you looked at since there MCT_G_TCON_START will not have been set at startup. diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c index 6db3d5511b0f..ed462e0a77ff 100644 --- a/drivers/clocksource/exynos_mct.c +++ b/drivers/clocksource/exynos_mct.c @@ -162,6 +162,9 @@ static void exynos4_mct_frc_start(void) u32 reg; reg = readl_relaxed(reg_base + EXYNOS4_MCT_G_TCON); + if (reg & MCT_G_TCON_START) + return; + reg |= MCT_G_TCON_START; exynos4_mct_write(reg, EXYNOS4_MCT_G_TCON); }