daesga / jetdroid

Automatically exported from code.google.com/p/jetdroid
0 stars 0 forks source link

Android time is running too fast #6

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Time in android is running as twice faster as normal time. After booting it 
reads RTC time but then in Android system is probably internal counter which is 
uncalibrated.

Original issue reported on code.google.com by vacla...@gmail.com on 23 Nov 2010 at 8:51

GoogleCodeExporter commented 9 years ago
Don't know if this is a system or a kernel issue. Could this be relazed to 
issue #3 (Bogo MIPS)?

Original comment by dopi...@gmail.com on 25 Nov 2010 at 10:02

GoogleCodeExporter commented 9 years ago
That is the question. I don't know which mechanism is used for Android's 
SystemClock - in RTC module there is no 1-second software IRQ so far. It can be 
somewhere else, though. And not synchronised with RTC at all.

This needs to be investigated. Or ask somebody who has more experience.

It is likely not related to issue #3 as Kaes reported that SPICA has the same 
CPU as Jet has. So BogoMIPS value is probably correct.

Original comment by vacla...@gmail.com on 25 Nov 2010 at 10:20

GoogleCodeExporter commented 9 years ago
Well it depends, if SPICA has the same CPU (I thought that it hadn't) then 
BogoMIPS are correct.
I asked in Android forum and I got an answer that "linux kernel ticks are 
updated at wrong rate., you might need to cross check your timer counter 
(generate interrupt at
precise jiffies interval) and monitor isr."

Here is some info about linux kernel timers: 
http://elinux.org/Kernel_Timer_Systems

If I understand it correctly, we have either wrong jiffies, or wrong HZ value. 
Or both.

I found that calibration is in init/calibrate.c , then adjust_jiffies() is in 
drivers/cpufreq/cpufreq.c - but I don't know if it is used or not. It looks 
that adjust_jiffies() is used only in SMP environment.

Some deeper experience would be welcomed.

Original comment by vacla...@gmail.com on 30 Nov 2010 at 7:44

GoogleCodeExporter commented 9 years ago
The issue indeed is in the kernel. The HZ value is correct but jiffies 
clocksource need to be checked. Can i find it somewhere?

Original comment by jortj...@gmail.com on 24 Jan 2011 at 1:08

GoogleCodeExporter commented 9 years ago
hi guys, i kind of having same issue on my phone (porting android too)
i think the issue is on your timer that updates jiffies.
you might want to have a look here:
http://www.mail-archive.com/kernelnewbies@nl.linux.org/msg01041.html

look at your arch/**your_arch_here**/kernel/time.c:
timer_interrupt() calls kernel/timer.c:do_timer() which updates jiffies_64

hope this helps ;)

Original comment by mham...@gmail.com on 2 Aug 2011 at 6:11