LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* RTC no longer being updated in 2.6.16...
@ 2008-04-15 17:29 Robert King
  0 siblings, 0 replies; only message in thread
From: Robert King @ 2008-04-15 17:29 UTC (permalink / raw)
  To: linuxppc-embedded

Disclaimer: I'm working on a new project here, so I'm not 100% up-to-date=
=20on the system as a whole.

I've been tasked to find out why our RTC clock is not being updated after=
=20suynching with a NTP timesource.  In our previous release, the RTC see=
med to be updated every 11 minutes via the timer_interrupt() ISR.  This n=
o longer seems to be happening.  I have determined that timer_isr() is ru=
nning, but ppc_md.set_rtc_time(xtime.tv_sec+1 + timezone_offset) doesn't =
appear to ever get called.  There are five conditions that must be true f=
or this to be called:

=20  1 - ppc_md.set_rtc_time

this is true.

=20  2 - ntp_synced()

this seems to become true as soon as I sync with my NTP timesource.

=20  3 - xtime.tv_sec - last_rtc_update >=3D 659

this seems to become true within a few secondws of syncing with my timeso=
urce

=20  4 - abs((xtime.tv_nsec / 1000) - (1000000-1000000/HZ)) < 500000/HZ

this seems to be true fairly often

=20  5 - jiffies - wall_jiffies =3D=3D 1

This seems to be true fairly often.

My checks for these conditions are pretty crude.  If one is true, I go in=
to an infinite loop, which eventually kicks off the watchdog timer and th=
e card reboots.  Quick & dirty.

#1 #2, and #3 seem pretty obvious.  #1 checks for the presence of a time =
sync function, #2 checks to see if we have synchronized with an NTP serve=
r, and #3 checks to see of that sync was at least 11 minutes ago.

#4 and #5 I don't understand so much.  I THINK #4 checks to see of we're =
close to a second or half-second boundry (I'm assuming this is becxause o=
f a hardware limitation on the RTC.)  #5 I have no clue about.  It seems =
that wall_jiffies and jiffies are always the same.

My goal is simply to sync the RTC with the system clock, either periodica=
lly or at system shutdown (which is preferred.)  however, I don't have an=
=20RTC driver.  Neither do I have hwclock on this system, so my first sho=
t was getting the 11-minute update working.  If this is the wrong way to =
go, I'm open to suggestions.

-- Robert King
=20  Sevis Systems, Inc.
#########################################################################=
############
This e-mail message has been scanned for Viruses and Content and cleared =

by MailMarshal
#########################################################################=
############

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-04-15 17:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-15 17:29 RTC no longer being updated in 2.6.16 Robert King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox