Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp819835pxj; Thu, 17 Jun 2021 14:50:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMiChSCWMPm0CyCKY2mGqFITgf+i+lMrXpej6HgIdgssCEt4FcgsTxciK3cJDnaz6yhgMr X-Received: by 2002:a05:6402:3514:: with SMTP id b20mr590529edd.12.1623966602750; Thu, 17 Jun 2021 14:50:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623966602; cv=none; d=google.com; s=arc-20160816; b=nCiB3GDFM9STwtkgUKav+YzVvbkPJHG9/+g8RZ7WqNfab9M+VuCS9HtBACwKoteDuG /YkMrWfQFGYcSQwAcxMysFvsmnT5efAgzbP1DxotfoP5d94L+ygEs1Y/IWBkMuvmisFc DLnAcz/fSz9WloT53SCXPvw5WwnXdYymLFq69A9cRwGawRyL7KPuhMarUcsVLo2xnLSp Bl8FeHVQJRYrOzaBjypQ0zgVBt20TueablS7xW2mfqbeYQh14omjCv5Z7hEf8QhOOgdb AUdNvfPs3MTihBsT0/NE0PioKZJUDigmj/A57oISUIdAN+BKl9kXMKoDiFRaJA4fjlzg Y8NQ== 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=IETyzEBZCVVbtPOSscrC/NMNaFCt9xr0dg5W4Vfx60Y=; b=MhXMwVfEP+OOmTmmugPSlCUZU+q2VjNpPnuYx1VZdnOXYYkLjJogkEUx3tYWU4zKAb GsuJT4UDinqqplnxpb3ZJ/w+Y2QgNyg0jkreE4UL5uhcuJxk6qHhVRbpTmiCuEOejKWS aMUvAS2rvmdJytQycbmHo19FGSaBHBZjfofRkgzh9dE3T9z7MX5r8gaTO0eW/oxlaqXG atXgK3J6qeLLGZJobqrHDfBXenk5hXNdKuFRglM2ZR6PNCqejq5HFm80GGfDlUfPxBFM Q4bnWim/cQEsyhHDSSGntpFYCwxKYIzrB5JTMO1d7YZXcJBFzcXSx3RnSYvwnxLsDCjk 5JkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uoJ8WFf7; 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 ar22si212970ejc.294.2021.06.17.14.49.39; Thu, 17 Jun 2021 14:50:02 -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=uoJ8WFf7; 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 S230299AbhFQVuE (ORCPT + 99 others); Thu, 17 Jun 2021 17:50:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:49040 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229683AbhFQVuC (ORCPT ); Thu, 17 Jun 2021 17:50:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3845160FF1; Thu, 17 Jun 2021 21:47:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623966473; bh=crOECdcknuYs0DVwsxA5B1XKYsVXzWlHpvBwCMZLrQ4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uoJ8WFf7moEOMp9OdehLkeJ1ptbp+d7H9R825gWRr4nZbieLQm9nMi5h28L3QOrmE hwhh8zX7ETdX+DpTGT47wa8wO440xhrT8Xl3eGR/63l62cAYWEyILWc/Yi4k9v/Km3 fDW4Q47fj2R9bvNwqCSaZBkfJ8bHbiCmNGj8lZP6Ns+dfR4mLEMhpnh9HJ2uQDWECM aTFKO1b+nS60/mG2Fi60JTgucljTreXLoBdTXIGxLDZwaY1NNEsfZaaTcJOPdJraVg PgYpTHEjMnXRWp6UyTWxm8Kg2pxe8J/Z3O/3gYrvoLfQBZhgEOINRghdL/ZQIu9BsN awDQHlJ6NgbXQ== Date: Thu, 17 Jun 2021 22:47:48 +0100 From: Will Deacon To: Chanwoo Choi Cc: Daniel Lezcano , 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: <20210617214748.GC25403@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> 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 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. Will