linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Martin Costabel <costabel@wanadoo.fr>
To: linuxppc-dev@lists.linuxppc.org
Cc: Iain Sandoe <iain@sandoe.co.uk>
Subject: Re: rtc again...
Date: Thu, 03 Aug 2000 11:00:55 +0200	[thread overview]
Message-ID: <398934C7.663E6BD9@wanadoo.fr> (raw)
In-Reply-To: 200008022249.XAA32651@hyperion.valhalla.net

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

Iain Sandoe wrote:
>
> Hi,
>
> under 2.2.17pre15ben1
>
> rtc does not give me the right answer when built in - what am I doing wrong?
>
> It won't build load as a module right now 'cos I forgot to check ppc_ksyms
> before doing the build :-( .... (I remembered for 2.4.0).
>
> under 2.4.0-test5 it seems to be fine as a module (haven't tried built in).

I am using it as module both for 2.2.17-bk and for 2.4.0-test5. They
don't give the same time, and I think it is the one in 2.4.0 that is
right. I am at GMT+2:00, and the time in 2.2.17 is 2 hours early. When I
change /etc/sysconfig/clock from "UTC=false" to "UTC=true", both times
shift by 2 hours, but the discrepancy remains.

The following patch for bitkeeper linuxppc_2_2 fixes this problem for
me. It brings 2.2.17pre13 in line with 2.4.0-test5 (and MacOS). I cannot
test the VIAPMU part, so maybe there the offset is necessary, but for
the VIACUDA part, it seems wrong.

--
Martin

[-- Attachment #2: pmac_time.patch --]
[-- Type: text/plain, Size: 1027 bytes --]

--- arch/ppc/kernel/pmac_time.c~	Mon Jun 26 09:09:05 2000
+++ arch/ppc/kernel/pmac_time.c	Thu Aug  3 09:22:36 2000
@@ -78,7 +78,6 @@
 unsigned long pmac_get_rtc_time(void)
 {
 	struct adb_request req;
-	int offset = sys_tz.tz_minuteswest * 60;

 	/* Get the time from the RTC */
 	if (adb_controller == 0)
@@ -95,7 +94,7 @@
 			printk(KERN_ERR "pmac_get_rtc_time: got %d byte reply\n",
 			       req.reply_len);
 		return (req.reply[3] << 24) + (req.reply[4] << 16)
-			+ (req.reply[5] << 8) + req.reply[6] - RTC_OFFSET + offset;
+			+ (req.reply[5] << 8) + req.reply[6] - RTC_OFFSET;
 	case ADB_VIAPMU:
 		if (pmu_request(&req, NULL, 1, PMU_READ_RTC) < 0) {
 			printk("pmac_read_rtc_time: pmu_request failed\n");
@@ -107,7 +106,7 @@
 			printk(KERN_ERR "pmac_get_rtc_time: got %d byte reply\n",
 			       req.reply_len);
 		return (req.reply[1] << 24) + (req.reply[2] << 16)
-			+ (req.reply[3] << 8) + req.reply[4] - RTC_OFFSET + offset;
+			+ (req.reply[3] << 8) + req.reply[4] - RTC_OFFSET;
 	default:
 		return 0;
 	}


  reply	other threads:[~2000-08-03  9:00 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-08-02 22:48 rtc again Iain Sandoe
2000-08-03  9:00 ` Martin Costabel [this message]
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-09-17 16:47                       ` dual G4 time issues Troy Benjegerdes
2000-08-14 12:59                     ` rtc again 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
  -- strict thread matches above, loose matches on Subject: below --
2000-08-03  9:41 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 11:24 Iain Sandoe
     [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-08 11:35 Iain Sandoe
2000-08-08 13:14 ` Geert Uytterhoeven
2000-08-08 14:31 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
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

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=398934C7.663E6BD9@wanadoo.fr \
    --to=costabel@wanadoo.fr \
    --cc=iain@sandoe.co.uk \
    --cc=linuxppc-dev@lists.linuxppc.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;
as well as URLs for NNTP newsgroup(s).