linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: mturquette@ti.com (Mike Turquette)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V2] clk: give clock chance to change parent at setrate stage
Date: Tue, 12 Jun 2012 17:16:09 -0700	[thread overview]
Message-ID: <20120613001609.GN19410@gmail.com> (raw)
In-Reply-To: <CAAXpJNvdaZxSiCr3Usd0B4iGHLkxshwzfN4LQZ2xZCcwBe8fVQ@mail.gmail.com>

On 20120516-19:55, zhoujie wu wrote:
> If I separate this clock to mux->divider model,
> mux node will NOT set CLK_SET_RATE_PARENT flag
> divider node will set CLK_SET_RATE_PARENT flag
> 
> When I want to change this clock's rate, it will at first find proper
> divider with current parent rate,
> if best_parent_rate != cur_parent_rate, this means we should re-parent
> the mux. The mux node rate
> will be change at first, and then divider. Per your suggestion, in mux
> .set_rate ops we disable new parent
> and set mux field, then disable old parent.
> But there is a limitation here,  write to the mux filed doesn't really
> change the source of the parent. It requires
> the trigger bits to be set.
> If we don't set trigger bits here, the source is still not change, we
> could not disable old parent. Where is the proper place to disable it?
> If we set mux and trigger here, we may use some tmp dangerous clock
> rate since divider has not update yet.
> For example, rate 400M = mux_400M/ div_1 at first. When we want to set
> to 533M, we have change mux to 1066M here, we may get tmp rate 1066M =
> 1066M/1, but this clock may not run up to 1066M.
> That is why we think it is more safe to set mux&div&trigger the same time.

Hi Zhoujie Wu,

I still think that the separate clock nodes could work for you.  I don't
know if you have actually tried to implement them or not.

Regardless I want you to know that I've changed my mind about your
original patch to give clk_set_rate the option to select a new parent.
I think that this behavior is necessary for a variety of reasons
(locking correctness amongst other things).  I'm going to implement it
differently than your patch does, but it should help you out.

I'll Cc you on the patch when it hits the list.

Regards,
Mike

      reply	other threads:[~2012-06-13  0:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1336125068-32637-1-git-send-email-leiwen@marvell.com>
2012-05-04  9:54 ` [PATCH] clk: give clock chance to change parent at setrate stage Lei Wen
     [not found]   ` <CAG9bXvmAf-0fmVb8nzWkuAKaMoOJVzR=hThwXpN_izQzM26q-g@mail.gmail.com>
2012-05-04 15:55     ` Lei Wen
     [not found]     ` <1336146319-6803-1-git-send-email-leiwen@marvell.com>
2012-05-04 15:58       ` [PATCH V2] " Lei Wen
2012-05-08 13:08         ` Lei Wen
2012-05-08 17:30           ` Turquette, Mike
2012-05-09 18:34         ` Mike Turquette
2012-05-10  9:03           ` zhoujie wu
2012-05-16  3:32             ` Turquette, Mike
2012-05-16 11:55               ` zhoujie wu
2012-06-13  0:16                 ` Mike Turquette [this message]

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=20120613001609.GN19410@gmail.com \
    --to=mturquette@ti.com \
    --cc=linux-arm-kernel@lists.infradead.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).