Linux-Clk Archive on lore.kernel.org
 help / color / Atom feed
From: Stephen Boyd <sboyd@kernel.org>
To: chandanu@codeaurora.org
Cc: Michael Turquette <mturquette@baylibre.com>,
	Taniya Das <tdas@codeaurora.org>,
	Andy Gross <andy.gross@linaro.org>,
	David Brown <david.brown@linaro.org>,
	Rajendra Nayak <rnayak@codeaurora.org>,
	linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org,
	linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-msm-owner@vger.kernel.org
Subject: Re: [PATCH v1 2/2] clk: qcom : dispcc: Add support for display port clocks
Date: Mon, 15 Jul 2019 15:59:04 -0700
Message-ID: <20190715225905.5B73D20693@mail.kernel.org> (raw)
In-Reply-To: <c7440ea58b65150ed333bf6bba2d30c3@codeaurora.org>

Quoting chandanu@codeaurora.org (2019-02-01 16:05:55)
> On 2018-10-29 11:43, Stephen Boyd wrote:
> > Quoting Taniya Das (2018-10-28 03:34:55)
> >> On 2018-10-19 16:04, Taniya Das wrote:
> 
> >> >>
> >> >>> +static struct clk_branch disp_cc_mdss_dp_link_intf_clk = {
> >> >>> +       .halt_reg = 0x2044,
> >> >>> +       .halt_check = BRANCH_HALT,
> >> >>> +       .clkr = {
> >> >>> +               .enable_reg = 0x2044,
> >> >>> +               .enable_mask = BIT(0),
> >> >>> +               .hw.init = &(struct clk_init_data){
> >> >>> +                       .name = "disp_cc_mdss_dp_link_intf_clk",
> >> >>> +                       .parent_names = (const char *[]){
> >> >>> +                               "disp_cc_mdss_dp_link_clk_src",
> >> >>> +                       },
> >> >>> +                       .num_parents = 1,
> >> >>> +                       .flags = CLK_GET_RATE_NOCACHE,
> >> >>
> >> >> Why?
> >> >>
> >> >
> >> > It was a requirement, but let me get back on this too.
> >> >
> >> I had a discussion with the Display Port teams and below is the 
> >> requirement,
> >> 
> >> This flag is required since we reset/power-down the PLL every time 
> >> they
> >> disconnect/connect the DP cable or during suspend/resume.
> >> Only with this flag, the calls to the PLL driver properly.
> > 
> > Ok. So that explains the get rate nocache flag. Can you please add a
> > comment that explains that these clk registers here are lost across
> > suspend/resume of the display device? It really sounds like these
> > display clks are inside of the display power domain and thus they lose
> > their state across the display power domain power down. It would be
> > better if we could properly implement suspend/restore for these clk
> > registers across suspend/resume of the display device so that we don't
> > need this nocache flag and the display code can work together with the
> > clk code here to restore the frequency to the clk.
> 

This patch came again and it didn't have any comments to this effect in
the code around the flag.

> 
> We already handle the suspend/restore for these clk registers
> in Dp PLL domain. Without the "NOCACHE_FLAG", and if we are requesting 
> the same clock rate
> for any of the clocks, the set_rate call never reaches the DP PLL Ops.

So do you restore the frequency of the PLL manually? Or that is done by
calling clk_set_rate() on the leaf clk again?

> 
> I am not clear on what you are suggesting for removing the 
> "NOCACHE_FLAG" for
> the DisplayPort clocks. Are you suggesting design changes in DP PLL 
> driver or in dispcc-driver?
> Can you please provide more details?
> 

I'm suggesting that the clk framework needs to be told that the PLL has
lost the rate and thus should do a save/restore of the registers so that
the clk framework can be back in sync with the clk hardware. Maybe it's
as simple as calling clk_set_rate(&pll, XO_RATE) or clk_set_parent(&pll,
&xo_clk), so that we can recalc the rate down the tree and fix up the
child clk frequencies. Or, maybe we need to add some sort of mechanism
to the clk framework so it can be told that the frequency here has
changed. Or we need to add a hook in the power domain for the DP PLL to
tell the clk framework that the clk has changed rate and thus should
recalc down to the children. Something like this, instead of an obtuse
flag that tells us very little about what's going on.


      reply index

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-09 13:57 [PATCH v1 0/2] Add support for display port clocks and clock ops Taniya Das
2018-10-09 13:57 ` [PATCH v1 1/2] clk: qcom: rcg2: Add support for display port " Taniya Das
2018-10-09 20:46   ` Stephen Boyd
2018-10-19 10:31     ` Taniya Das
2018-10-09 13:57 ` [PATCH v1 2/2] clk: qcom : dispcc: Add support for display port clocks Taniya Das
2018-10-09 20:34   ` Stephen Boyd
2018-10-19 10:34     ` Taniya Das
2018-10-28 10:34       ` Taniya Das
2018-10-29 18:43         ` Stephen Boyd
2018-10-30  6:01           ` Taniya Das
2018-10-30 16:33             ` Stephen Boyd
2018-11-01  5:02               ` Taniya Das
2018-11-06 17:08                 ` Stephen Boyd
2018-11-12  3:41                   ` chandanu
2019-02-02  0:05           ` chandanu
2019-07-15 22:59             ` Stephen Boyd [this message]

Reply instructions:

You may reply publically 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=20190715225905.5B73D20693@mail.kernel.org \
    --to=sboyd@kernel.org \
    --cc=andy.gross@linaro.org \
    --cc=chandanu@codeaurora.org \
    --cc=david.brown@linaro.org \
    --cc=linux-arm-msm-owner@vger.kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-soc@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=rnayak@codeaurora.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

Linux-Clk Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-clk/0 linux-clk/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-clk linux-clk/ https://lore.kernel.org/linux-clk \
		linux-clk@vger.kernel.org
	public-inbox-index linux-clk

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-clk


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git