Re: [PATCH 1/2] Add a common struct clk

From: Russell King - ARM Linux
Date: Mon Jan 10 2011 - 06:01:11 EST


On Mon, Jan 10, 2011 at 11:41:22AM +0100, Sascha Hauer wrote:
> This branch must be reworked because the correct locking is missing, but
> the first branch should be ready for merging once your clk-common
> patches are merged. I'll post the patches for review soon. I hope it's
> clear soon that your clk-common patches get merged.

Unless the locking problems can be resolved, the patches aren't ready.

>From what I've seen there's still quite a problem with what kind of
lock to use in the clock - mutex or spinlock.

I don't see that having some clocks be one and others another is really
acceptable - think about the resulting mess if you end up with some
parent mux'd clocks which are a mutex and others which are a spinlock.
Can a driver use an atomic call for that? Sometimes depending on the
mux, sometimes depending on whether a parent clock is already enabled.

What if your clock was enabled while the mux selected another spinlock-
locked clk, but then you switched to a different operating point and the
mux then selected the mutex-locked clock.

We could say that this is illegal - but then we need to have the code
explicitly check this otherwise such situations will be created.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/