From: Stephen Boyd <sboyd@codeaurora.org>
To: "Nayak, Rajendra" <rnayak@codeaurora.org>
Cc: Rob Clark <robdclark@gmail.com>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
linux-clk <linux-clk@vger.kernel.org>,
Michael Turquette <mturquette@baylibre.com>,
Archit Taneja <architt@codeaurora.org>,
linux-arm-msm <linux-arm-msm@vger.kernel.org>,
Viresh Kumar <viresh.kumar@linaro.org>
Subject: Re: [RFC 1/3] clk: inherit display clocks enabled by bootloader
Date: Tue, 18 Jul 2017 16:16:14 -0700 [thread overview]
Message-ID: <20170718231614.GH18179@codeaurora.org> (raw)
In-Reply-To: <f0053867-f077-35c2-fcae-a3e8730077eb@codeaurora.org>
On 07/17, Nayak, Rajendra wrote:
>
>
> On 7/14/2017 4:13 PM, Rob Clark wrote:
> >On Fri, Jul 14, 2017 at 12:52 AM, Rajendra Nayak <rnayak@codeaurora.org> wrote:
> >>Hi Rob,
> >>
> >>On 07/11/2017 11:50 PM, Rob Clark wrote:
> >>
> >>>diff --git a/drivers/clk/qcom/common.c b/drivers/clk/qcom/common.c
> >>>index d523991c945f..90b698c910d0 100644
> >>>--- a/drivers/clk/qcom/common.c
> >>>+++ b/drivers/clk/qcom/common.c
> >>>@@ -11,6 +11,7 @@
> >>> * GNU General Public License for more details.
> >>> */
> >>>
> >>>+#include <linux/clk.h>
> >>> #include <linux/export.h>
> >>> #include <linux/module.h>
> >>> #include <linux/regmap.h>
> >>>@@ -258,6 +259,33 @@ int qcom_cc_really_probe(struct platform_device *pdev,
> >>> if (ret)
> >>> return ret;
> >>>
> >>>+ /* Check which of clocks that we inherit state from bootloader
> >>>+ * are enabled, and fixup enable/prepare state (as well as that
> >>>+ * of it's parents).
> >>>+ *
> >>>+ * TODO can we assume that parents coming from another clk
> >>>+ * driver are already registered?
> >>>+ */
> >>>+ for (i = 0; i < num_clks; i++) {
> >>>+ struct clk_hw *hw;
> >>>+
> >>>+ if (!rclks[i])
> >>>+ continue;
> >>>+
> >>>+ hw = &rclks[i]->hw;
> >>>+
> >>>+ if (!(hw->init->flags & CLK_INHERIT_BOOTLOADER))
> >>>+ continue;
> >>>+
> >>>+ if (!clk_is_enabled_regmap(hw))
> >>>+ continue;
> >>>+
> >>>+ dev_dbg(dev, "%s is enabled from bootloader!\n",
> >>>+ hw->init->name);
> >>>+
> >>>+ clk_inherit_enabled(hw->clk);
> >>
> >>how about just calling a clk_prepare_enable(hw->clk) instead of adding a new API?
> >>The flag could also be something qcom specific and then we avoid having to add
> >>anything in generic CCF code and its all handled in the qcom clock drivers.
> >
> >Hmm, I could try that.. I *guess* it doesn't hurt to enable an
> >already enabled clk..
>
> yes, ideally it shouldn't hurt.
It hurts when you enable a PLL when it's already enabled. I
recall having to add code specifically for this reason to avoid
enabling a PLL that is already enabled out of the bootloader. But
that's because the enable sequence for a PLL is multiple writes
that first keep the output off and then turn it back on after
things stabilize. For RCGs this isn't the case.
>
> >
> >beyond that, I wonder if this is something that other platforms would
> >want, so maybe I should be doing the check for enabled in CCF core?
> >If not, making this a qcom specific flag makes sense.
>
> I think most previous attempts to solve this were done trying to keep
> it very generic and they didn't go too far.
> So I was thinking maybe we could deal with it within qcom drivers for
> now, and if others come up with something similar, then look to
> consolidate at a generic CCF level.
We know that other SoC vendors need handoff features as well, so
there will definitely be a point where we need to consolidate at
the framework level. Working something up that works for qcom
would be good to try out though to find edge cases, etc.
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2017-07-18 23:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-11 18:20 [RFC 0/3] drm/msm+clk: handover of bootloader display Rob Clark
2017-07-11 18:20 ` [RFC 1/3] clk: inherit display clocks enabled by bootloader Rob Clark
2017-07-14 4:52 ` Rajendra Nayak
2017-07-14 10:43 ` Rob Clark
2017-07-17 9:37 ` Nayak, Rajendra
2017-07-18 23:16 ` Stephen Boyd [this message]
2017-07-11 18:20 ` [RFC 2/3] drm/msm: inherit display from bootloader Rob Clark
2017-07-11 18:20 ` [RFC 3/3] drm/bridge: adv7511: deal with bootloader lighting up display Rob Clark
2017-07-11 18:35 ` [RFC 0/3] drm/msm+clk: handover of bootloader display Geert Uytterhoeven
2017-07-11 19:16 ` Rob Clark
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=20170718231614.GH18179@codeaurora.org \
--to=sboyd@codeaurora.org \
--cc=architt@codeaurora.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=rnayak@codeaurora.org \
--cc=robdclark@gmail.com \
--cc=viresh.kumar@linaro.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).