From patchwork Wed Oct 19 08:31:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 4803 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp216421wrs; Wed, 19 Oct 2022 02:18:22 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5PXli9TEEUv/wJZPx5Z3d/EwZzNcnkLQMYnT/qI7DIxK8pHcA0OzR3AQbwbWlYNJZpe15t X-Received: by 2002:a05:6402:d06:b0:45a:3ac6:ad26 with SMTP id eb6-20020a0564020d0600b0045a3ac6ad26mr6542324edb.195.1666171102546; Wed, 19 Oct 2022 02:18:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666171102; cv=none; d=google.com; s=arc-20160816; b=FUIUKeAKUvniizZPma5kadn19qGSuh4csUnwH3yavpeRD1Vs4muJJoLhUCOj8iMfvj yTwUevC4BtsUoyiCGXnG4etpc/x4aHdYvmIoeF4ly9moHSTPvTEjxMnj00UMUUqrPkm8 lhLbRBFiz4inbrpCk9eruXKewimfFIiKXKqLLifCTPpaLYNhZDcVtEBwmbhk35ghoX53 FQ94vOBic6zZFoMcfV9REFA6TyszdRsnXvoSShct2Z/zELm7sEOmyofuQiyjRBlLMH+q el8SSfiJy+We0gFD9tsPF07u3hq2F89rJ/yQ1igntHIgqE1eANkNNXYKymS4LRZzuADY nB+g== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZiZhiKH2+fKKIypKpgj/SHczTm3Euf9W+5FO4SHhG5M=; b=OaxL9MYrQueI5KIm43kG7aY8Yuk36Drtf8D9QBwPcSQHRzpS+pYzBiAN4H0Y08MQrn OZSOMj5miH/TpakgoM03+/Wr8e/oH2SbUTAhYesD5zVQwT+a4dFAQaiUIDO9DvHVVkHh GbD0arzL+UX4wg05Db980JYQfnlVDAViDzuWyTXbpFgKFcIEmH1mWN38TcTvz2MwxvrF baEB6ny+yHW2tQxp1/uUk+OEX8fDCPVY7JlGkgOzW+0pOXLhsXsArxKX2gSWjp4Aj3uQ henJncyoMLfdIckIHWXn95PEEkLAiNmxCG5SMawF2fOxl2q6Xvgjgb1CUUh1LYm903Mo Hzwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wzBUzrQc; 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=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id by28-20020a0564021b1c00b00454424b5c2csi12279919edb.314.2022.10.19.02.17.57; Wed, 19 Oct 2022 02:18:22 -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=@linuxfoundation.org header.s=korg header.b=wzBUzrQc; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233232AbiJSJRU (ORCPT + 99 others); Wed, 19 Oct 2022 05:17:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233282AbiJSJOe (ORCPT ); Wed, 19 Oct 2022 05:14:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 291481CFC0; Wed, 19 Oct 2022 02:04:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C801A61802; Wed, 19 Oct 2022 09:04:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DDCB5C433D6; Wed, 19 Oct 2022 09:04:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170246; bh=xwQFS+0dceWteJ5a9d7UTXfY02GKVvj6lofGoSNaXtU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wzBUzrQcJs8Rk3fLPisGvDwW2+2JKP4FVQUkDM+qjxopMVlsWyMztmCSJt3Yi9KdA 3PxGzbKd7KTI7MFkosvUUz0AanrD2foVlr3NfyQ7Ut1qBiPWJOT9y8EOee9rYxOT4R pJoMyKLBH8HLEpzWyxOVsIxS5CvF/UqT3m25u8Sc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, AngeloGioacchino Del Regno , Chen-Yu Tsai , Sasha Levin Subject: [PATCH 6.0 582/862] clk: mediatek: clk-mt8195-mfg: Reparent mfg_bg3d and propagate rate changes Date: Wed, 19 Oct 2022 10:31:09 +0200 Message-Id: <20221019083315.682505160@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747107029836521690?= X-GMAIL-MSGID: =?utf-8?q?1747107029836521690?= From: AngeloGioacchino Del Regno [ Upstream commit a5f7bf5458c2cf6730106e16a6373638a0e5ed1e ] 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. The clock gate comes after all the muxes, so its parent is mfg_ck_fast_reg, not top_mfg_core_tmp. Reparent MFG_BG3D to the latter to match the hardware 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. Fixes: 35016f10c0e5 ("clk: mediatek: Add MT8195 mfgcfg clock support") Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20220927101128.44758-6-angelogioacchino.delregno@collabora.com Signed-off-by: Chen-Yu Tsai Signed-off-by: Sasha Levin --- 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 = {