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 X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9EC8AC2B9F4 for ; Thu, 17 Jun 2021 21:47:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 725BE61241 for ; Thu, 17 Jun 2021 21:47:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230377AbhFQVuF (ORCPT ); Thu, 17 Jun 2021 17:50:05 -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 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 X-Spam-Level: X-Spam-Status: No, score=-10.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76196C2B9F4 for ; Thu, 17 Jun 2021 21:49:20 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 3ABB961241 for ; Thu, 17 Jun 2021 21:49:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3ABB961241 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zEpYQmt7JQ21OnCLg7XORV3z/UfD1x9rwl1GipodwUE=; b=DXfmsV1gD4LTpP a+OeFY0DEgdgqgV8PQrpytDrhBgYMPHnwEN9dQa4lq03YVoRNnKluoea/XZrqdxNlHctbmrNUyhXi mHjQ83XgkRDVclhD/rWr0ZrCtIxrBYFTHjH7bwMBM849ykHBcnvhhnI/zRlSqUV8EKNPJMAcsVecG b6GmJtMCasfCfRl9RGluHFBA5EF4QhjDZAmBQY7gx+Q6VEQIbRC3hV7GDLH6zQ+YT8wurolMxeg3l HswJPBkT+fFx8vEcAhBJnu0hOUAM/iZNojyvHQScWGZll57Rkkvdtw+GtOptROnInZNYHV4Q0WIik zAUJcrL8ZwKrkI5E+qMw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltzrh-00BsV1-N6; Thu, 17 Jun 2021 21:47:57 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltzrd-00BsUe-VZ for linux-arm-kernel@lists.infradead.org; Thu, 17 Jun 2021 21:47:55 +0000 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-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210617_144754_093329_B32EA5C2 X-CRM114-Status: GOOD ( 21.69 ) 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 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel