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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 8CB9BEEB57A for ; Sat, 9 Sep 2023 00:06:58 +0000 (UTC) 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:Date:To:Cc:From:Subject:References: In-Reply-To:MIME-Version:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=M2MFUWFJGJEpotz41MBvKQpy6B+zIruiLq6nKUWqTGs=; b=gnrvcGaJFyl9Xw hGf0zRLVVkRBSVZ0LSorjwhCU60zOXw63oS6Jd5huNPr107gFrw0Z2PiRrqW5FYnh4MSPdPo+kwYy FzMmRfWc2yZ//TbWvxaXoDEWPwYFDnhjy7sO2Il30Jna+keU7moEuyQSX5bWUbNP3miTvaYD5kiHC PpMJDGgL9knZQIsBWU7CbC5wtgwFCc3UOFpNBHAJcl47zUjxOR/fEynpCbjNBiCZQ4d0HmRDzk3Wb wo+9OxVHRHhQHRdG77aW1ZI/+Aw9swtldaFbVeKpB/wDiTqmOKssjPynpZZAxIUe7bmg5uJp1ZWFW iICwlStWIUZ/ib4Kp8Gg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qelUc-00EjBZ-2l; Sat, 09 Sep 2023 00:06:30 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qelUa-00EjAt-0i for linux-arm-kernel@lists.infradead.org; Sat, 09 Sep 2023 00:06:29 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id C9147CE1C53; Sat, 9 Sep 2023 00:06:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C883C433C7; Sat, 9 Sep 2023 00:06:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694217982; bh=poS1zC35Ou/Eox389O+3kfe0qq35tr84EXWEkWfw4t8=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=H7TpepoHQXgtTAWLHdiOh2jg9Ru/6aWmR3xB0V/FEtXn+7gm7h6+vUeVmgspIZl8V be3+XTBaOO1LzjsJHRPHrffUsJDL0n08V1eggRLhl83qLfQfGxx+AmLsA2q+aXpSKX G25FJgRwy5tPNJTjhBSUmJhRA1HD/PjyQxYwW9Ns1Hp5XYbETB4b5iJdR4OPU4tJph QsXB3LyWPSmcERUnpLFezFlaCaE5t0xFMrXlgL7hrGR8BmSXwTJfoNE/zJVzBsDJ16 LnLT0ti4uah/6RLQ8fMR6Td9iBZFK4dIlSkORNwP5+/LV0WRXmhieRRv/feZCwF9km /ctQR3brRbT6A== Message-ID: MIME-Version: 1.0 In-Reply-To: <79a79ec5-3691-43d2-ca3e-478a94f85e2d@tuxon.dev> References: <20230727053156.13587-1-claudiu.beznea@tuxon.dev> <20230727053156.13587-4-claudiu.beznea@tuxon.dev> <412f9209637e6eb861cd07e1d6dbc346.sboyd@kernel.org> <79a79ec5-3691-43d2-ca3e-478a94f85e2d@tuxon.dev> Subject: Re: [PATCH 03/42] clk: at91: sam9x60: switch to parent_hw and parent_data From: Stephen Boyd Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com To: alexandre.belloni@bootlin.com, claudiu beznea , mripard@kernel.org, mturquette@baylibre.com, nicolas.ferre@microchip.com Date: Fri, 08 Sep 2023 17:06:18 -0700 User-Agent: alot/0.10 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230908_170628_675951_007F8128 X-CRM114-Status: GOOD ( 26.08 ) 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 Sorry, I missed this series in my review queue. Quoting claudiu beznea (2023-08-01 21:24:54) > On 29.07.2023 06:28, Stephen Boyd wrote: > > Quoting Claudiu Beznea (2023-07-26 22:31:17) > >> @@ -177,31 +178,34 @@ static const struct { > >> - td_slck_name = of_clk_get_parent_name(np, i); > >> - > >> - i = of_property_match_string(np, "clock-names", "md_slck"); > >> - if (i < 0) > >> + td_slck_hw = __clk_get_hw(clk); > > > > Don't introduce more usage of __clk_get_hw(). The index for "td_slck" > > should be known, and it can be used as the index member in struct > > clk_parent_data. This allows the clk framework to lazily find the > > parent, instead of requiring the parent to be registered before this > > code runs. It also reduces the usage of __clk_get_hw(). > > If I'll do this I will have to also change the approach that has been done > for SAMA7G5 (already integrated in v6.5-rc1, maybe I had to let it more on > the mailing list before taking into the tree) for all the clock drivers > (basically instead of parent_hws I will have to provide parent_data to AT91 > clock registration APIs AFAICT). No issue with that... just telling... Ok. Please do that. > > The reason I did it with parent_hws + __clk_get_hw() on PMC parents in > SAMA7G5 is that SAMA7G5 PLL parent rate need to be known from the > registration to setup properly the PLL. Otherwise PLL will not lock if not > properly setup. For this I got the parent_hw for PLL parent to retrieve its > rate and thus I chose at that time to also get the clk_hw for the other > parents of PMC just to have the same approach on all parents (and it looked > to me that code will be simpler). You can use the regular clk_get() APIs for that if you're trying to enforce a "this clk must be registered first" sort of thing. If the clk_get() call fails, then the driver can probe defer, etc. But don't turn around and take that clk and call __clk_get_hw() on it to express the parent relationship. Instead, let the parent matching take place through the normal means. The goal is to get rid of __clk_get_hw() at some point. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel