Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1940638rwb; Thu, 17 Nov 2022 04:30:12 -0800 (PST) X-Google-Smtp-Source: AA0mqf7sy0KbKY5d+K0LkaDKtCN1t84Xc1vh1VOihSWxH7eMkNDAvO1bDqH+kRN7+ZEfEN8vWdD0 X-Received: by 2002:a17:90a:3d41:b0:213:d34:a80b with SMTP id o1-20020a17090a3d4100b002130d34a80bmr2661567pjf.74.1668688212075; Thu, 17 Nov 2022 04:30:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668688212; cv=none; d=google.com; s=arc-20160816; b=igRFcs1e/4QL4yh3QTxtKCU6C1ouYXTCFwTNYOE00nS6szTfQt3pSNSNHstEx2XkeA NG+iKN41PzIXmU95Xb6JBHeZnhIXnv5oaRE18kKVjc36xVu/9r0loTmaKKAAUYvF3Av+ 36cspzuXFRhefVmYf+07UFCZNX1E61iNvz2wPuauUvIJL0/yoorZj8NH5YcRoCY0dmbS a4BikYIwyFkWydrfEpi6UZ7JssI0aPMkB16K/85nfsmgyBN4/96p0iUs1PWEITjnMeKr G8yPf9f5DmCUQcakA8u/nB6d7h6+yQiAte/4AgJvugIwEMs+hFPBCBhPCoLLZSunoHzz s12g== 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 :message-id:date:subject:cc:to:from; bh=mh+WQ4Dag56x4WrC6NzDIHnuMZ0R0aDzc9zj5qyiNBI=; b=E7dMXedaSDCMOlaxm7xK95p9cSLA+tMeHfFRQ1hrKXqikNlxLbNhl5liu9ONKwGOym apfVw7EPMzWOBoToX34qpkI73bMtQp6fZjm+77IlPPI/68ufZlg6wZbDgFfxSCr3ib01 K7hAadfVufGwZY0QJ8FLLCIiFS+tHwNjV6/GzVoKy5HhInbmkWpec/SMPKI+abodOzQk U6Fjr1aIO6an+O0ivkjOc7EQV1GD1/tXWIdVwlVbt8fBz23VAEU66uaygiMfMMEIB+nH vUT8ftEKbnICfdwszjY20bmCFxyvKAIThUsN6LjGDOr0WFshKs6raL9adDd/Pl0AO3q0 LDLA== 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 w130-20020a628288000000b00571b10549b0si758496pfd.87.2022.11.17.04.30.00; Thu, 17 Nov 2022 04:30:12 -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; 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 S239925AbiKQMFI (ORCPT + 92 others); Thu, 17 Nov 2022 07:05:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239760AbiKQMFF (ORCPT ); Thu, 17 Nov 2022 07:05:05 -0500 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::223]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82CE65EF81; Thu, 17 Nov 2022 04:05:03 -0800 (PST) Received: (Authenticated sender: foss@0leil.net) by mail.gandi.net (Postfix) with ESMTPSA id 98CCB6000F; Thu, 17 Nov 2022 12:04:58 +0000 (UTC) From: Quentin Schulz To: Stephen Boyd , Heiko Stuebner , Xing Zheng , Michael Turquette Cc: Quentin Schulz , linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, stable@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] clk: rockchip: rk3399: allow clk_cifout to force clk_cifout_src to reparent Date: Thu, 17 Nov 2022 13:04:31 +0100 Message-Id: <20221117-rk3399-cifout-set-rate-parent-v1-0-432548d04081@theobroma-systems.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Mailer: b4 0.10.1 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE 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 From: Quentin Schulz clk_cifout is derived from clk_cifout_src through an integer divider limited to 32. clk_cifout_src is a child of either cpll, gpll or npll without any possibility of a divider of any sort. The default clock parent is cpll. Let's allow clk_cifout to ask its parent clk_cifout_src to reparent in order to find the real closest possible rate for clk_cifout and not one derived from cpll only. Cc: stable@vger.kernel.org # 4.10+ Fixes: fd8bc829336a ("clk: rockchip: fix the rk3399 cifout clock") Signed-off-by: Quentin Schulz --- clk: rockchip: rk3399: allow clk_cifout to force clk_cifout_src to reparent This used to be correct before v4.10 but commit fd8bc829336a ("clk: rockchip: fix the rk3399 cifout clock") incorrectly removed this ability while reworking it. Note: this has been tested on top of v6.0.2 only but no changes were made to this driver since. As for older stable releases, the git context seems identical and there does not seem to have been any logical change introduced since v4.10 so it should be pretty safe to apply. To: Michael Turquette To: Stephen Boyd To: Heiko Stuebner To: Xing Zheng Cc: linux-clk@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-rockchip@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- drivers/clk/rockchip/clk-rk3399.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/rockchip/clk-rk3399.c b/drivers/clk/rockchip/clk-rk3399.c index 306910a3a0d38..9ebd6c451b3db 100644 --- a/drivers/clk/rockchip/clk-rk3399.c +++ b/drivers/clk/rockchip/clk-rk3399.c @@ -1263,7 +1263,7 @@ static struct rockchip_clk_branch rk3399_clk_branches[] __initdata = { RK3399_CLKSEL_CON(56), 6, 2, MFLAGS, RK3399_CLKGATE_CON(10), 7, GFLAGS), - COMPOSITE_NOGATE(SCLK_CIF_OUT, "clk_cifout", mux_clk_cif_p, 0, + COMPOSITE_NOGATE(SCLK_CIF_OUT, "clk_cifout", mux_clk_cif_p, CLK_SET_RATE_PARENT, RK3399_CLKSEL_CON(56), 5, 1, MFLAGS, 0, 5, DFLAGS), /* gic */ --- base-commit: cc675d22e422442f6d230654a55a5fc5682ea018 change-id: 20221117-rk3399-cifout-set-rate-parent-1fbf0173ef2d Best regards, -- Quentin Schulz