Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp292245rwb; Sun, 25 Sep 2022 21:03:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5jkCZUnhbu3uY3/Hd86yDNGET/3PILvBtY52bUkgbHeLYLJTTVO4n2tMXRztmvSFzIbArK X-Received: by 2002:a17:907:e91:b0:782:607a:8dc9 with SMTP id ho17-20020a1709070e9100b00782607a8dc9mr16317524ejc.729.1664165006822; Sun, 25 Sep 2022 21:03:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664165006; cv=none; d=google.com; s=arc-20160816; b=SfxTyhZgSfVhaqs/3lW2raSpMB4rOPpkhZW2BKjV/4DEW+/Z9dwHv0EOB1jq94DO/W 0cuds4LKDMuqei8Nw9aiAyRSQvTMGutjvCqcbFU4DjfLqtEjFJGIg9Lwms9vEPtU8O1v 6dszM5Pa++Z4g9xmfdaVRe6eK/9LP4RqPmHoCGkOsey+yCrx9sBiEvrX6rsZp3iDfHtB B6RSXBMfYmG57dgIuiUc924aipJQX8KuPhqrhyChKif8jz4/QiTJcbC/cGNkRcsFhmhe s5BNVjSxqLpsI0ixZymtbBB57D3G8UTuKl8wxKPmdzIfwT9SoaAB9v2EUDnDMgTUBxX5 aJJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=1z+K3iZ5edH9Wvs3sWpMytE5kCGm2zb+7oEAH+Nf3iQ=; b=hgWPUyN9GyEpb36M259yZkJ0jtusCkbzE6X9ea9/bvb2XVYPb4TOFD2miuvngepwix P0TpEcN2dQYFHtQ0R/6wVBd1s9LEzolHPRpMdvzDhhalKAlqsjU4o+eGsRbb+FEw92QL suV1fkbFTITbFI+5DRPv/iGsmNzzV5K/CuhN3+si6RTH4RXborcOaEivsHyHxy1/l+zZ 9cF5X30rvYPkbS8wZ0pyyhkYXcP2aGaUwLaUoOGS9Fyxc86W+//NfsknjmaXK88R1NZc +Rz6TRP0n3r6hFy67pKyTJqFl07bSuGXNp4HnqIZUxnVVPmN6cMZ3PciFo4Ig4gsmU+7 eDHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=eJhq7Fc2; 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=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id du1-20020a17090772c100b0078333d9f17bsi4112320ejc.819.2022.09.25.21.02.57; Sun, 25 Sep 2022 21:03:26 -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=@chromium.org header.s=google header.b=eJhq7Fc2; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231396AbiIZD1u (ORCPT + 99 others); Sun, 25 Sep 2022 23:27:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231176AbiIZD1r (ORCPT ); Sun, 25 Sep 2022 23:27:47 -0400 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E70A24F1A for ; Sun, 25 Sep 2022 20:27:46 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id c30so6091769edn.2 for ; Sun, 25 Sep 2022 20:27:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=1z+K3iZ5edH9Wvs3sWpMytE5kCGm2zb+7oEAH+Nf3iQ=; b=eJhq7Fc27wKeinfDqhvMNOiJ/Gb1/og0KmVp3G+UnwXEDuClmgZJTTtEdniYEEOZTu PkHeKnkfj5Nz22Ox5Hm6qKfgc47pn/rMMFS/mdiS+DoqM4BTAKvibBmdiJ5XQLJZrvMQ qyrnEu2NdvfYAGMs7Cl67PsiuzyzFdl8K592U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=1z+K3iZ5edH9Wvs3sWpMytE5kCGm2zb+7oEAH+Nf3iQ=; b=OSuLRPHk3z1yokB1mdGFWLyv4J4Zcj4q7Fh73+tJ3p1GXhYDy6FPI3fXF7gdruvBqW y+VRfOhIfNeF4t6HAnqoSZXspvVCwRv/p7gCBE3RGQevbghWLjqAdVuQZzn5nEalOp16 k0mx1MswFxvt679zqzypriNhoSl7IGzDUiF9JB1qgP8HsZnB4MNQ1gHUEgKIzk30nJ4S kIlX16Fdik0BD0iDvWLeeHY+HpF7UWjW8Eh5wFkNMIxFln4OL7KPPnvVLapBqYaawDUk JNZANC2ljxX9WUcjneJZsEmhZNLcPYr09GnuHPVnaooxohvGjxXISCtVvJPV7EVMsQ5W Rpbw== X-Gm-Message-State: ACrzQf3EF3mD+a/jNCn4pg4QY1rOtKALNQbo0s7Ha5j5g3gjaH7JkmnA VznVA8ygTV9gO36PFkv5lp1jtAIvWuprIfP3f9XtNw== X-Received: by 2002:a05:6402:3549:b0:454:414e:a7fd with SMTP id f9-20020a056402354900b00454414ea7fdmr21116157edd.69.1664162864997; Sun, 25 Sep 2022 20:27:44 -0700 (PDT) MIME-Version: 1.0 References: <20220915072458.18232-1-angelogioacchino.delregno@collabora.com> <20220915072458.18232-6-angelogioacchino.delregno@collabora.com> In-Reply-To: <20220915072458.18232-6-angelogioacchino.delregno@collabora.com> From: Chen-Yu Tsai Date: Mon, 26 Sep 2022 11:27:33 +0800 Message-ID: Subject: Re: [PATCH v2 05/10] clk: mediatek: clk-mt8195-mfg: Reparent mfg_bg3d and propagate rate changes To: AngeloGioacchino Del Regno Cc: matthias.bgg@gmail.com, mturquette@baylibre.com, sboyd@kernel.org, miles.chen@mediatek.com, rex-bc.chen@mediatek.com, nfraprado@collabora.com, chun-jie.chen@mediatek.com, jose.exposito89@gmail.com, drinkcat@chromium.org, weiyi.lu@mediatek.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 Thu, Sep 15, 2022 at 3:25 PM AngeloGioacchino Del Regno wrote: > > The MFG_BG3D is a gate to enable/disable clock output to the GPU, > but the actual output is decided by multiple muxes; in particular: > mfg_ck_fast_ref muxes between "slow" (top_mfg_core_tmp) and > "fast" (MFGPLL) clock, while top_mfg_core_tmp muxes between the > 26MHz clock and various system PLLs. > > This also implies that "top_mfg_core_tmp" is a parent of the > "mfg_ck_fast_ref" mux (and not vice-versa), so reparent the I don't see where this was the case though? I think what you meant was that the direct parent for "mfg_bg3d" is "mfg_ck_fast_ref, not "top_mfg_core_tmp"? > MFG_BG3D gate to the latter and add the CLK_SET_RATE_PARENT > flag to it: this way we ensure propagating rate changes that > are requested on MFG_BG3D along its entire clock tree. > > Signed-off-by: AngeloGioacchino Del Regno Otherwise, Reviewed-by: Chen-Yu Tsai > --- > drivers/clk/mediatek/clk-mt8195-mfg.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/clk/mediatek/clk-mt8195-mfg.c b/drivers/clk/mediatek/clk-mt8195-mfg.c > index 9411c556a5a9..c94cb71bd9b9 100644 > --- a/drivers/clk/mediatek/clk-mt8195-mfg.c > +++ b/drivers/clk/mediatek/clk-mt8195-mfg.c > @@ -17,10 +17,12 @@ static const struct mtk_gate_regs mfg_cg_regs = { > }; > > #define GATE_MFG(_id, _name, _parent, _shift) \ > - GATE_MTK(_id, _name, _parent, &mfg_cg_regs, _shift, &mtk_clk_gate_ops_setclr) > + GATE_MTK_FLAGS(_id, _name, _parent, &mfg_cg_regs, \ > + _shift, &mtk_clk_gate_ops_setclr, \ > + CLK_SET_RATE_PARENT) > > static const struct mtk_gate mfg_clks[] = { > - GATE_MFG(CLK_MFG_BG3D, "mfg_bg3d", "top_mfg_core_tmp", 0), > + GATE_MFG(CLK_MFG_BG3D, "mfg_bg3d", "mfg_ck_fast_ref", 0), > }; > > static const struct mtk_clk_desc mfg_desc = { > -- > 2.37.2 >