From mboxrd@z Thu Jan 1 00:00:00 1970 From: Viresh Kumar Subject: Re: about system time incorrect after changing cpu frequency Date: Tue, 1 Sep 2015 13:12:05 +0530 Message-ID: <20150901074205.GC1456@linux> References: <20150901060236.GB1456@linux> Mime-Version: 1.0 Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-pm-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: vichy Cc: "cpufreq@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Linux PM list On 01-09-15, 15:21, vichy wrote: > and I add PLAT_gt_change_freq in arm_global_timer.c like below: > PLAT_gt_change_freq calling() { > gt_clk_rate = get_periph_clk(); > clockevents_update_freq(this_cpu_ptr(gt_evt), gt_clk_rate); In earlier versions of kernel, this had a problem that it works only for ONESHOT mode and simply returns in PERIODIC mode. I do see that your's mode is ONESHOT only, and so it should have worked. Anyway, few prints into that routine to see where we are reaching might help. > __clocksource_updatefreq_hz(>_clocksource, gt_clk_rate); AFAIR, there is a difference between how different mdelay/udelay are implemented. One of them is using the loops_per_jiffie variable to calculate the time, other uses clkevt device. I am not 100% sure about the theory, but that's what I remember. So, have a look from that perspective as well.. -- viresh