linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* sleeping clk_[enable,disable]?
@ 2010-02-23 14:32 Linus Walleij
  2010-02-23 20:03 ` Rabin Vincent
  2010-02-24  8:46 ` Uwe Kleine-König
  0 siblings, 2 replies; 4+ messages in thread
From: Linus Walleij @ 2010-02-23 14:32 UTC (permalink / raw)
  To: linux-arm-kernel

A question here:

If you have a clocking hardware that would actually require
clk_[enable,disable] to
sleep in order to ascertain that the clock is actually in the
requested state when
you return from these functions, what can you do?

I could think of several solutions, like:

* Actually let clk_[enable,disable] sleep, make sure all drivers only calls them
  in thread context.

* Impose a state in the clk so it can be "in transition", then an
additional function
  clk_is_stable() which will also have to be added to most drivers but had the
  advantage of not violating the defined clk_[enable,disable] API.

* Throw in udelay():s after the clk_[enable,disable] calls, with some values
  that are unfortunately then spread out in the drivers instead of in the
  clk implementation.

Any ideas?

Linus Walleij

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

* sleeping clk_[enable,disable]?
  2010-02-23 14:32 sleeping clk_[enable,disable]? Linus Walleij
@ 2010-02-23 20:03 ` Rabin Vincent
  2010-02-23 21:36   ` Linus Walleij
  2010-02-24  8:46 ` Uwe Kleine-König
  1 sibling, 1 reply; 4+ messages in thread
From: Rabin Vincent @ 2010-02-23 20:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Feb 23, 2010 at 03:32:19PM +0100, Linus Walleij wrote:
> * Throw in udelay():s after the clk_[enable,disable] calls, with some values
>   that are unfortunately then spread out in the drivers instead of in the
>   clk implementation.

Or you could place the udelay()s inside the clk_* calls themselves.  See
mach-pxa/clock.c or plat-stmp3xxx/clock.c.

Rabin

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

* sleeping clk_[enable,disable]?
  2010-02-23 20:03 ` Rabin Vincent
@ 2010-02-23 21:36   ` Linus Walleij
  0 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2010-02-23 21:36 UTC (permalink / raw)
  To: linux-arm-kernel

2010/2/23 Rabin Vincent <rabin@rab.in>:

> On Tue, Feb 23, 2010 at 03:32:19PM +0100, Linus Walleij wrote:

>> * Throw in udelay():s after the clk_[enable,disable] calls, with some values
>> ? that are unfortunately then spread out in the drivers instead of in the
>> ? clk implementation.
>
> Or you could place the udelay()s inside the clk_* calls themselves. ?See
> mach-pxa/clock.c or plat-stmp3xxx/clock.c.

Hm, yeah pxa has a the maximum defined delay 5 us, and stmp3xx has
a maximum of 10 us both probably acceptable delays in a fastpath. So your
system latency requirements control the limit here and in that case ...
perhaps one would better just switch all interrupt handlers where a
clk_enable/disable occurs to threaded anyway just to be on the safe
side. (Just thinking aloud a bit...)

Yours,
Linus Walleij

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

* sleeping clk_[enable,disable]?
  2010-02-23 14:32 sleeping clk_[enable,disable]? Linus Walleij
  2010-02-23 20:03 ` Rabin Vincent
@ 2010-02-24  8:46 ` Uwe Kleine-König
  1 sibling, 0 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2010-02-24  8:46 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

On Tue, Feb 23, 2010 at 03:32:19PM +0100, Linus Walleij wrote:
> A question here:
> 
> If you have a clocking hardware that would actually require
> clk_[enable,disable] to
> sleep in order to ascertain that the clock is actually in the
> requested state when
> you return from these functions, what can you do?
> 
> I could think of several solutions, like:
> 
> * Actually let clk_[enable,disable] sleep, make sure all drivers only calls them
>   in thread context.
> 
> * Impose a state in the clk so it can be "in transition", then an
> additional function
>   clk_is_stable() which will also have to be added to most drivers but had the
>   advantage of not violating the defined clk_[enable,disable] API.
> 
> * Throw in udelay():s after the clk_[enable,disable] calls, with some values
>   that are unfortunately then spread out in the drivers instead of in the
>   clk implementation.
I had a similar problem some time ago, and choosed to let
clk_{en,dis}able sleep.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

end of thread, other threads:[~2010-02-24  8:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-23 14:32 sleeping clk_[enable,disable]? Linus Walleij
2010-02-23 20:03 ` Rabin Vincent
2010-02-23 21:36   ` Linus Walleij
2010-02-24  8:46 ` Uwe Kleine-König

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).