linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Martin Costabel <costabel@wanadoo.fr>
To: Benjamin Herrenschmidt <bh40@calva.net>
Cc: Gabriel Paubert <paubert@iram.es>, linuxppc-dev@lists.linuxppc.org
Subject: Re: rtc again...
Date: Wed, 09 Aug 2000 13:32:45 +0200	[thread overview]
Message-ID: <3991415D.2792242@wanadoo.fr> (raw)
In-Reply-To: 20000809084422.4567@mailhost.mipsys.com


Benjamin Herrenschmidt wrote:
>
> >
> >I'm slightly lost :-(. But whether the clock is in UTC or not is a
> >parameter (defined in /etc/sysconfig/clock or another system configuration
> >file), so I think that translating to/from UTC when setting the clock is a
> >purely userland job and set/get_rtc_time should never have to handle this.
>
> The problem is that those functions are in-kernel, and without proper
> conversion, they could put incorrect time in the RTC. Those are called by
> /dev/rtc on macintosh, additionally, get_rtc_time() is called at boot,
> and set_rtc_time() used to be called regulary (the famous code I #if'ed out).
>
> So if it's a userland-only thing, then the set_time() must be removed
> since the kernel can't know if the RTC is UTC or local time. Except if we
> decide that on PowerMac, we always follow Apple layout (to be compatible
> with MacOS X) and implement the UTC/local conversion inside those so they
> always expose UTC times to the kernel.

Do I understand this right: As a Pmac user, I have to set "UTC=yes" in
/etc/sysconfig/clock, and then everything will be working correctly? So
only those developers who want to lose their sanity by trying to hack
the kernel time routines have to know that the Pmac CMOS clock is
actually running in localtime, whereas for everyone else, kernel and
userland, it appears to run in UTC?

This makes sense. It also explains the recent confusion: I think I used
to have UTC=yes, until with the recent introduction of rtc.c, everyone
was claiming that the Pmac CMOS clock runs in localtime, so I switched
to UTC=false.

It would be nice to have the same system in all the kernel trees. Right
now, the 5 kernel trees at penguinppc.org have 4 different versions of
the {s|g}et_rtc_time() routines in arch/ppc/kernel/pmac_time.c. In the
bitkeeper-devel kernel, these 2 routines aren't even compatible: If you
say "hwclock --systohc" and then "hwclock --hctosys", you don't get the
same time as before.

<2 reboots later>
This is driving me nuts! What I wrote above worked nicely for a
bitkeeper-2.2.17 kernel with arch/ppc/kernel/pmac_time.c from pmac-benh.
I now tried it with a pmac-devel 2.4.0-test6 kernel which has the same
logic of offsets get_rtc_time() in pmac_time.c, if I am able to read.
But it does not give the same result! System time is off by 2 hours. So
this kernel wants "UTC=false"... And I am back to square one: Impossible
to configure my system using RTC and the new hwclock in such a way that
a 2.2.17 kernel and a 2.4.0 kernel boot up to the same system time.
</giving up>

--
Martin

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

  reply	other threads:[~2000-08-09 11:32 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-08-08 14:31 rtc again Iain Sandoe
2000-08-08 17:08 ` Michael Schmitz
2000-08-08 17:41   ` Benjamin Herrenschmidt
2000-08-08 22:44     ` Gabriel Paubert
2000-08-09  8:44       ` Benjamin Herrenschmidt
2000-08-09 11:32         ` Martin Costabel [this message]
2000-08-09 13:50         ` Gabriel Paubert
2000-08-09 15:25           ` Benjamin Herrenschmidt
2000-08-09 16:54             ` Takashi Oe
2000-08-09 17:04               ` Benjamin Herrenschmidt
2000-08-09 23:12                 ` Takashi Oe
2000-08-09 23:48                   ` Benjamin Herrenschmidt
2000-08-09 22:13             ` Gabriel Paubert
2000-08-09 22:48               ` Benjamin Herrenschmidt
2000-08-10  3:08                 ` Gabriel Paubert
2000-08-10  0:00               ` William Blew
2000-08-09 14:26         ` Takashi Oe
2000-08-09  0:55     ` Takashi Oe
2000-08-09  8:48       ` Benjamin Herrenschmidt
2000-08-09 16:37         ` Takashi Oe
2000-08-09 22:46           ` Gabriel Paubert
2000-08-09 14:24     ` Geert Uytterhoeven
  -- strict thread matches above, loose matches on Subject: below --
2000-08-08 11:35 Iain Sandoe
2000-08-08 13:14 ` Geert Uytterhoeven
     [not found] <20000804205524.383@192.168.1.10>
2000-08-05  1:10 ` Takashi Oe
2000-08-05 11:25   ` Benjamin Herrenschmidt
2000-08-05 14:44     ` Takashi Oe
2000-08-03 11:24 Iain Sandoe
2000-08-03  9:56 Iain Sandoe
2000-08-03 10:13 ` Benjamin Herrenschmidt
2000-08-03 11:58 ` Martin Costabel
2000-08-03  9:41 Iain Sandoe
2000-08-02 22:48 Iain Sandoe
2000-08-03  9:00 ` Martin Costabel
2000-08-03  9:30   ` Benjamin Herrenschmidt
2000-08-03 10:54     ` Gabriel Paubert
2000-08-03 11:14       ` Benjamin Herrenschmidt
2000-08-03 11:25         ` Gabriel Paubert
2000-08-03 11:45         ` Gabriel Paubert
2000-08-03 13:25           ` Benjamin Herrenschmidt
2000-08-03 23:33       ` Takashi Oe
2000-08-04  8:55         ` Gabriel Paubert
2000-08-04 15:25           ` David Edelsohn
2000-08-04 15:50             ` Benjamin Herrenschmidt
2000-08-07 12:33               ` Gabriel Paubert
2000-08-07 11:51             ` Gabriel Paubert
2000-08-07 13:18               ` Benjamin Herrenschmidt
2000-08-07 15:14               ` David Edelsohn
2000-08-07 21:16                 ` Gabriel Paubert
2000-08-08  1:39               ` Paul Mackerras
2000-08-11 11:04                 ` Gabriel Paubert
2000-08-12  6:29                   ` Paul Mackerras
2000-08-12 12:02                     ` Ethan Benson
2000-08-12 12:51                       ` Gabriel Paubert
2000-08-12 18:46                     ` Gabriel Paubert
2000-08-14 12:59                     ` Gabriel Paubert
     [not found]       ` <Pine.LNX.3.96LJ1.1b7.1000803182949.650C-100000@ofey.earthl ink.net>
2000-08-03 23:58         ` Franz Sirl
2000-08-04  0:33           ` Takashi Oe
2000-08-04 12:54             ` Benjamin Herrenschmidt
2000-08-04 13:40               ` Takashi Oe
2000-08-04 13:20       ` Geert Uytterhoeven
2000-08-08 11:20         ` Gabriel Paubert
2000-08-03 10:31   ` Franz Sirl

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=3991415D.2792242@wanadoo.fr \
    --to=costabel@wanadoo.fr \
    --cc=bh40@calva.net \
    --cc=linuxppc-dev@lists.linuxppc.org \
    --cc=paubert@iram.es \
    /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;
as well as URLs for NNTP newsgroup(s).