Re: set_rtc_mmss: can't update from 0 to 59

From: Russell King (rmk@arm.linux.org.uk)
Date: Mon Dec 18 2000 - 03:46:23 EST


Matthew Dharm writes:
> Ahh... I think I see. While the math says "if the diference between the
> real time and the cmos time is less than 30 min", it doesn't recognize that
> the time difference between 2:59 and 3:00 is only 1 min.

Which is intentional.

> True enough... but, the question is, how do we fix this?

Why do you think it needs fixing?

Think about what happens when the current time according to the CMOS is
2:59:00 and Linux thinks its 3:01:20. We only write the minutes and
seconds, so if we did write, the CMOS clock then becomes 2:01:20.
Oops, we just lost an hour. Next time you reboot, you'll find the
time out by an hour or more depending on how many corrections of this
type have been done.

So, why don't we update the hours and be done with it? We would have to
play the same game with the days of the month vs hours. Also, we don't
know if the CMOS clock is programmed for UTC time or not (the kernel's
idea of time is UTC. Your CMOS may be programmed for EST for instance).
   _____
  |_____| ------------------------------------------------- ---+---+-
  | | Russell King rmk@arm.linux.org.uk --- ---
  | | | | http://www.arm.linux.org.uk/personal/aboutme.html / / |
  | +-+-+ --- -+-
  / | THE developer of ARM Linux |+| /|\
 / | | | --- |
    +-+-+ ------------------------------------------------- /\\\ |
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Dec 23 2000 - 21:00:21 EST