login
Header Space

 
 

Re: [rtc-linux] [RFC][PATCH 1/4] RTC: Class device support for persistent clock

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: David Woodhouse <dwmw2@...>
Cc: <rtc-linux@...>, Alessandro Zummo <a.zummo@...>, Jean Delvare <khali@...>, Ralf Baechle <ralf@...>, Thomas Gleixner <tglx@...>, Andrew Morton <akpm@...>, <i2c@...>, <linux-mips@...>, <linux-kernel@...>
Date: Wednesday, May 7, 2008 - 4:43 pm

On Wed, 7 May 2008, David Woodhouse wrote:


 :-)

 Yes, the generic callers of read_persistent_clock() seem to be fine.  I
have not dug into various pieces of platform code to check there though.  
I do hope platform maintainers enable these debugging checks from time to
time -- I mean especially those taking care of all these more or less
exotic systems and boards residing one level below generic architecture
support... ;-)


 Good idea.


 I have thought of this and recognised the concern about modules.  I think
another possibility that could work with modules might be opening and
closing the device on demand.  But still it is just an optimisation, which
can certainly be done gradually on top of these changes without even
changing the interface.

 From the code structure's point of view it is certainly cleaner to open
and close the device each time it is used and I think as such it is a good
starting point -- let's spoil it later. ;-)


 Even better than that -- some devices may have better precision and 
require no strange handling.  For example this very M41T81 chip I am 
working with supports resolution up to .01s -- which means there is little 
point in trying to work out delays, etc. to get the clock written back at 
the right point, where we can easily obtain two levels of magnitude better 
a resolution by simply not discarding the sub-second part of a timestamp.  

 Of course for sub-second resolution of the RTC the interface of
read_persistent_clock() would have to be modified to return a struct
timespec; contrarily update_persistent_clock() is ready for that, but then
struct rtc_time plus rtc_read_time(), rtc_set_mmss() and rtc_set_time()  
will still have to be updated accordingly.

 BTW, this chip is even better than that, because it can be disciplined --
there is a five-bit calibration register that lets one add or remove
oscillator ticks to/from the input at a certain stage of the divider chain
-- that could be used by the NTP daemon or tools like `hwclock --adjust'
somehow.  It's just an idea -- I have not investigated it further.


 Yes, that I would consider a reasonable long-term plan, but it will take
at least a short while during which it might not be a good idea to break
all the platforms that have not got converted yet.  Especially as, however
unbelievable it may sound, unlike myself I think most people do not
consider the Broadcom SWARM the most obvious platform to use and/or
support.

  Maciej
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [RFC][PATCH 1/4] RTC: Class device support for persisten..., Maciej W. Rozycki, (Sun May 18, 12:39 am)
Re: [rtc-linux] [RFC][PATCH 1/4] RTC: Class device support f..., Maciej W. Rozycki, (Wed May 7, 4:43 pm)
speck-geostationary