Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp336674rwb; Wed, 9 Nov 2022 03:14:31 -0800 (PST) X-Google-Smtp-Source: AMsMyM5ozOHR8V5EWWCV/N+jJlInszIn+cNz/E2mEPjrqzsZhYP24Bi+GzzplnSY/y+Dank5RNb+ X-Received: by 2002:a05:6402:31f8:b0:461:937f:45de with SMTP id dy24-20020a05640231f800b00461937f45demr1103774edb.247.1667992471414; Wed, 09 Nov 2022 03:14:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667992471; cv=none; d=google.com; s=arc-20160816; b=cNRZ9raJJZg/KAtcGnUeFJ5M5pL9xc534mamhOfMRcrtzEWXGmlq4Th5bMSZcOfRF2 uk9i54+lk+oLAlR6srNSu84T9Ji7gVhtOMlOLbwoVb2l6KZm4Y8RO22lJ5f+EEaYm1Qz LQAZtj8cFFZByik/nkI8g47baCh+iN/9553vrBi7i9EvCEa4X8TnGJS5MZj5gqZbmjK+ dzyBprE9XNiw4tr2ad7X9E4i3wbg07cGFzI3vi7y9b0TnZw9GUKEs85pNBTjO3btcI58 j3cvThAg1k0K9oXYiYm2CdCZNCAI4Wzio5lsBxp+QhTKJYWoF+ImdhZ1Ss+ta8bPeooH iGqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:feedback-id:dkim-signature:dkim-signature; bh=vmOE1i1nn9SMlBuCJ3VnNfQD0xqLuGWwaNRgBFkPe6c=; b=JdJn2vRaWeSINhi0351BOnlWn4Fxcp4nDodYobruckV43fNNl8W1ZumY62cXjwwnKP 8zv4imqYvChPYMIhjSvHEPHVMp30QWdcBRMpMn6AGe/XrhcW8E8sxGgr1m1bS6R/pV5y dDuAsfPolHdHaccOERaLfgDyyK/aTQeqiivu8LMtO0bNd3TCDnWYDPVFrdx3+Rn5kHza F6NqonukA3WKkfwtYOENLexbSiWx/ef0iaH0d4ae9XDbpUdeAZtMrBUvxUdO+Ll/o0WK VXAOgSV1+XLRFjP3pzzq7xobMMfW0a1PDePXJ2ciwMhBwo+UhQR+YvHLTA75HH8yDcV5 dWWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm2 header.b=iUBuhX7k; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=TTY4LI5y; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q14-20020a170906144e00b00780ec98afafsi12262575ejc.113.2022.11.09.03.14.08; Wed, 09 Nov 2022 03:14:31 -0800 (PST) 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; dkim=pass header.i=@cerno.tech header.s=fm2 header.b=iUBuhX7k; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=TTY4LI5y; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230232AbiKILFz (ORCPT + 94 others); Wed, 9 Nov 2022 06:05:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229821AbiKILFx (ORCPT ); Wed, 9 Nov 2022 06:05:53 -0500 Received: from new4-smtp.messagingengine.com (new4-smtp.messagingengine.com [66.111.4.230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 648AC183A8; Wed, 9 Nov 2022 03:05:52 -0800 (PST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id A2BB358028C; Wed, 9 Nov 2022 06:05:51 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Wed, 09 Nov 2022 06:05:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1667991951; x= 1667999151; bh=vmOE1i1nn9SMlBuCJ3VnNfQD0xqLuGWwaNRgBFkPe6c=; b=i UBuhX7kriUxSCehPgyDNVaNazC6ZqYODyvhJk308S4xAUw5FR/DHRUqG16A1PS1v ENmxNSthPcYKnBHtEEF4NaMy6AMNMFRKmBB4ZMO5eWIGTyu5mcJ/lxtMQQKTp+Sl bQoUGjVADCr+WlHx0lEbNyRZEkgxaNZtrOmYQk0n2ac7Ict9gfpAbOd1BC7PqTrX 39etLAMsLKZQd37k5nG5BLcya9So/IuudBRhm20X4So5igEWds4fbHOimh5wN49/ ln1R90AfTyvxybxkoM8IkNdb6OToGOLdadgCnR968ucV/axdvSNCg+RE2oF7ctmL 2LiRGx0TVolehy8/Ne86g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1667991951; x= 1667999151; bh=vmOE1i1nn9SMlBuCJ3VnNfQD0xqLuGWwaNRgBFkPe6c=; b=T TY4LI5yFmrInBONewR1yb5qlBkxihM8159PIPlYDmWA5k3cs6R078ZVOeWwQKn+P +GckfW29QMZbSl2Ct2toWmPP/d/xCps3+gIRhC/48d53tAMpx3CcXdvjbcMdlGaH 418HC+LOEQXdmRN+xj8IKR8GWz1rDO6wMRy7uCnn56UrZhz/yjPEDpwf7vYX0fkH m0aRfjw4W6386+uBxP7werCj507zKudg266b6LBMV4hkq3aTnpLukKcBpCDI5KGA 8lLXnV2C7a6crYf665PdrAcrj1EAi4pI3ygcaSw2JcXkB3tTOxiiF/e+yvWF+UEd KTf55HOf20U+esBTcvDDw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrfedvgddvfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtugfgjgesthhqredttddtvdenucfhrhhomhepofgrgihi mhgvucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrg htthgvrhhnpeetgfelgefggeekkefggfeludeiudffjeffgeevveekjedukedtudeuteef teefgfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 9 Nov 2022 06:05:49 -0500 (EST) Date: Wed, 9 Nov 2022 12:05:48 +0100 From: Maxime Ripard To: Linus Walleij Cc: Stephen Boyd , Maxime Coquelin , Chen-Yu Tsai , Daniel Vetter , Nicolas Ferre , Thierry Reding , Jaroslav Kysela , Shawn Guo , Fabio Estevam , Ulf Hansson , Claudiu Beznea , Michael Turquette , Dinh Nguyen , Paul Cercueil , Chunyan Zhang , Manivannan Sadhasivam , Andreas =?utf-8?Q?F=C3=A4rber?= , Jonathan Hunter , Abel Vesa , Charles Keepax , Alessandro Zummo , Peter De Schrijver , Orson Zhai , Alexandre Torgue , Prashant Gaikwad , Liam Girdwood , Alexandre Belloni , Samuel Holland , Matthias Brugger , Richard Fitzgerald , Vinod Koul , NXP Linux Team , Sekhar Nori , Kishon Vijay Abraham I , Takashi Iwai , David Airlie , Luca Ceresoli , Jernej Skrabec , Pengutronix Kernel Team , Baolin Wang , David Lechner , Sascha Hauer , Mark Brown , Max Filippov , Geert Uytterhoeven , linux-stm32@st-md-mailman.stormreply.com, alsa-devel@alsa-project.org, linux-mediatek@lists.infradead.org, linux-phy@lists.infradead.org, linux-mips@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-actions@lists.infradead.org, linux-clk@vger.kernel.org, AngeloGioacchino Del Regno , patches@opensource.cirrus.com, linux-tegra@vger.kernel.org, linux-rtc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: Re: [PATCH v2 34/65] clk: ux500: prcmu: Add a determine_rate hook Message-ID: <20221109110548.4dcbkwx3jgjnhldw@houat> References: <20221018-clk-range-checks-fixes-v2-0-f6736dec138e@cerno.tech> <20221018-clk-range-checks-fixes-v2-34-f6736dec138e@cerno.tech> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS 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 Hi Linus, On Tue, Nov 08, 2022 at 02:25:04PM +0100, Linus Walleij wrote: > On Fri, Nov 4, 2022 at 2:32 PM Maxime Ripard wrote: >=20 > > The UX500 PRCMU "clkout" clock implements a mux with a set_parent hook, > > but doesn't provide a determine_rate implementation. > > > > This is a bit odd, since set_parent() is there to, as its name implies, > > change the parent of a clock. However, the most likely candidate to > > trigger that parent change is a call to clk_set_rate(), with > > determine_rate() figuring out which parent is the best suited for a > > given rate. > > > > The other trigger would be a call to clk_set_parent(), but it's far less > > used, and it doesn't look like there's any obvious user for that clock. > > > > So, the set_parent hook is effectively unused, possibly because of an > > oversight. However, it could also be an explicit decision by the > > original author to avoid any reparenting but through an explicit call to > > clk_set_parent(). >=20 > It is actually set up from the device tree, typically like this: >=20 > /* clkout1 from ACLK divided by 8 */ > clocks =3D <&clkout_clk DB8500_CLKOUT_1 DB8500_CLKOUT_SRC_ACLK 8>; >=20 > So the parent (source) and divisor comes in there. >=20 > clk->source and clk->divider is already set up when clk_hw_register() is > called. I wasn't aware that we had such bindings. AFAIUI, it looks redundant with assigned-clock-rates and assigned-clock-parents, could we deprecate it? > So set/get_parent() is never used on clkout. >=20 > I think I just added the callbacks for completeness, should we delete them > altogether? I can't really test any of these platforms, so I'm a bit wary of making such changes myself. Feel free to send a follow-up if you think it's needed :) > The patch is probably fine as-is as well so > Acked-by: Linus Walleij Thanks! Maxime