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

2007-09-20 Thread Tony Breeds
On Thu, Sep 20, 2007 at 09:35:10AM -0700, john stultz wrote: > I think what Daniel is pointing out is that the clocksource read > function isn't the place for the __USE_RTC() conditional. > > It would likely be better instead of the timebase clocksource managing > multiple type of hardware (tim

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

2007-09-20 Thread john stultz
On Thu, 2007-09-20 at 10:52 +1000, Paul Mackerras wrote: > Daniel Walker writes: > > > If you switch to the rtc do the shift and mult need to change? > > You can't switch; any given CPU chip will have either the RTC or the > timebase but not both. I think what Daniel is pointing out is that the

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

2007-09-19 Thread Daniel Walker
On Thu, 2007-09-20 at 13:29 +1000, David Gibson wrote: > > Maybe say "It a constant" up front .. The value that is output from the > > clocksource read is converted to nanoseconds .. This clocksource is only > > designed to work with the timebase, so it doesn't make sense to output > > an rtc valu

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

2007-09-19 Thread David Gibson
On Wed, Sep 19, 2007 at 06:54:41PM -0700, Daniel Walker wrote: > On Thu, 2007-09-20 at 11:46 +1000, Paul Mackerras wrote: > > Daniel Walker writes: > > > > > On Thu, 2007-09-20 at 10:52 +1000, Paul Mackerras wrote: > > > > Daniel Walker writes: > > > > > > > > > If you switch to the rtc do the sh

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

2007-09-19 Thread Daniel Walker
On Thu, 2007-09-20 at 11:46 +1000, Paul Mackerras wrote: > Daniel Walker writes: > > > On Thu, 2007-09-20 at 10:52 +1000, Paul Mackerras wrote: > > > Daniel Walker writes: > > > > > > > If you switch to the rtc do the shift and mult need to change? > > > > > > You can't switch; any given CPU chi

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

2007-09-19 Thread Paul Mackerras
Daniel Walker writes: > On Thu, 2007-09-20 at 10:52 +1000, Paul Mackerras wrote: > > Daniel Walker writes: > > > > > If you switch to the rtc do the shift and mult need to change? > > > > You can't switch; any given CPU chip will have either the RTC or the > > timebase but not both. > > The cod

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

2007-09-19 Thread Daniel Walker
On Thu, 2007-09-20 at 10:52 +1000, Paul Mackerras wrote: > Daniel Walker writes: > > > If you switch to the rtc do the shift and mult need to change? > > You can't switch; any given CPU chip will have either the RTC or the > timebase but not both. The code is switching between to clock read func

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

2007-09-19 Thread Paul Mackerras
Daniel Walker writes: > If you switch to the rtc do the shift and mult need to change? You can't switch; any given CPU chip will have either the RTC or the timebase but not both. > > + /* XXX this assumes clock->shift == 22 */ > > + /* 4611686018 ~= 2^(20+64-22) / 1e9 */ > > +

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

2007-09-19 Thread Daniel Walker
On Wed, 2007-09-19 at 16:49 +1000, Tony Breeds wrote: > +/* clocksource code */ > +/* FIXME: provide an RTC clocksource /or/ use a better name */ > +static cycle_t timebase_read(void) > +{ > + if (__USE_RTC()) > + return (cycle_t)get_rtc(); > + return (cycle_t)get_tb(); >

[PATCH 2/5] Implement generic time of day clocksource for powerpc machines.

2007-09-18 Thread Tony Breeds
Signed-off-by: Tony Breeds <[EMAIL PROTECTED]> --- arch/powerpc/Kconfig |6 arch/powerpc/kernel/time.c | 255 - 2 files changed, 91 insertions(+), 170 deletions(-) Index: working/arch/powerpc/Kconfig ===