public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3] S5PV210 Correct clock register properties
Date: Wed, 23 Jun 2010 10:16:38 +0100	[thread overview]
Message-ID: <20100623091638.GA17436@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1277283688-4542-1-git-send-email-myungjoo.ham@samsung.com>

On Wed, Jun 23, 2010 at 06:01:28PM +0900, MyungJoo Ham wrote:
> --- Duplicated Clock Problem ---
> Please note that each clock definition should access different control
> register; otherwise, the system may suffer lockups. For example, if we
> have two clock definitions "a" and "b" which access the same register
> (and the shift value). Then, when we do:
> 
> 	module A
> 	clk = clk_get("a");
> 	clk->clk_enable(clk);
> 
> 	module B (context switch)
> 	clk = clk_get("b");
> 	clk->clk_enable(clk);
> 	do something with clk.
> 	clk->clk_disable(clk);
> 
> 	module A (context switch)
> 	do something with clk
> 	* At this point, the system may hang.
> 
> Therefore, there should be no clock definitions with the same contol
> register/shift. If we need to create "aliases", then, creating child
> clocks sharing the clock should be fine.

Absolutely right, and the clk API has always allowed for this.  clk_get()
is supposed to translate a struct device + _clock_ _consumer_ _name_ to
the relevant struct clk, which may be the same struct clk which was
returned by clk_get for a completely different struct device & _clock_
_consumer_ _name_.

clkdev provides an easy way to do this by providing a tabular lookup
mechanism, which lists the device, clock consumer name and the struct
clk to return for that combination.

  reply	other threads:[~2010-06-23  9:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-23  9:01 [PATCH v3] S5PV210 Correct clock register properties MyungJoo Ham
2010-06-23  9:16 ` Russell King - ARM Linux [this message]
2010-06-23  9:31 ` Kukjin Kim

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=20100623091638.GA17436@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --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