[PATCH 3/8] clk: mxs: add clock support for imx28

Shawn Guo shawn.guo at freescale.com
Wed Apr 25 04:02:45 EDT 2012


On Wed, Apr 25, 2012 at 09:17:47AM +0200, Sascha Hauer wrote:
> Hi Shawn,
> 
> I realized that you have no register lock which means that you rely on
> the locking of the clock framework. This may not be sufficient, see the
> following example:
> 
> > +	mxs_clk_div("ssp0_div", "ssp0_sel", SSP0, 0, 9, 29);
> > +	clk = mxs_clk_gate("ssp0", "ssp0_div", SSP0, 31);
> 
> You have both a divider and a gate in the same register here. The gate
> implements clk_enable which is protected by a spinlock in the clock
> framework. The divider implements clk_set_rate which is protected by a
> mutex in the clock framework. This means that during a read-modify-write
> operation for a rate change the clk_enable call can come in between.

We have SET and CLR register on mxs clocks, so do not really have to
go through read-modify-write sequence.

Regards,
Shawn

> 
> Ok, here we have two clocks which are both handled by a single driver,
> so there probably won't be any real problems, but do you want to rely on
> this?
> 




More information about the linux-arm-kernel mailing list