[PATCH RFC] clk: use spinlock for clk_get_rate
mark.langsdorf at calxeda.com
Fri Sep 7 14:58:24 EDT 2012
> From: Shawn Guo <shawn.guo at linaro.org>
> A nested locking issue is seen on imx6q (CA9 Quad) as below when cpufreq
> driver is running. It looks like the issue is caused by a simultaneous
> call to clk_get_rate from two smp_twd threads.
> 1) cpu0_set_target
> 2) do_exit
> The patch "clk: new locking scheme for reentrancy" does not help the
> issue. I'm not sure if this is an issue that should be fixed in
> smp_twd driver or it's an use case which should be supported by clk API.
> Looking at clk_get_rate() API, it just reads a cached clock rate and
> should be fast enough to hold a spinlock than mutex. It's a quick
> fix to the issue, but I'm not really sure it's the correct one. That's
> why this is a RFC patch.
I was seeing a similar issue while developing cpufreq support for the
Calxeda Highbank SoC. This patch seems to have resolved the issue. I
don't know if it's correct, but it works for me.
More information about the linux-arm-kernel