Message ID | 20221117-rk3399-cifout-set-rate-parent-v1-0-432548d04081@theobroma-systems.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp361335wrr; Thu, 17 Nov 2022 04:06:20 -0800 (PST) X-Google-Smtp-Source: AA0mqf7hBGfXx0i9qSO/rEd/kbZtL6kpLb5IUewFqAGH1C59NxATsELq+vjPTI4K5X7b0nhmNBRZ X-Received: by 2002:a17:906:3914:b0:7b2:7e90:53e4 with SMTP id f20-20020a170906391400b007b27e9053e4mr1868045eje.645.1668686779935; Thu, 17 Nov 2022 04:06:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668686779; cv=none; d=google.com; s=arc-20160816; b=uuaCItw707c6BZOOuSiLCh3tzDZp8jLx8fsjbLFeFYU4U6r4t28yiBiB6v/F7z+foQ 5/XsndnVrlN1eTksdaEe1rFTv3/+pLnDaWhbZOhxgLf/55Vmzg4HsBFL5+Ulq0Zb4VlM yQ+NgVZn9lu9pZeWdfrXp+zgu8DQN5zzPLokMI5WeE7ohI28ALXWCCp5jkTpo0xhL8ef 5BcHUp0wDbcHEUmqBeeTwY8V1AfAJ5FHcAKS/7sit85XPYI37aglcR2mHQLUEHFsL8wR lVDkvZjnbmy+NHj4GmxEU1zrh1Og8BMB3b0jpGmrOAyQ5Dka8DiEp/8Celk2QiYNBfh+ Lwdw== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hp14-20020a1709073e0e00b007ae29da29b3si496449ejc.731.2022.11.17.04.05.55; Thu, 17 Nov 2022 04:06:19 -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 <rfc822;a1648639935@gmail.com> + 99 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <foss+kernel@0leil.net> To: Stephen Boyd <sboyd@kernel.org>, Heiko Stuebner <heiko@sntech.de>, Xing Zheng <zhengxing@rock-chips.com>, Michael Turquette <mturquette@baylibre.com> Cc: Quentin Schulz <quentin.schulz@theobroma-systems.com>, 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749744909241044969?= X-GMAIL-MSGID: =?utf-8?q?1749744909241044969?= |
Series |
clk: rockchip: rk3399: allow clk_cifout to force clk_cifout_src to reparent
|
|
Commit Message
Quentin Schulz
Nov. 17, 2022, 12:04 p.m. UTC
From: Quentin Schulz <quentin.schulz@theobroma-systems.com> 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 <quentin.schulz@theobroma-systems.com> --- 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 <mturquette@baylibre.com> To: Stephen Boyd <sboyd@kernel.org> To: Heiko Stuebner <heiko@sntech.de> To: Xing Zheng <zhengxing@rock-chips.com> 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(-) --- base-commit: cc675d22e422442f6d230654a55a5fc5682ea018 change-id: 20221117-rk3399-cifout-set-rate-parent-1fbf0173ef2d Best regards,
Comments
Hi all, Gently pinging as it hasn't received any review and I couldn't find the patch in a branch in the linux-clk tree. Cheers, Quentin On 11/17/22 13:04, Quentin Schulz wrote: > From: Quentin Schulz <quentin.schulz@theobroma-systems.com> > > 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 <quentin.schulz@theobroma-systems.com> > --- > 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 <mturquette@baylibre.com> > To: Stephen Boyd <sboyd@kernel.org> > To: Heiko Stuebner <heiko@sntech.de> > To: Xing Zheng <zhengxing@rock-chips.com> > 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,
On Thu, 17 Nov 2022 13:04:31 +0100, Quentin Schulz wrote: > From: Quentin Schulz <quentin.schulz@theobroma-systems.com> > > 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. > > [...] Applied, thanks! [1/1] clk: rockchip: rk3399: allow clk_cifout to force clk_cifout_src to reparent commit: 3ad07d73ae650057fe64b2d85721c644a30428c1 Best regards,
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 */