[PATCH RESEND] ARM: smp_twd: Reconfigure clockevents after cpufreq change

Linus Walleij linus.walleij at linaro.org
Fri Oct 7 02:42:48 EDT 2011


On Thu, Oct 6, 2011 at 7:25 PM, Thomas Gleixner <tglx at linutronix.de> wrote:
> On Thu, 6 Oct 2011, Linus Walleij wrote:
>> Here is the entire patch i Russells tracker:
>> http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=6956/2
>
> The only thing what puzzles me is:
>
>> +     if (!IS_ERR_OR_NULL(twd_clk))
>> +             twd_timer_rate = clk_get_rate(twd_clk);
>> +     else
>> +             twd_calibrate_rate();
>
> How is made sure that the cpu freq update thing is not called when
> twd_clk is not available or am I missing something ?

The CPUfreq transition notifier is only registered if twd_clk is
not error or NULL in this #ifdef CONFIG_CPU_FREQ snippet
above that code, but executed later:

+static int twd_cpufreq_init(void)
+{
+	if (!IS_ERR_OR_NULL(twd_clk))
+		return cpufreq_register_notifier(&twd_cpufreq_nb,
+			CPUFREQ_TRANSITION_NOTIFIER);
+
+	return 0;
+}
+core_initcall(twd_cpufreq_init);

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list