Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp28308rdb; Wed, 18 Oct 2023 16:58:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGhyFIKbi+OrJINWSaS1EB/WeQFVj9jaQN6Omjo457+HgQbbKpYZgQsRpkKow9T1oRXiAZv X-Received: by 2002:a05:6a00:b53:b0:68f:f650:3035 with SMTP id p19-20020a056a000b5300b0068ff6503035mr631144pfo.12.1697673537643; Wed, 18 Oct 2023 16:58:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697673537; cv=none; d=google.com; s=arc-20160816; b=z10nKP6euiOXieexeDDhvOb8UZvkuJUp+eQOs9+ztYgttFjt3g7dmoxYaM1quLX7YV jd6MJtncE1WEd7wxNK6CPt917xUiYp6khiT9y3e5QAcDfkGlm3dcHLTLSC9UhfepcYBc vgeF4kyDj6TPNFrZzWGF6z+aJ5HGwOXT6s11bB+cdEoF469LNx4MUpyg5H9sdHbalv8b 2lWG/AxV3Wf0j3J8654FeOGVcY/+nNz+cIFV3gEdx2FOVKtssJ+D5NIlQqRvC3tlMwQE rHj0SsKSvcu42l+MyMFpw2zwAGlG89lA7DpDd1bBPUNLUKfZEMoj8JS1M0bYy7aOCHa5 KsGg== 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=cM+59kqcq8U3kUdlV0R4wMytoxBOkhBRc39USqtZYdc=; fh=9FZlldRktnjyEcvZ46SbHzn3swJazU51pmcWnFRcYoU=; b=eSQqZBH88mdvPM1Slh8J6+e3AH/PRoouXdjnEVCZDg5VzCAQR3oBck5Sh87MM52iMr /1HPPa3RQSE+6Fm2r6Fb6jc5Y/VOacqj/L/hWVws2q/kBebpEf6j9nQKcGf90iTp3nlW YuN8TfLCH65h+TAcizwiDzbSqxDMG3BBiHffaTUNBcLY3A2/hNmXYLH4lcXmjclK9abd 7l0X0Lg9TvqumgfeRCIusQzqvhNLg1JcR0xtcQsbiyQq9lhiUi88Bnk9pbll86YQlvNi VuoU9Al/ncihsa9JziIVlkpc2sQe+6xuLlSWBaT0g51A6fBamErlQRCZcMzgO8BeE9dw 7t6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uQNuBF78; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id a14-20020a63e40e000000b0058556a636dbsi3204708pgi.434.2023.10.18.16.58.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 16:58:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uQNuBF78; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 391A38212AAE; Wed, 18 Oct 2023 16:58:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231523AbjJRX6w (ORCPT + 99 others); Wed, 18 Oct 2023 19:58:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229679AbjJRX6v (ORCPT ); Wed, 18 Oct 2023 19:58:51 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95A92114; Wed, 18 Oct 2023 16:58:50 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 270F2C433C7; Wed, 18 Oct 2023 23:58:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697673530; bh=hhQCYOOCg448O1KYZrGigVrToJM8nwnoz1Z+VpjMS30=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=uQNuBF78XOoYTJdI6kLb9QzUVfw0sAthXjPMYLijxK0wznFlba/bFkGF+0INxNqLX yvt4cjw3j4I+HmocmQoZ3U7bOcot80AdlcjjyyefSm3hiE4f4GUJFrkdI4civuNKFh +z1pgEknD4Z9wdUBaGyhNTVVt1NTvwWge2XzyfjVxpFaqbPS+NTEDhnGejJ0+xo2jK KW9h3j8YWeC8uBLlhAfmcdKw3g/h2fycwkbWLYkxLvM7aoiiZ+6rs5ehrO1pozxihP u3AlFRCklqHsRD1BdZlr1Z+/09NWi95wEwBxQRwJWaWjXOvFyrRGC2vbFCQuNcpsZq qJmeVDHnbtyrA== Message-ID: <04645ece5398efdf03e8ab4bb874a0ba.sboyd@kernel.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <248c5ad76abad07b2c710c5c561d4e37a099bd36.1697600121.git.quic_varada@quicinc.com> References: <248c5ad76abad07b2c710c5c561d4e37a099bd36.1697600121.git.quic_varada@quicinc.com> Subject: Re: [PATCH v3 1/8] clk: qcom: clk-alpha-pll: introduce stromer plus ops From: Stephen Boyd Cc: Varadarajan Narayanan To: Varadarajan Narayanan , agross@kernel.org, andersson@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org, ilia.lin@kernel.org, konrad.dybcio@linaro.org, krzysztof.kozlowski+dt@linaro.org, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, mturquette@baylibre.com, quic_kathirav@quicinc.com, rafael@kernel.org, robh+dt@kernel.org, viresh.kumar@linaro.org Date: Wed, 18 Oct 2023 16:58:47 -0700 User-Agent: alot/0.10 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 18 Oct 2023 16:58:56 -0700 (PDT) Quoting Varadarajan Narayanan (2023-10-18 02:29:14) > diff --git a/drivers/clk/qcom/clk-alpha-pll.c b/drivers/clk/qcom/clk-alph= a-pll.c > index 4edbf77..f839a31 100644 > --- a/drivers/clk/qcom/clk-alpha-pll.c > +++ b/drivers/clk/qcom/clk-alpha-pll.c > @@ -2508,3 +2508,60 @@ const struct clk_ops clk_alpha_pll_stromer_ops =3D= { > .set_rate =3D clk_alpha_pll_stromer_set_rate, > }; > EXPORT_SYMBOL_GPL(clk_alpha_pll_stromer_ops); > + > +static int clk_alpha_pll_stromer_plus_set_rate(struct clk_hw *hw, > + unsigned long rate, > + unsigned long prate) > +{ > + struct clk_alpha_pll *pll =3D to_clk_alpha_pll(hw); > + u32 l, alpha_width =3D pll_alpha_width(pll); > + int ret; > + u64 a; > + > + rate =3D alpha_pll_round_rate(rate, prate, &l, &a, alpha_width); > + > + regmap_write(pll->clkr.regmap, PLL_MODE(pll), 0); It still assumes the clk is always enabled. Please read back the register value and make sure the PLL was already enabled before restoring the enable state of the clk. > + > + /* Delay of 2 output clock ticks required until output is disable= d */ > + udelay(1);