Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Jan-Benedict Glaw <jbglaw@lug-owl.de>
To: linux-mips@linux-mips.org
Subject: Re: Updating RTC with date command
Date: Tue, 19 Jul 2005 16:42:30 +0200	[thread overview]
Message-ID: <20050719144230.GE20065@lug-owl.de> (raw)
In-Reply-To: <20050719143110.GD3108@linux-mips.org>

[-- Attachment #1: Type: text/plain, Size: 1783 bytes --]

On Tue, 2005-07-19 10:31:10 -0400, Ralf Baechle <ralf@linux-mips.org> wrote:
> On Tue, Jul 19, 2005 at 03:34:01PM +0530, Nori, Soma Sekhar wrote:
> > However, when I try to update the time using date -s <time string> 
> > the RTC does not get updated. (shows the old time when I boot-up again)

Right, expected. date -s  sets the time of the running system, not the
system's HW time.

> > In arch\mips\kernel\time.c the timer_interrupt calls rtc_set_mmss,
> > but that call is made only when STA_UNSYNC is _not_ set in time_status
> > variable. do_settimeofday/sys_stime _set_ this flag so the timer 
> > interrupt does not call rtc_set_mmss. 	

Right. HW clock updating is somewhat supposed to work IFF ntp is
running.

> > Can somebody please help me understand how the RTC is supposed to be
> > updated after user changes the time using the date command?
> 
> Not at all.  Try man hwclock.

hwclock is the userspace utility to manually once set the time. In
normal operation, this should only be called _once_, after the system is
switched on for the very first time.

During lifetime, ntpd should execute and thus the system's current time
will be written to the HW clock every now and then. Additionally, most
distributions seem to also update the HW clock at system shutdown time.

So the correct solution to your problem is to either shutdown once
(workaround) or keep ntpd running (the solution[tm]).

MfG, JBG

-- 
Jan-Benedict Glaw       jbglaw@lug-owl.de    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
 fuer einen Freien Staat voll Freier Bürger" | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2005-07-19 14:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-19 10:04 Updating RTC with date command Nori, Soma Sekhar
2005-07-19 10:04 ` Nori, Soma Sekhar
2005-07-19 14:31 ` Ralf Baechle
2005-07-19 14:42   ` Jan-Benedict Glaw [this message]
2005-07-19 15:06     ` Maciej W. Rozycki
2005-07-19 15:20       ` Jan-Benedict Glaw
2005-07-19 16:40         ` Maciej W. Rozycki
2005-07-19 23:00           ` Jan-Benedict Glaw

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050719144230.GE20065@lug-owl.de \
    --to=jbglaw@lug-owl.de \
    --cc=linux-mips@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox