Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3583599rdh; Thu, 28 Sep 2023 16:55:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFFkK3LQbpFQK7//tdOUOOpvBm5ZqwKdbuvKgz59R9IR0hs+EOtN9Xo9eVuwpI7Ky0B8QPe X-Received: by 2002:a17:90b:2310:b0:268:1be1:745a with SMTP id mt16-20020a17090b231000b002681be1745amr2476747pjb.29.1695945341965; Thu, 28 Sep 2023 16:55:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695945341; cv=none; d=google.com; s=arc-20160816; b=PVh9oQqWTQ2hof1R1/W249p7E0N5/cL4JoTFPL4Ddlz7/oW1T6j1pHapWAUZxZI/Lw UwTMWRCnDFluxKG9WEweJ9RlkCiJ+2ZstCKiUEhqbPtsOFIHmIgr5k0sfI2GevrIex37 BF1LyfcrnsixzYGES89fwLEIisMPVNEeHlMZf6OBqHdiln3rJG4WnzgREYFPQBTR0DZW 1kHpNvfXU7ioanlzHOzJoOPpJB5offXDEfw2eFuKxPp/7ms6awiN0sk4naYNpqIQ42Hp gnwpViJ7YFaLTZQC65adq4S30eZhygwTVQsdaE7ZBFVM6KKmnQw5dlszaj8EVd9XK5hT Pj6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:date:to:cc:from:subject:references :in-reply-to:content-transfer-encoding:mime-version:message-id :dkim-signature; bh=uwQi5nO2yrLch6hhYvyYcqbTr8fgMIRjPIEbUKDbJxQ=; fh=WBquSI3Gt5UVYnivImJTLsuHLWI+XbGtbKWPxEyohGw=; b=sv45SqhLn0/CbAaUdIPwMe0OEPYs950BO/21Hz39Y+66wfWxWSzecUabFvr7SFDQLl GTagMaLJu1EegKDC+0Z/eC/TJUJUyuyOsiJVPUTT4T/eNlUULn3CHntCk0i9/qsTJrA0 +UqZlO39DqBKiBxx9ItRDNu+j+wBPdUgbLfC0BALtNL+NPDt1fjmJ3KxkGVrNprVA+lB 1a1/Wc7ZT4C/asPKbtGd9EiVOm0dD054HbLzcXNOVQ52HS3eoYNIZBaXhfaCGyUCXdhG 8yPANksxHDH0GS7OREyIcadeX80WAOJo7JuO/R5go2Q9xuaVmK++9wEV4BrzzZF1vQdN 3ENw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ugY856Gi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id e23-20020a17090a9a9700b0027766c98d00si293621pjp.40.2023.09.28.16.55.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 16:55:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ugY856Gi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 9032B8058B48; Thu, 28 Sep 2023 16:54:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232166AbjI1XxY (ORCPT + 99 others); Thu, 28 Sep 2023 19:53:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229654AbjI1XxY (ORCPT ); Thu, 28 Sep 2023 19:53:24 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D223199; Thu, 28 Sep 2023 16:53:22 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 13C74C433C8; Thu, 28 Sep 2023 23:53:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695945202; bh=LgHeWUx0JGY5CAGIQsUbCEJNxNMNHJ6aWxCT60chWhs=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=ugY856GiT71C7tZvaYRtjifR7PXC7IzDlj//CbKQSWKBPCdrLnOdSVGEIN6/GYdAQ G82ungix+sKip9fdsSTLvkHlkWsbG9jeyjTu6geZBya3De199c8BRzoNuwG6ZoYOcY BlD3EGCUwslgVptUqiyGWfWXbSbgp9VZW+Ct8do87kBqTNozN9pfoi2sZmsmO7nLMN hrPt1KNjBFldaHrvhLnbU2Tlzj3fNlN4k0/KqV+GOPP/8eCNe2LvEGeoEd6FgeqRwb hvX21G+6jXMD8iu6TSG1XzF0V99CjmUehxzWtPbTfOiFb5G+YW/NGZRa3P0neO40H9 OcodqH8pMwcvg== Message-ID: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: References: <20230913175612.8685-1-danila@jiaxyga.com> <539752971c7a61ce7a5deddc1478686a.sboyd@kernel.org> Subject: Re: [PATCH] clk: qcom: gcc-sm8150: Fix gcc_sdcc2_apps_clk_src From: Stephen Boyd Cc: adomerlee@gmail.com, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org To: Danila Tikhonov , Konrad Dybcio , agross@kernel.org, andersson@kernel.org, dkatraga@codeaurora.org, mturquette@baylibre.com, quic_tdas@quicinc.com, vkoul@kernel.org Date: Thu, 28 Sep 2023 16:53:19 -0700 User-Agent: alot/0.10 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, 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 agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 28 Sep 2023 16:54:48 -0700 (PDT) Quoting Konrad Dybcio (2023-09-15 05:04:41) > On 14.09.2023 18:20, Stephen Boyd wrote: > > Quoting Danila Tikhonov (2023-09-13 10:56:11) > >> Set .flags =3D CLK_OPS_PARENT_ENABLE to fix "gcc_sdcc2_apps_clk_src: r= cg > >> didn't update its configuration" error. > >> > >> Fixes: 2a1d7eb854bb ("clk: qcom: gcc: Add global clock controller driv= er for SM8150") > >> Tested-by: Arseniy Velikanov > >> Signed-off-by: Danila Tikhonov > >> --- > >> drivers/clk/qcom/gcc-sm8150.c | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> > >> diff --git a/drivers/clk/qcom/gcc-sm8150.c b/drivers/clk/qcom/gcc-sm81= 50.c > >> index 41ab210875fb..05d115c52dfe 100644 > >> --- a/drivers/clk/qcom/gcc-sm8150.c > >> +++ b/drivers/clk/qcom/gcc-sm8150.c > >> @@ -774,7 +774,7 @@ static struct clk_rcg2 gcc_sdcc2_apps_clk_src =3D { > >> .name =3D "gcc_sdcc2_apps_clk_src", > >> .parent_data =3D gcc_parents_6, > >> .num_parents =3D ARRAY_SIZE(gcc_parents_6), > >> - .flags =3D CLK_SET_RATE_PARENT, > >> + .flags =3D CLK_OPS_PARENT_ENABLE, > >> .ops =3D &clk_rcg2_floor_ops, > >=20 > > In what case are we getting the rcg stuck? I thought that you could > > write the rcg registers while the parent was off and switch to that > > parent if the parent isn't enabled and it wouldn't get stuck. > I think the better question here would be "why isn't > OPS_PARENT_ENABLE the default for all qc clocks on all > platforms" :/ >=20 We don't need that flag because of how the hardware works and how the clk framework moves the enable of the parent from the old parent to the new parent when changing rates. The RCGs only get stuck if we change the parent of an RCG to a disabled parent when the current parent is enabled and the RCG is enabled. Otherwise we're free to change the parent of the RCG because it isn't trying to do a glitch free switch of clk frequency. Is it possible that the clk is running out of boot on a parent that is enabled in the hardware but doesn't look enabled to the clk framework because of how we fail to hand off enable state? Maybe the mmc driver then calls clk_set_rate() to change the rate (rcg is still off) and that causes problems?