Commit ea7e7b10 authored by Gunter Grau's avatar Gunter Grau Committed by Philippe Gerum

arm/ipipe: fix inaccurate RTC on 1 GHz bump

i.MX CPUs usually start with a lower CPU frequency and change to a
higher frequency operating point at kernel start. It has been observed
that when bumping e.g from 792 MHz to 996 MHz during boot, the Linux
clock is counting faster than a RTC. Force the timekeeper to
recalculate the clocksource after the bump. We achieve this by
lowering the rating of the ipipe_tsc and lifting it up again.
parent ec07f4dc
......@@ -231,9 +231,14 @@ static __init int cpufreq_transition_handler(struct notifier_block *nb,
if (state == CPUFREQ_POSTCHANGE && tsc_info.refresh_freq) {
freq = tsc_info.refresh_freq();
if (freqs->cpu == 0) {
int oldrate;
tsc_info.freq = freq;
/* force timekeeper to recalculate the clocksource */
oldrate = clksrc.rating;
clocksource_change_rating(&clksrc, 0);
clocksource_change_rating(&clksrc, oldrate);
smp_call_function_single(freqs->cpu, update_timer_freq,
&freq, 1);
......@@ -217,6 +217,8 @@ static unsigned int refresh_gt_freq(void)
gt_clk_rate = clk_get_rate(gt_clk);
__clocksource_update_freq_hz(&gt_clocksource, gt_clk_rate);
return gt_clk_rate;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment