public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: mturquette@linaro.org (Mike Turquette)
To: linux-arm-kernel@lists.infradead.org
Subject: ccf: where to put constraints?
Date: Mon, 24 Feb 2014 15:05:32 -0800	[thread overview]
Message-ID: <20140224230532.22529.7958@quantum> (raw)
In-Reply-To: <8e8ce023-b9a4-41a5-b06c-0f6d934f22e6@VA3EHSMHS020.ehs.local>

Quoting S?ren Brinkmann (2014-02-24 13:21:58)
> Hi Wolfram,
> 
> On Mon, 2014-02-24 at 09:10PM +0100, Wolfram Sang wrote:
> > Hi,
> > 
> > Where do I put constraints when using the CCF? I have a CPU and GPU
> > clock derived from the same PLL. Both clocks have their own divider.
> > Now, there is the additional constraint that the CPU clock must not be
> > lower than the GPU clock. Do I add checks in the set_rate functions?
> > Feels like the wrong layer, but not checking it and blindly relying on
> > somebody else does not feel correct, too. How to do it best?
> 
> I don't know if it's the best or only way, but so far, I did things like
> that with clock notifiers.
> 
> I.e. when a clock consumer needs to be notified about its input clock
> being changed it registers a clock notifier. In that notifier callback
> it then can react to the rate change. E.g. adjust dividers to stay
> within legal limits or reject the change completely.

Yes, this is why the notifiers were created. A nice side effect of this
is that the code can live outside your clock driver. Often times the
clocks are quite capable of running at these speeds, but the problem is
the IP blocks (CPU & GPU in Wolfram's case) would be out of spec. It is
arguable that this logic does not belong in the clock driver but instead
in some cpufreq driver or something like it.

The clock notifiers make it easy to put this logic wherever you like and
you can even veto clock rate changes.

Regards,
Mike

> 
>         S?ren
> 
> 

  reply	other threads:[~2014-02-24 23:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-24 20:10 ccf: where to put constraints? Wolfram Sang
2014-02-24 21:21 ` Sören Brinkmann
2014-02-24 23:05   ` Mike Turquette [this message]
2014-02-24 23:11     ` Sören Brinkmann
2014-02-25  0:22       ` Mike Turquette
2014-02-25  0:43         ` Sören Brinkmann
2014-02-28 21:24   ` Wolfram Sang
2014-03-01 23:35     ` Mike Turquette

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=20140224230532.22529.7958@quantum \
    --to=mturquette@linaro.org \
    --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