Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3633129pxj; Mon, 21 Jun 2021 03:12:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwX9ynRm64zskbiE6aT49lxSEr5f2vSYWNgrqlMxXLiOCxs+sJupPzogzXA6JlP2LntrJ4Y X-Received: by 2002:a17:907:20ed:: with SMTP id rh13mr6917062ejb.137.1624270345032; Mon, 21 Jun 2021 03:12:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624270345; cv=none; d=google.com; s=arc-20160816; b=sHfMGuCcSd9gFR08hKGCakHRz0rAoT0PN6a0EGz02Qxs6fYGK/uJ5G+Sn1Yk+HN4M8 ojC+OTJ1jQkk9rrq9ZceeOb8E9uEL1Z+pTrztZpsH0jWPXnwrtLtGYOWDWioboa4PoP7 MjW6V96fFblVsX+Uo3NbKdb9KRHNAE00hf4V2QfYOckSAk/wWzAr/sy84OOLIuZzIHox 6GgPPThnIJNq3DvddMBLn0gGeCUeRE39Xf0OYeXfRxCQE6Qh3aFdkPLemS8Qyeh9AZFP l0PJyGPrFCyYVbrVFSTsU5beYOeAbkx8/UiEgbGgF0cEfZVBnQKcop7j245lIRDvjde/ LerQ== 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=oh9DiamDIpDNXzC6Vzi8Ws6YrP6/RRsas8SuneX4b4Q=; b=JgeglLXL0JFpfJq+CfVay/1Wicfb/6JhTSFvSXF2g7SVIqYOL8UE+/0rom/y8Bzlri iiOj+sPe9QAMyhNNb2wEgcf6GRrUiepY28i0a3H8eautdL3J1V15jYL1jKnOPex3PTxH qyagZaB2UiD2EoUKMJTA3imibzu9XlriLUes08qzfi9EwYiZmogL1ECNQPWgq0jjThZg ljsUBgioBzAmKCRCvEyIcsTpJTf/JBuJKZY5sfsZ1ymjt7Uy96VSbRv/JlR2cnQpq9q9 YzibDyCal++B0KS9gwOD0xJjZqeJsqUdEdDq8knWLmRZaWZY8f8py0F1HbSnMvjd9gRq K6kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=avT6x6Vk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v4si18114303edj.103.2021.06.21.03.12.03; Mon, 21 Jun 2021 03:12:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=avT6x6Vk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229946AbhFUKNS (ORCPT + 99 others); Mon, 21 Jun 2021 06:13:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:58116 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229663AbhFUKNS (ORCPT ); Mon, 21 Jun 2021 06:13:18 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C41F860FE9; Mon, 21 Jun 2021 10:11:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1624270264; bh=bVbHmO+KD1RJdeZ8rCLmbHPMTnDTtKhwg9BcddwTEwU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=avT6x6VkGk5MZHaL6aTfxrWF7tmL/lqPZr2/16klm8yIwdt1+1jlFalN/qXiBG2u5 7+DsBi3PBzf3Y9/vj0d2I0b1dZMaI2ER7HDUISNzseQnJtiwTmz/e9ulfDzQcSwd07 H+2DkCGabRisfCfE5DqJk1F4/dpcwKrhSGRRQpAuZszgVPTcqfUSKt4woZNYlmcgBx YmnuDqP3B3z6gD3xiBj6OTbzbtSR9de+vZ2BtEAD7g37c8zBQyFmT9h6hJ/MPfvzv2 s2Ld76p3IghlOt9nojHfhXaOWt70pvYm3Ho2QAEmtcLDsmNC9vU25SbLWRBUTWdRiD XMlTI9UPOlQzA== Date: Mon, 21 Jun 2021 11:10:59 +0100 From: Will Deacon To: Daniel Lezcano Cc: Chanwoo Choi , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Marek Szyprowski , Krzysztof Kozlowski , Krzysztof Kozlowski , Thomas Gleixner Subject: Re: [PATCH 1/2] clocksource/drivers/exynos_mct: Prioritise Arm arch timer on arm64 Message-ID: <20210621101058.GB28788@willie-the-truck> References: <20210608154341.10794-1-will@kernel.org> <20210608154341.10794-2-will@kernel.org> <466bfc19-2260-87c6-c458-b43cf23617e3@samsung.com> <2a0181ea-a26e-65e9-16f6-cc233b6b296f@linaro.org> <20210617214748.GC25403@willie-the-truck> 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) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 21, 2021 at 11:25:47AM +0200, Daniel Lezcano wrote: > On 17/06/2021 23:47, Will Deacon wrote: > > On Thu, Jun 17, 2021 at 09:58:35AM +0900, Chanwoo Choi wrote: > >> On 6/17/21 12:25 AM, Daniel Lezcano wrote: > >>> On 10/06/2021 03:03, Chanwoo Choi wrote: > >>>> On 6/9/21 12:43 AM, Will Deacon wrote: > >>>>> diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c > >>>>> index fabad79baafc..804d3e01c8f4 100644 > >>>>> --- a/drivers/clocksource/exynos_mct.c > >>>>> +++ b/drivers/clocksource/exynos_mct.c > >>>>> @@ -51,6 +51,15 @@ > >>>>> > >>>>> #define TICK_BASE_CNT 1 > >>>>> > >>>>> +#ifdef CONFIG_ARM > >>>>> +/* Use values higher than ARM arch timer. See 6282edb72bed. */ > >>>>> +#define MCT_CLKSOURCE_RATING 450 > >>>>> +#define MCT_CLKEVENTS_RATING 500 > >>>>> +#else > >>>>> +#define MCT_CLKSOURCE_RATING 350 > >>>>> +#define MCT_CLKEVENTS_RATING 350 > >>>>> +#endif > >>>>> + > >>>>> enum { > >>>>> MCT_INT_SPI, > >>>>> MCT_INT_PPI > >>>>> @@ -206,7 +215,7 @@ static void exynos4_frc_resume(struct clocksource *cs) > >>>>> > >>>>> static struct clocksource mct_frc = { > >>>>> .name = "mct-frc", > >>>>> - .rating = 450, /* use value higher than ARM arch timer */ > >>>>> + .rating = MCT_CLKSOURCE_RATING, > >>>>> .read = exynos4_frc_read, > >>>>> .mask = CLOCKSOURCE_MASK(32), > >>>>> .flags = CLOCK_SOURCE_IS_CONTINUOUS, > >>>>> @@ -457,7 +466,7 @@ static int exynos4_mct_starting_cpu(unsigned int cpu) > >>>>> evt->set_state_oneshot_stopped = set_state_shutdown; > >>>>> evt->tick_resume = set_state_shutdown; > >>>>> evt->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT; > >>>>> - evt->rating = 500; /* use value higher than ARM arch timer */ > >>>>> + evt->rating = MCT_CLKEVENTS_RATING, > >>>>> > >>>>> exynos4_mct_write(TICK_BASE_CNT, mevt->base + MCT_L_TCNTB_OFFSET); > >>>>> > >>>>> > >>>> > >>>> I'm not sure that exynos mct is working without problem > >>>> such as the case of 6282edb72bed. > >>>> As described on On ,6282edb72bed the arch timer on exynos SoC > >>>> depends on Exynos MCT device. the arch timer is not able to work > >>>> without Exynos MCT because of using the common module. > >>> > >>> Is it possible to change the DT to have a phandle to the exynos_mct, so > >>> it will be probed before the arch_arm_timer ? > >> > >> I think that DT changes is not proper way to keep the order between > >> exynos_mct and arch timer. > > > > exynos4_mct_frc_start() is called unconditionally from probe via > > exynos4_clocksource_init() so as long as the mct probes first, then the > > arch timer should work, no? The rating shouldn't affect that. > > How do you ensure the exynos mct is probed before the arch timer ? > > The Makefile provides the right order, but the dependency is implicit. Currently, I think it's done by the order of the CPU hotplug notifiers ( see the hunk of 6282edb72bed which touches cpuhotplug.h). Will