Export to GitHub

jetdroid - issue #6

Android time is running too fast


Posted on Nov 23, 2010 by Massive Lion

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.

Comment #1

Posted on Nov 25, 2010 by Happy Elephant

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

Comment #2

Posted on Nov 25, 2010 by Massive Lion

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.

Comment #3

Posted on Nov 30, 2010 by Massive Lion

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.

Comment #4

Posted on Jan 24, 2011 by Quick Kangaroo

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

Comment #5

Posted on Aug 2, 2011 by Happy Monkey

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 ;)

Status: New

Labels:
Type-Defect Priority-Medium Component-System Component-Kernel