Re: [PATCH v2 2/4] Implement generic time of day clocksource for powerpc machines.

2007-09-21 Thread David Gibson
On Fri, Sep 21, 2007 at 02:59:31PM +1000, Paul Mackerras wrote:
 Daniel Walker writes:
 
  I don't think the RTC frequency isn't the same as the timebase? Seems
  like the RTC only case about seconds at the lowest level. If that's the
  case then the jiffies clock might be better to use .. The other thing I
  wonder is if the __USE_RTC boards might have lower level clocks that
  could be used instead ..
 
 It's OK, the RTC isn't what you think it is, it's a pair of
 CPU-internal registers which count seconds and nanoseconds.  On
 processors with the RTC, tb_ticks_per_sec is initialized to
 10.  Trust me, this code is OK. :)

Indeed..  I'm wondering if we should do a s/rtc/ppc601rtc/ or
something.  Otherwise people will keep making this mistake and be
confused.

-- 
David Gibson| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH v2 2/4] Implement generic time of day clocksource for powerpc machines.

2007-09-21 Thread Tony Breeds
On Fri, Sep 21, 2007 at 02:52:12PM +1000, Stephen Rothwell wrote:
 Small comments.

Thanks.

 I think this is redundant as if __USE_RTC() is true, you register
 clocksource_rtc below.

Yup you're right.

 The #ifdef is redundant since if CONFIG_ISERIES is not set,
 firmware_has_feature(FW_FEATURE_ISERIES) is constant 0.

Ahh okay.  I got too fancy for my own good.

patch comming.

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH v2 2/4] Implement generic time of day clocksource for powerpc machines.

2007-09-20 Thread Daniel Walker
On Fri, 2007-09-21 at 13:26 +1000, Tony Breeds wrote:
 +
 +   if (__USE_RTC())
 +   clock = clocksource_rtc;
 +   else
 +   clock = clocksource_timebase;
 +
 +   clock-mult = clocksource_hz2mult(tb_ticks_per_sec,
 clock-shift);

I don't think the RTC frequency isn't the same as the timebase? Seems
like the RTC only case about seconds at the lowest level. If that's the
case then the jiffies clock might be better to use .. The other thing I
wonder is if the __USE_RTC boards might have lower level clocks that
could be used instead ..

Daniel

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH v2 2/4] Implement generic time of day clocksource for powerpc machines.

2007-09-20 Thread Paul Mackerras
Daniel Walker writes:

 I don't think the RTC frequency isn't the same as the timebase? Seems
 like the RTC only case about seconds at the lowest level. If that's the
 case then the jiffies clock might be better to use .. The other thing I
 wonder is if the __USE_RTC boards might have lower level clocks that
 could be used instead ..

It's OK, the RTC isn't what you think it is, it's a pair of
CPU-internal registers which count seconds and nanoseconds.  On
processors with the RTC, tb_ticks_per_sec is initialized to
10.  Trust me, this code is OK. :)

Paul.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev