devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bhupesh Sharma <bhupesh.sharma@linaro.org>
To: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: linux-arm-msm@vger.kernel.org, bhupesh.linux@gmail.com,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	robh+dt@kernel.org, agross@kernel.org, sboyd@kernel.org,
	tdas@codeaurora.org, mturquette@baylibre.com,
	linux-clk@vger.kernel.org, davem@davemloft.net,
	netdev@vger.kernel.org
Subject: Re: [PATCH 7/8] clk: qcom: gcc-sm8150: use runtime PM for the clock controller
Date: Wed, 2 Mar 2022 01:09:47 +0530	[thread overview]
Message-ID: <CAH=2NtzQk+sdBgMv5ZKPXQ1vWFrp3TOR1w2Ed1WEw_5U=1i65Q@mail.gmail.com> (raw)
In-Reply-To: <Yfh4cahRIdkY4KWg@builder.lan>

HI Bjorn,

Thanks for the review. Sorry for the late reply.

On Tue, 1 Feb 2022 at 05:31, Bjorn Andersson <bjorn.andersson@linaro.org> wrote:
>
> On Wed 26 Jan 16:17 CST 2022, Bhupesh Sharma wrote:
>
> > On sm8150 emac clk registers are powered up by the GDSC power
> > domain. Use runtime PM calls to make sure that required power domain is
> > powered on while we access clock controller's registers.
> >
>
> Typically the GCC registers need only "cx" enabled for us to much around
> with its registers and I don't see you add any references to additional
> resources, so can you please elaborate on how this affects the state of
> the system to enable you to operate the emac registers?

Indeed. On second thought and further tests, I think we don't need
this change. Only keeping EMAC GDSC in ON state (always) should fix
the issue (added via [PATCH 8/8] in this series).

So, I will drop this from v2.

Regards,
Bhupesh

> > Cc: Stephen Boyd <sboyd@kernel.org>
> > Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
> > ---
> >  drivers/clk/qcom/gcc-sm8150.c | 27 +++++++++++++++++++++++++--
> >  1 file changed, 25 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/clk/qcom/gcc-sm8150.c b/drivers/clk/qcom/gcc-sm8150.c
> > index ada755ad55f7..2e71afed81fd 100644
> > --- a/drivers/clk/qcom/gcc-sm8150.c
> > +++ b/drivers/clk/qcom/gcc-sm8150.c
> > @@ -5,6 +5,7 @@
> >  #include <linux/bitops.h>
> >  #include <linux/err.h>
> >  #include <linux/platform_device.h>
> > +#include <linux/pm_runtime.h>
> >  #include <linux/module.h>
> >  #include <linux/of.h>
> >  #include <linux/of_device.h>
> > @@ -3792,19 +3793,41 @@ static const struct of_device_id gcc_sm8150_match_table[] = {
> >  };
> >  MODULE_DEVICE_TABLE(of, gcc_sm8150_match_table);
> >
> > +static void gcc_sm8150_pm_runtime_disable(void *data)
> > +{
> > +     pm_runtime_disable(data);
> > +}
> > +
> >  static int gcc_sm8150_probe(struct platform_device *pdev)
> >  {
> >       struct regmap *regmap;
> > +     int ret;
> > +
> > +     pm_runtime_enable(&pdev->dev);
> > +
> > +     ret = devm_add_action_or_reset(&pdev->dev, gcc_sm8150_pm_runtime_disable, &pdev->dev);
> > +     if (ret)
> > +             return ret;
> > +
> > +     ret = pm_runtime_resume_and_get(&pdev->dev);
> > +     if (ret)
> > +             return ret;
> >
> >       regmap = qcom_cc_map(pdev, &gcc_sm8150_desc);
> > -     if (IS_ERR(regmap))
> > +     if (IS_ERR(regmap)) {
> > +             pm_runtime_put(&pdev->dev);
> >               return PTR_ERR(regmap);
> > +     }
> >
> >       /* Disable the GPLL0 active input to NPU and GPU via MISC registers */
> >       regmap_update_bits(regmap, 0x4d110, 0x3, 0x3);
> >       regmap_update_bits(regmap, 0x71028, 0x3, 0x3);
> >
> > -     return qcom_cc_really_probe(pdev, &gcc_sm8150_desc, regmap);
> > +     ret = qcom_cc_really_probe(pdev, &gcc_sm8150_desc, regmap);
> > +
> > +     pm_runtime_put(&pdev->dev);
> > +
> > +     return ret;
> >  }
> >
> >  static struct platform_driver gcc_sm8150_driver = {
> > --
> > 2.34.1
> >

  reply	other threads:[~2022-03-01 19:40 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-26 22:17 [PATCH 0/8] Add ethernet support for Qualcomm SA8155p-ADP board Bhupesh Sharma
2022-01-26 22:17 ` [PATCH 1/8] dt-bindings: net: qcom,ethqos: Document SM8150 SoC compatible Bhupesh Sharma
2022-02-09  3:34   ` Rob Herring
2022-01-26 22:17 ` [PATCH 2/8] net: stmmac: Add support for SM8150 Bhupesh Sharma
2022-02-01  0:07   ` Bjorn Andersson
2022-03-01 19:31     ` Bhupesh Sharma
2022-01-26 22:17 ` [PATCH 3/8] clk: qcom: gcc: Add PCIe, EMAC and UFS GDSCs " Bhupesh Sharma
2022-02-01  0:09   ` Bjorn Andersson
2022-03-01 19:33     ` Bhupesh Sharma
2022-01-26 22:17 ` [PATCH 4/8] arm64: dts: qcom: sm8150: add ethernet node Bhupesh Sharma
2022-01-26 22:17 ` [PATCH 5/8] arm64: dts: qcom: sa8155p-adp: Enable " Bhupesh Sharma
2022-01-27  0:07   ` Andrew Lunn
2022-03-01 20:33     ` Bhupesh Sharma
2022-01-26 22:17 ` [PATCH 6/8] net: stmmac: dwmac-qcom-ethqos: Adjust rgmii loopback_en per platform Bhupesh Sharma
2022-01-26 22:17 ` [PATCH 7/8] clk: qcom: gcc-sm8150: use runtime PM for the clock controller Bhupesh Sharma
2022-01-26 22:34   ` Dmitry Baryshkov
2022-03-01  8:22     ` Bhupesh Sharma
2022-02-01  0:01   ` Bjorn Andersson
2022-03-01 19:39     ` Bhupesh Sharma [this message]
2022-01-26 22:17 ` [PATCH 8/8] clk: qcom: gcc-sm8150: Use PWRSTS_ON (only) as a workaround for emac gdsc Bhupesh Sharma
2022-02-01  0:05   ` Bjorn Andersson
2022-03-01 19:44     ` Bhupesh Sharma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH=2NtzQk+sdBgMv5ZKPXQ1vWFrp3TOR1w2Ed1WEw_5U=1i65Q@mail.gmail.com' \
    --to=bhupesh.sharma@linaro.org \
    --cc=agross@kernel.org \
    --cc=bhupesh.linux@gmail.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=netdev@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=tdas@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).