Re: rtc again...

4 messages, 3 authors, 2000-08-04 · open the first message on its own page

Re: rtc again...

From: Franz Sirl <hidden>
Date: 2000-08-03 23:58:13

At 01:33 04.08.00, Takashi Oe wrote:
On Thu, 3 Aug 2000, Gabriel Paubert wrote:
quoted
===== arch/ppc/kernel/pmac_time.c 1.2 vs 1.5 =====
--- 1.2/arch/ppc/kernel/pmac_time.c   Mon Jun 19 19:59:36 2000
+++ 1.5/arch/ppc/kernel/pmac_time.c   Mon Jul 31 11:28:27 2000
[...]
quoted
 int pmac_set_rtc_time(unsigned long nowtime)
 {
-     return 0;
+#ifdef CONFIG_ADB
+     struct adb_request req;
+#endif
+     nowtime += RTC_OFFSET - sys_tz.tz_minuteswest * 60;
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This needs to be changed to

+       nowtime += RTC_OFFSET - sys_tz.tz_minuteswest * 60 +
(sys_tz.tz_dsttime? 3600: 0);
No, don't handle DST in the kernel!! hwclock handles this in userland, see
the hwclock source for details.

Franz.


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

Re: rtc again...

From: Takashi Oe <hidden>
Date: 2000-08-04 00:33:20

On Fri, 4 Aug 2000, Franz Sirl wrote:
At 01:33 04.08.00, Takashi Oe wrote:
quoted
On Thu, 3 Aug 2000, Gabriel Paubert wrote:
quoted
===== arch/ppc/kernel/pmac_time.c 1.2 vs 1.5 =====
--- 1.2/arch/ppc/kernel/pmac_time.c   Mon Jun 19 19:59:36 2000
+++ 1.5/arch/ppc/kernel/pmac_time.c   Mon Jul 31 11:28:27 2000
[...]
quoted
 int pmac_set_rtc_time(unsigned long nowtime)
 {
-     return 0;
+#ifdef CONFIG_ADB
+     struct adb_request req;
+#endif
+     nowtime += RTC_OFFSET - sys_tz.tz_minuteswest * 60;
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This needs to be changed to

+       nowtime += RTC_OFFSET - sys_tz.tz_minuteswest * 60 +
(sys_tz.tz_dsttime? 3600: 0);
No, don't handle DST in the kernel!! hwclock handles this in userland, see
the hwclock source for details.
Oh, "nowtime" is UTC + DST fix up then???  If so, that seems to be broken
to me.


Takashi Oe


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

Re: rtc again...

From: Benjamin Herrenschmidt <hidden>
Date: 2000-08-04 12:54:45

Oh, "nowtime" is UTC + DST fix up then???  If so, that seems to be broken
to me
AFAIK, the timezone offset in nvram includes the DST fixup.

Ben.


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

Re: rtc again...

From: Takashi Oe <hidden>
Date: 2000-08-04 13:40:01

On Fri, 4 Aug 2000, Benjamin Herrenschmidt wrote:
quoted
Oh, "nowtime" is UTC + DST fix up then???  If so, that seems to be broken
to me
AFAIK, the timezone offset in nvram includes the DST fixup.
Yes, that's right.

My assumption was "nowtime" given to kernel for pmac_set_rtc_time() is
UTC.  If that's the case, the following code in pmac_set_rtc_time()

     nowtime += RTC_OFFSET - sys_tz.tz_minuteswest * 60;

is incomplete because it does not include DST fix up and the time stored
via CUDA or PMU will be an hour off from localtime which Mac OS uses
during DST is in effect.

Is my assumption correct?

What I was saying is that if "nowtime" given to kernel is neither UTC or
localtime, the interface seems to be broken (to me).


Takashi Oe


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help