Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp22631849rwd; Fri, 30 Jun 2023 10:23:02 -0700 (PDT) X-Google-Smtp-Source: APBJJlH5YJZ+F2hbmVpC8ZOQyFxYJ7LHD095mUXNAF/wtpjGY3iAOvPwIaYsaId57LXH9QlrzoG/ X-Received: by 2002:a05:6a00:148b:b0:65d:d5cd:6f17 with SMTP id v11-20020a056a00148b00b0065dd5cd6f17mr3605445pfu.24.1688145782078; Fri, 30 Jun 2023 10:23:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688145782; cv=none; d=google.com; s=arc-20160816; b=pA+29L2auQPvjE3XxXe1dA4EXu88rkESE7dgEMGa0lG8BcitYsD14yA9AKh7O3Zpf8 7vLUM07+zxIK7yeugJ7+aNWGWZ3EYv724T+ArctGruBGgIrOZCjGTGsWh3D5xJqoIEge z6jYTUzjBIIo1gYI66aMR5nEza6EWERCgJhJpLTDmP3f66+cgLWEmW8kegkmkfGsdrJ1 XZGC++MKtWhKYtqxJahp8fzKbd46F9MUMKWzethfmMaJwJbFfgX8uSp3KleG9kVat1Jv djYBs7QTBQlhkJ4gskP+LD2anjUpEGK/1bd2BAbtdtX5B7nAVBVsmJmUhddIu8cEUqg6 4gNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from; bh=Gu355W1gOFoI7oLXeE5OkEOfVRibb0diNifNsGa4HQ0=; fh=668c0s/f6SitzINdNnWkEIGLERwBNAHMyXp2yvkghCE=; b=INFJSrCham8dW9nECn2Ya2wgZV+3pDoiGzU0Mqz30UKn58J1zrObGfWEj6pJngcZNq 7/5IPtJdOnixpWafnAbX/q9b2Apv31Bf3W5VBbmD10+rAsbD5vPduYBWON7xbfCGV+lF 4IgTwQyt8tGTwB+24qDGwOyOGZUPeLrJQctBCXWJ8hgTux06KYa98dAKb8kLERUwO8xn C702bv0733ATYIuS10qF+ovL5FUoZy1Ogq4WO3x140izDnTy9B5PqglA7D8BXhjv35oP /NzLomG9pjdkl/7UaDbvP0xW46YKVbs9lw/2kBRDUlyD6sS1TFOB4p11SRRn3r3IV6JO iPhw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y40-20020a056a00182800b0066a66144278si13636584pfa.108.2023.06.30.10.22.47; Fri, 30 Jun 2023 10:23:02 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232848AbjF3REv convert rfc822-to-8bit (ORCPT + 99 others); Fri, 30 Jun 2023 13:04:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232800AbjF3REc (ORCPT ); Fri, 30 Jun 2023 13:04:32 -0400 Received: from unicorn.mansr.com (unicorn.mansr.com [81.2.72.234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4930244AC; Fri, 30 Jun 2023 10:03:50 -0700 (PDT) Received: from raven.mansr.com (raven.mansr.com [81.2.72.235]) by unicorn.mansr.com (Postfix) with ESMTPS id E44D915360; Fri, 30 Jun 2023 18:03:48 +0100 (BST) Received: by raven.mansr.com (Postfix, from userid 51770) id BFA04219FD1; Fri, 30 Jun 2023 18:03:48 +0100 (BST) From: =?iso-8859-1?Q?M=E5ns_Rullg=E5rd?= To: Maxime Ripard Cc: Samuel Holland , Chen-Yu Tsai , Jernej Skrabec , linux-sunxi@lists.linux.dev, Michael Turquette , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Stephen Boyd , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 3/4] clk: sunxi-ng: Convert early providers to platform drivers References: <20211119033338.25486-1-samuel@sholland.org> <20211119033338.25486-4-samuel@sholland.org> Date: Fri, 30 Jun 2023 18:03:48 +0100 In-Reply-To: (Maxime Ripard's message of "Fri, 30 Jun 2023 16:17:32 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 Maxime Ripard writes: > On Wed, Jun 28, 2023 at 07:33:35PM +0100, M?ns Rullg?rd wrote: >> Maxime Ripard writes: >> >> > On Wed, Jun 28, 2023 at 12:07:56PM +0100, M?ns Rullg?rd wrote: >> >> Maxime Ripard writes: >> >> >> >> > On Mon, Jun 26, 2023 at 01:21:33PM +0100, M?ns Rullg?rd wrote: >> >> >> Samuel Holland writes: >> >> >> >> >> >> > The PRCM CCU drivers depend on clocks provided by other CCU drivers. For >> >> >> > example, the sun8i-r-ccu driver uses the "pll-periph" clock provided by >> >> >> > the SoC's main CCU. >> >> >> > >> >> >> > However, sun8i-r-ccu is an early OF clock provider, and many of the >> >> >> > main CCUs (e.g. sun50i-a64-ccu) use platform drivers. This means that >> >> >> > the consumer clocks will be orphaned until the supplier driver is bound. >> >> >> > This can be avoided by converting the remaining CCUs to use platform >> >> >> > drivers. Then fw_devlink will ensure the drivers are bound in the >> >> >> > optimal order. >> >> >> > >> >> >> > The sun5i CCU is the only one which actually needs to be an early clock >> >> >> > provider, because it provides the clock for the system timer. That one >> >> >> > is left alone. >> >> >> > >> >> >> > Signed-off-by: Samuel Holland >> >> >> > --- >> >> >> > >> >> >> > (no changes since v1) >> >> >> > >> >> >> > drivers/clk/sunxi-ng/Kconfig | 20 ++++---- >> >> >> > drivers/clk/sunxi-ng/ccu-sun4i-a10.c | 58 +++++++++++++-------- >> >> >> > drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c | 56 ++++++++++++-------- >> >> >> > drivers/clk/sunxi-ng/ccu-sun50i-h616.c | 33 ++++++++---- >> >> >> > drivers/clk/sunxi-ng/ccu-sun6i-a31.c | 40 +++++++++++---- >> >> >> > drivers/clk/sunxi-ng/ccu-sun8i-a23.c | 35 +++++++++---- >> >> >> > drivers/clk/sunxi-ng/ccu-sun8i-a33.c | 40 +++++++++++---- >> >> >> > drivers/clk/sunxi-ng/ccu-sun8i-h3.c | 62 ++++++++++++++-------- >> >> >> > drivers/clk/sunxi-ng/ccu-sun8i-r.c | 65 ++++++++++++++---------- >> >> >> > drivers/clk/sunxi-ng/ccu-sun8i-v3s.c | 57 +++++++++++++-------- >> >> >> > drivers/clk/sunxi-ng/ccu-suniv-f1c100s.c | 38 ++++++++++---- >> >> >> > 11 files changed, 332 insertions(+), 172 deletions(-) >> >> >> >> >> >> This broke the hstimer clocksource on A20 since it requires a clock >> >> >> provided by the sun4i ccu driver. >> >> > >> >> > The A10 is probably broken by this, but the A20 should be able to use >> >> > the arch timers just like all the other Cortex-A7-based SoCs. >> >> > >> >> > Do you have a dmesg log that could help debug why it's not working? >> >> >> >> The A20 works as such since, as you say, it has other clocksources. >> >> However, the hstimer has become unusable. If anyone was using, for >> >> whatever reason, it won't be working for them now. >> >> >> >> Before this change, the kernel log used include this line: >> >> >> >> clocksource: hstimer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6370868154 ns >> >> >> >> Now there is only a cryptic "Can't get timer clock" in its place. >> >> >> >> As it is now, the hstimer driver is nothing but a waste of space. >> >> I figure it ought to be fixed one way or another. >> > >> > Yeah, definitely. >> > >> > IIRC, the situation is: >> > >> > - A10 has just the "regular", old, timer >> > - A10s/A13/GR8 has the A10 timer + hstimer >> > - A20 has the A13 timers + arch timers >> > >> > We also default to the hstimer only for the A10s/A13 which aren't >> > affected by this patch series afaics. >> > >> > We also enable the HS timer for the A31, but just like the A20 it >> > doesn't use it by default, so it's probably been broken there too. >> > >> > I guess one way to fix it would be to switch the HS timer driver to a >> > lower priority than the A10 timer, so we pick that up by default instead >> > for the A10s/A13, and then convert the HS timer driver to a proper >> > platform_device driver that will be able to get its clock. >> > >> > The downside is that the A13 will lose some precision over its default >> > timer, but I don't think it's a big deal. >> >> The options I see are converting the hstimer to a platform device or >> reverting the change to the sun4i ccu driver. >> >> I don't personally have much of an opinion on this since my systems >> aren't affected. The only reason I looked at it was that I noticed >> a new error message in the kernel logs. > > Thanks for the report then. I'm not really working on that anymore, so I > won't submit a fix for this either. I can have a go at converting it to a platform device if you think that's the right approach. I don't have anything other than A20 to test it on, though. -- M?ns Rullg?rd