Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp514814rwb; Mon, 26 Sep 2022 02:03:51 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6HcWhpFwhErKH7gOheYF3fdBhI63VtylzmFyfyr5+1UQOz/1aKPntlv/LFu9XWhfzvSSPK X-Received: by 2002:a17:907:6e1e:b0:782:19e7:f5e8 with SMTP id sd30-20020a1709076e1e00b0078219e7f5e8mr16910749ejc.215.1664183030786; Mon, 26 Sep 2022 02:03:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664183030; cv=none; d=google.com; s=arc-20160816; b=qjvMAYb0dzX6sxLSqjHN02ZqNBbrnToCIA2IsIswfRZjjQEX00CiwjxdUbTPK4mP6d A3bJqUF7hcvpHltbFpk2tSfM3oresVe/fBcVVByHWzk/8fUzW/vraWGiFO5d6aVdCoq/ hMEFeCBsF5ka+Vfh9s2MORKjGNbjkBkig1qxIoJrVE20jMHAc+PJ3GByHM/FECelxcjR lGrqIkyzM7ScZ8vASG6ID3UwSQuMxZpKs7jUwX7fUEqwmgyoUJA4NcK1bdI8fZbP2R8C +PsLPrZcAE98NzvXe8O31O8sz8nP62rGsmG/rBD1u8JwK85D0jdu3+FD4RQylDXOEbws q7dw== 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=q89NyQ9b1PpoKXEkGp2ns+Ib3Shkz3cUPYaSufAXKUc=; b=ocyY93+Wf8H0GaiION8p0LGC272w0sPqmHisrdU6pj562RwOrIwORyRZ3HiBjpjZge TgsmGR0gnNd4/LsOEnIXSSPh7AJHP2CKxtmGZgRv8VnE/ZRgak/SumlsGidWMAF6C/sz 5jaU0lG5aZqdWC/Boairgg3Z4vCIeVLHyDP82cwVt/he8X/2C8meqSB1EE5SqWDP6pcG HHOVbBmu5n2/Dq7kU2L+hLmLsWzIkfsh52oLfL1RfjnOdZR6FgHtypraLVt/HjcvnN1O q0sZN16ZjBpDbCWuNE3ZlO2OCEqPB3xu9PGf7d+bPu+9ceIRNTo6AhcaayAhTv+yo2JM 3DFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="n/ZXnZb9"; 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 s5-20020a50d485000000b0045435a1c674si13078209edi.348.2022.09.26.02.03.13; Mon, 26 Sep 2022 02:03:50 -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="n/ZXnZb9"; 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 S234540AbiIZI5e (ORCPT + 99 others); Mon, 26 Sep 2022 04:57:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233509AbiIZI5c (ORCPT ); Mon, 26 Sep 2022 04:57:32 -0400 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9AA2102E for ; Mon, 26 Sep 2022 01:57:30 -0700 (PDT) Received: by mail-ed1-x533.google.com with SMTP id y8so8018492edc.10 for ; Mon, 26 Sep 2022 01:57:30 -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=q89NyQ9b1PpoKXEkGp2ns+Ib3Shkz3cUPYaSufAXKUc=; b=n/ZXnZb952U5lWurVM94tkGD6ar7Ax0UfVipCAlGLuHtleFEQEIN8GHQ1RxzVtONhj In6/yRm/tdgCGv8hilqP8gcd7Oqi2ZwL3QVpyvlv8kYKqjGjKzLXsy+X0BGAE38HpLbD H/LXzx8uHjOrCBpNJnaINnVOmlDy+OhaZAJgY= 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=q89NyQ9b1PpoKXEkGp2ns+Ib3Shkz3cUPYaSufAXKUc=; b=lWCK3QvISHPB5ej2ogvRe+aZ/SoWRTJBBQIwC3fAhrpZFbNYxYSrGnOsseRRf7NMaB bbZSiz328GjYUNiU6gsGwRhaDHPuUeW2jZwpMORuMVofD05aeVmxKsOwJ7KqbwmGBkVG O5kfUvYBZLXz1UsqO91oxzH45CmUqhYZq86oghELukj4lxqXxlPRJgjWKvVczZxochUA EeiHx7FPzZvOHFB4qtIQvKCBRGhDxFxsOuPLDjqQVB+dlMfm2/5DiaF33Ol5HmC9SR4n cmK4wrUlgDmQbme/9c0rLJNQnzfdEqPw3GiQ4ryeIa9NI+4rqKvr/BBFlxP2Qqhw9N7I 74+Q== X-Gm-Message-State: ACrzQf3STMSG30K7/F1hd0oJJ14W7aX3Kdes/3rb9VevuPauNI6Dds9m pUmlR3Qi845lEZnIY/NU1N4Fzxm5eaPjUluWVOcYEw== X-Received: by 2002:a05:6402:90e:b0:443:ec4b:2b03 with SMTP id g14-20020a056402090e00b00443ec4b2b03mr20918608edz.71.1664182648982; Mon, 26 Sep 2022 01:57:28 -0700 (PDT) MIME-Version: 1.0 References: <20220915072458.18232-1-angelogioacchino.delregno@collabora.com> <20220915072458.18232-6-angelogioacchino.delregno@collabora.com> <9f7d1eda-cdf3-5108-7e9d-a10937fe224e@collabora.com> In-Reply-To: <9f7d1eda-cdf3-5108-7e9d-a10937fe224e@collabora.com> From: Chen-Yu Tsai Date: Mon, 26 Sep 2022 16:57:17 +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=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 Mon, Sep 26, 2022 at 4:36 PM AngeloGioacchino Del Regno wrote: > > Il 26/09/22 05:27, Chen-Yu Tsai ha scritto: > > 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's direct parent is mfg_ck_fast_ref - yes - but in the commit message > I am explaining how the clock tree for MFG_BG3D really is and, in particular, > I'm then explaining that: > * parenting MFG_BG3D to "top_mfg_core_tmp" is wrong; because > * "top_mfg_core_tmp" is a parent of "mfg_ck_fast_ref" (not the other way around). > > So, the question in your comment is addressed just a little later.... > > >> MFG_BG3D gate to the latter and add the CLK_SET_RATE_PARENT > > ...here, where I say "reparent MFG_BG3D to the latter", where "the latter" is, > exactly "mfg_ck_fast_ref". > > I hope you now understand what I am trying to communicate :-) > > However, if even after that you still think that the commit description should > be rewritten in some less tangled and/or more understandable way, I definitely > can do that. > > Please confirm :-) I think This also implies that "top_mfg_core_tmp" is a parent of the "mfg_ck_fast_ref" mux (and not vice-versa) actually confused me. Maybe just say The clock gate comes after all the muxes, so its parent is mfg_ck_fast_ref, not top_mfg_core_tmp. Reparent mfg_bg3d to the latter to match the hardware ... Since you are fixing the topology, could you also add a fixes tag? Thanks ChenYu > >> 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 > >> > >