linux-mips
[Top] [All Lists]

Re: [patch] Generic time fixes

To: Jun Sun <jsun@mvista.com>
Subject: Re: [patch] Generic time fixes
From: "Maciej W. Rozycki" <macro@ds2.pg.gda.pl>
Date: Wed, 23 Jul 2003 16:52:31 +0200 (MET DST)
Cc: Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org
In-reply-to: <20030722181430.I3135@mvista.com>
Organization: Technical University of Gdansk
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
On Tue, 22 Jul 2003, Jun Sun wrote:

> > > Isn't it cool to take care of the board-specific with the same interface
> > > kernel time system uses?  Every MIPS board gets a basic RTC driver for 
> > > free!
> > 
> >  Well, I'm not that convinced.  What's wrong with making real support for
> > the RTC chip instead?
> >
> 
> Nothing wrong with full RTC driver support - it is just that when
> 30+ MIPS boards don't have to add #ifdef's to rtc.c and mc146818rtc.h
> and hwclock still works people start appreciate more about the
> existence of rtc_set_time().

 Hmm, but how many different RTC chips are out there?  I agree the current
rtc.c/mc146818rtc.h implementation sucks, but it should be fixed and not
worked around.

> If you really want, how about the following change:
> 
> 1) add set_rtc_mmss() function pointer in asm/time.h.
> 2) set it equal to set_rtc_time in time_init().  Board can override
>    this decision in board_timer_setup() for better performance.
> 3) RTC update is changed to call set_rtc_mmss()
> 
> How does this sound?  It leaves all existing code unchanged, while
> gives a way for optimization.  The default setting of set_rtc_mmss
> to set_rtc_time makes logical sense too, because set_rtc_mmss is really
> a "back door" version of set_rtc_time().

 That's just fine for me.

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +


<Prev in Thread] Current Thread [Next in Thread>