linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Gabriel Paubert <paubert@iram.es>
To: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [RFC/PATCH 1/2] Basic generic time/clocksource code for PowerPC
Date: Mon, 10 Sep 2007 11:09:35 +0200	[thread overview]
Message-ID: <20070910090935.GA14769@iram.es> (raw)
In-Reply-To: <18147.49943.182399.64990@cargo.ozlabs.ibm.com>

On Sun, Sep 09, 2007 at 07:55:35PM +1000, Paul Mackerras wrote:
> Gabriel Paubert writes:
> 
> > The solution now used by i386/x86-64/sparc64 is
> > CONFIG_GENERIC_CMOS_UPDATE. Maybe powerpc should be switched
> > to use something similar, but the generic code has some
> 
> Yes.  I'll turn on CONFIG_GENERIC_CMOS_UPDATE.  Do you think it needs
> to be a config option that can be turned on and off in the kernel
> config, or should it just be always on as on x86[-64]?

I believe that it can be turned on systematically. But 
I only have 32 bit, non HV machines (basically 603e, 750, 
and 74xx processors).

> 
> > problems (it assumes that you have to set the clock
> > on a half-second, which is not the case of the RTC on 
> > my boards to start with).
> 
> Let's get the generic code fixed to do what we need then.  Care to
> send a patch?

I'm unsure on how to implement it in a way acceptable
upstream, the problem is that the following lines:

	if (abs(xtime.tv_nsec - (NSEC_PER_SEC / 2)) <= tick_nsec / 2)
		fail = update_persistent_clock(now);

        next.tv_nsec = (NSEC_PER_SEC / 2) - now.tv_nsec;

are hardwired to half a second. Can it be transformed into
a per arch static inline function defined in asm-${arch}?

There is also a possible problem in notify_cmos_timer, I believe
that the logic is wrong and the condition is reversed and should
be "if (!no_sync_cmos_clock)". 

Otherwise the clock update timer will never be started! This boolean 
really should be called disable_persistent_clock_updates or something 
similar. 

I'm really wondering how much testing all this code has had. The 
more I look at the timekeeping code changes in the last months, 
the less I understand them.

	Gabriel

  reply	other threads:[~2007-09-10  9:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-06 14:41 [RFC/PATCH 1/2] Basic generic time/clocksource code for PowerPC Paul Mackerras
2007-09-06 16:55 ` Gabriel Paubert
2007-09-06 17:01   ` Scott Wood
2007-09-06 17:05     ` Gabriel Paubert
2007-09-06 17:24       ` Scott Wood
2007-09-07  8:21         ` Gabriel Paubert
2007-09-09  9:55           ` Paul Mackerras
2007-09-10  9:09             ` Gabriel Paubert [this message]
2007-09-06 18:20   ` Paul Mackerras
2007-09-07  8:50     ` Gabriel Paubert

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=20070910090935.GA14769@iram.es \
    --to=paubert@iram.es \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.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).