[lkml]   [2011]   [Feb]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Locking in the clk API, part 2: clk_prepare/clk_unprepare
On Tue, Feb 01, 2011 at 04:22:03PM +0100, Uwe Kleine-König wrote:
> Full ack. (I wonder if you misunderstood me or wanted to put my
> statement into more words. Jassi didn't like that a clk_enable without
> a previous clk_prepare worked on some platforms and on others it
> doesn't. With BUG_ON(clk->ops->prepare && !clk->prepare_count) in
> clk_enable we have exactly this situation.)

Even with a NULL clk->ops->prepare function, we still want drivers to
have called clk_prepare(). So we can do something like:

if (WARN_ON(clk->prepare_count == 0))
return -EINVAL;

in clk_enable() should be sufficient and noisy enough not to be missed.

I'd avoid BUG_ON() here as that will take the system down, which may
increase the chances of getting useful bug reports.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2011-02-01 16:31    [W:0.086 / U:14.084 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site