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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

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?

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel


[Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [PDAs]     [Linux]     [Linux MIPS]     [Yosemite Campsites]     [Photos]

Add to Google Follow linuxarm on Twitter