All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] OMAP clock: implement clock rate/parent change notifiers
@ 2009-03-25 16:09 Paul Walmsley
  2009-03-25 16:09 ` [PATCH 1/2] OMAP clock: add clk_round_rate_parent (with OMAP2/3 implementation) Paul Walmsley
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Paul Walmsley @ 2009-03-25 16:09 UTC (permalink / raw)
  To: linux-omap

Hello,

This series allows core code and driver code to register for
notification when a clock's rate or parent changes.  This is currently
used by driver code that must be notified whenever power management
code (e.g., CPUFreq) causes system rate changes that affect the driver's
clock.

There are three notifier messages: 

1. a pre-change notifier, called before the change; 

2. a post-change notifier, called after the change; and

3. an abort notifier, called if the change fails for any reason after
   the pre-change notifier callbacks have run.

Since the implementation uses a blocking notifier, notifier code may
block waiting for devices to quiesce; but long delays here will reduce
the effectiveness of DVFS.  Since notifier callbacks are called with
clocks_mutex held, callback code must not re-enter the clock framework.

Pre-change notifiers are passed the current clock rate and the desired
clock rate, so drivers can adjust any internal dividers appropriately.
(To minimize performance and memory usage impact, post-change
notifiers are passed only the desired clock rate, i.e., the clock rate
after the rate change.)  The notifiers are called even if the clock
rate is the same before and after the change.  This is because
reprogramming a clock's parent or rate may briefly disrupt the clock.

The interface to the notifiers is via:

int clk_notifier_register(struct clk *clk, struct notifier_block *nb);
int clk_notifier_unregister(struct clk *clk, struct notifier_block *nb);

Until prototypes for these functions are made available in
include/linux/clk.h, drivers should pass function pointers to
clk_notifier_register() and clk_notifier_unregister() via their
platform_data struct.

This series is a collaboration between Tero Kristo
<tero.kristo@nokia.com> and Paul Walmsley <paul@pwsan.com> and several
others. Hiroshi Doyu <Hiroshi.DOYU@nokia.com> tracked down and fixed a
bug where blocking_notifier_chain_*() were called while interrupts
were disabled.  Nishanth Menon <nm@ti.com> found and fixed a bug in
the clk_notifier_unregister() path, where a list_del() was missing.
And thanks to Jouni Högander <jouni.hogander@nokia.com> for comments
and review during the evolution of these patches.

Registration and callbacks on rate change and parent change tested on
BeagleBoard (OMAP3530 ES2.1).

Comments welcomed.

---

   text    data     bss     dec     hex filename
3439981  175136  111800 3726917  38de45 vmlinux.beagle.orig
3441545  176000  111800 3729345  38e7c1 vmlinux.beagle


 arch/arm/mach-omap2/clock.c             |   30 ++++
 arch/arm/mach-omap2/clock.h             |    1 
 arch/arm/mach-omap2/clock24xx.c         |    1 
 arch/arm/mach-omap2/clock34xx.c         |    1 
 arch/arm/plat-omap/clock.c              |  256 +++++++++++++++++++++++++++++++
 arch/arm/plat-omap/include/mach/clock.h |   68 ++++++++
 6 files changed, 357 insertions(+), 0 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-12-08 19:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-25 16:09 [PATCH 0/2] OMAP clock: implement clock rate/parent change notifiers Paul Walmsley
2009-03-25 16:09 ` [PATCH 1/2] OMAP clock: add clk_round_rate_parent (with OMAP2/3 implementation) Paul Walmsley
2009-03-25 16:09 ` [PATCH 2/2] OMAP2/3 clock: implement clock rate/parent change notifiers Paul Walmsley
2009-03-25 17:54 ` [PATCH 0/2] OMAP " Kevin Hilman
2011-08-14  7:39   ` Felipe Contreras
2011-12-08 19:26     ` Paul Walmsley
2011-12-08 19:56       ` Felipe Contreras

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.