Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp543576rwr; Thu, 4 May 2023 06:44:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5J4h6B3it4pisvXcNZcAnVoqGDl5OvtpoTsE2e8HdpfchMNeFEQWMqRyoBBMkkQmi7dvU6 X-Received: by 2002:a17:90b:384a:b0:24b:4e7b:c689 with SMTP id nl10-20020a17090b384a00b0024b4e7bc689mr2119162pjb.35.1683207881671; Thu, 04 May 2023 06:44:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683207881; cv=none; d=google.com; s=arc-20160816; b=tESNuARz1gJ9gDEYbwuteqWXFa0tn7qTreDGf1NYjmes80+e7pQ14ACbCnhVLK8XW6 ddx6croNd9Q1lM1eVYeo6pH4RjrtEtiSGAte8o9ywUwLCMw0Z2zFOZtkKKVytEf4LxFC AxiVhn3X23RUfpwKQ8XAxuayPH54tHth7sLSJo5RVXv9yHFAl8GYl7NkyxsZH9lrvKS9 nmc0cff9eGSrRteMXq1mxYPr3XKUT0nzl6YLIuMOy6gFREec70xjT3S/OPXiUO7ewR+7 XzjYt4kBwxvVeeWCQmpRYCZkzoA68tYL4WWQqCKHhoidEbvGDA8WwfmXq9uuwlB+FjCs vWsg== 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=zEWDZRH16IxZH8jYRpv51rOx+oio62y+XziPw6IiJ1w=; b=Cdxdha7YdMIADinuy+cM+9YqS9MI9eFMHekNQM65czvzG8g9xWzPw6FvsJzJEphDvk 99xPSgd9IGEI7fUMQUP/EMykX0VfCyIXnJGQwF00zrRQ4P0lvpWkaYY02a18/64D9DbF IigbgIP29axcWBWxUXWIKDOSDrYMeimEmUE82/9WZ6ZbeLGQHu+TnbGBD9q55ym1s85X A6OlxpUWuOpabx+2VymjqPFJ+TuNxPOWGk7fA/SBWTBjiheRl7YMYP8F78plwHnXZ1Wa E9S9Ol7J+usJUwW/DPebUyrz5sJ1cqDUK+QwqiLXep6b1ff0dD01P6lbl/7pslyYigKU HuBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=L9OXVtBp; 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=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b12-20020a63930c000000b005138c1f1fccsi6282529pge.31.2023.05.04.06.44.29; Thu, 04 May 2023 06:44:41 -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; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=L9OXVtBp; 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=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230430AbjEDNjo (ORCPT + 99 others); Thu, 4 May 2023 09:39:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229638AbjEDNjl (ORCPT ); Thu, 4 May 2023 09:39:41 -0400 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA08E768B; Thu, 4 May 2023 06:39:40 -0700 (PDT) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3445DKX4028271; Thu, 4 May 2023 08:39:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=PODMain02222019; bh=zEWDZRH16IxZH8jYRpv51rOx+oio62y+XziPw6IiJ1w=; b=L9OXVtBpZ1h2EQYPU9fS+CdLeJbQogB3ovHqBxHZV93tB0yyeToDCRKM+3p1Z+XcLFZz DhnfCDaIAxZdN2kEgqy91hT0ZkrDGwKDxWYOZyY84Bl71CaNzT/kQ6H7HeGti1LPjN2A 1C53tmN+15LZY4Xx0LsXz3jdPfYj804ASLi4vP04knaO2fZRiDoRcGlVawsjF8dnEBef /SeuYP9ruq4TACIUkQ8hZ4rHae8zIGOhnmbirZT1jFR/3kSOYyRRGhG6Ds8kk3q2z9qA m1ycJOjn8GapD45ROvo5FEKeAAyqeD0ftMxijnIycmgOTyr7CJvQgOt/JbzSOHf7FjX0 fg== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3q8ynqxxwk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 04 May 2023 08:39:25 -0500 Received: from ediex01.ad.cirrus.com (198.61.84.80) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Thu, 4 May 2023 08:39:24 -0500 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Thu, 4 May 2023 08:39:24 -0500 Received: from ediswmail.ad.cirrus.com (ediswmail.ad.cirrus.com [198.61.86.93]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id E168D11AA; Thu, 4 May 2023 13:39:23 +0000 (UTC) Date: Thu, 4 May 2023 13:39:23 +0000 From: Charles Keepax To: Maxime Ripard CC: Michael Turquette , Stephen Boyd , Andreas =?iso-8859-1?Q?F=E4rber?= , Manivannan Sadhasivam , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Max Filippov , Richard Fitzgerald , Maxime Coquelin , Alexandre Torgue , Luca Ceresoli , David Lechner , Sekhar Nori , Abel Vesa , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Matthias Brugger , Geert Uytterhoeven , Dinh Nguyen , Peter De Schrijver , Prashant Gaikwad , Thierry Reding , Jonathan Hunter , Ulf Hansson , Linus Walleij , David Airlie , Daniel Vetter , Vinod Koul , Kishon Vijay Abraham I , Alessandro Zummo , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Paul Cercueil , Orson Zhai , Baolin Wang , Chunyan Zhang , , , AngeloGioacchino Del Regno , , , , , , , , , , , , , Subject: Re: [PATCH v3 14/65] clk: lochnagar: Add a determine_rate hook Message-ID: <20230504133923.GE68926@ediswmail.ad.cirrus.com> References: <20221018-clk-range-checks-fixes-v3-0-9a1358472d52@cerno.tech> <20221018-clk-range-checks-fixes-v3-14-9a1358472d52@cerno.tech> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20221018-clk-range-checks-fixes-v3-14-9a1358472d52@cerno.tech> User-Agent: Mutt/1.5.21 (2010-09-15) X-Proofpoint-GUID: by0VDh8QAdOEbtK8UU7dmeZOMGxMIv4b X-Proofpoint-ORIG-GUID: by0VDh8QAdOEbtK8UU7dmeZOMGxMIv4b X-Proofpoint-Spam-Reason: safe X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On Tue, Apr 04, 2023 at 12:11:04PM +0200, Maxime Ripard wrote: > The lochnagar clocks implement 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(). > > The latter case would be equivalent to setting the flag > CLK_SET_RATE_NO_REPARENT, together with setting our determine_rate hook > to __clk_mux_determine_rate(). Indeed, if no determine_rate > implementation is provided, clk_round_rate() (through > clk_core_round_rate_nolock()) will call itself on the parent if > CLK_SET_RATE_PARENT is set, and will not change the clock rate > otherwise. __clk_mux_determine_rate() has the exact same behavior when > CLK_SET_RATE_NO_REPARENT is set. > > And if it was an oversight, then we are at least explicit about our > behavior now and it can be further refined down the line. > > Signed-off-by: Maxime Ripard > --- Tested-by: Charles Keepax Thanks, Charles