linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Nishanth Menon <nm@ti.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Grygorii Strashko <grygorii.strashko@ti.com>,
	linux-rt-users@vger.kernel.org, Felipe Balbi <balbi@ti.com>,
	Sekhar Nori <nsekhar@ti.com>,
	linux-clk@vger.kernel.org
Subject: Re: Common clock framework API vs RT patchset
Date: Tue, 4 Aug 2015 16:36:41 +0100	[thread overview]
Message-ID: <20150804153641.GR7557@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <55C0D8F3.3030105@ti.com>

On Tue, Aug 04, 2015 at 10:23:31AM -0500, Nishanth Menon wrote:
> Consider clk_enable/disable/set_parent/setfreq operations. none of these
> operations are "atomic" from hardware point of view. instead, they are a
> set of steps which culminates to moving from state A to state B of the
> clock tree configuration.

There's a world of difference between clk_enable()/clk_disable() and
the rest of the clk API.

clk_enable()/clk_disable() _should_ be callable from any context, since
you may need to enable or disable a clock from any context.  The remainder
of the clk API is callable only from contexts where sleeping is permissible.

The reason we have this split is because clk_enable()/clk_disable() have
historically been used in interrupt handlers, and they're specifically
not supposed to impose big delays.

Things like waiting for a PLL to re-lock is time-consuming, so it's not
something I'd expect to see behind a clk_enable() implementation (the
fact you can't sleep in there is a big hint.)  Such waits should be in
the clk_prepare() stage instead.

Now, as for clk_enable() being interrupted - if clk_enable() is interrupted
and another clk_enable() comes along for the same clock, that second
clk_enable() should not return until the clock has actually been enabled,
and it's up to the implementation to decode how to achieve that.  If that
means a RT implementation using a raw spinlock, then that's one option
(which basically would have the side effect of blocking until the preempted
clk_enable() finishes its business.)  Alternatively, if we can preempt
inside clk_enable(), then the clk_enable() implementation should be written
to cope with that (eg, by the second clk_enable() fiddling with the hardware,
and the first thread noticing that it has nothing to do.)

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.

  reply	other threads:[~2015-08-04 15:36 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-04 12:00 Common clock framework API vs RT patchset Grygorii Strashko
2015-08-04 12:06 ` Thomas Gleixner
2015-08-04 15:23   ` Nishanth Menon
2015-08-04 15:36     ` Russell King - ARM Linux [this message]
2015-08-11 19:23       ` Grygorii Strashko
2015-08-11 19:25         ` Russell King - ARM Linux
2015-08-11 22:06           ` Michael Turquette
2015-08-12 10:05             ` Grygorii Strashko
2015-08-12 10:11               ` Russell King - ARM Linux
2015-08-12 15:02                 ` Felipe Balbi
2015-08-12 16:46                   ` Michael Turquette
2015-08-12 19:08                     ` Felipe Balbi
2015-09-21 13:06       ` Thomas Gleixner
2015-09-21 13:52         ` Russell King - ARM Linux
2015-09-21 16:08           ` Common clock framework API vs RT patchset\ Thomas Gleixner

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=20150804153641.GR7557@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=balbi@ti.com \
    --cc=grygorii.strashko@ti.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=nsekhar@ti.com \
    --cc=tglx@linutronix.de \
    /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).