public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell•net>
To: Alessandro Zummo <a.zummo@towertech•it>
Cc: linuxppc-dev@ozlabs•org, Paul Mundt <lethal@linux-sh•org>,
	David Woodhouse <dwmw2@infradead•org>,
	rtc-linux@googlegroups•com
Subject: Re: [RFC PATCH] rtc: add rtc_systohc for ntp use
Date: Mon, 10 Nov 2008 14:57:28 -0800	[thread overview]
Message-ID: <200811101457.29051.david-b@pacbell.net> (raw)
In-Reply-To: <20081110154026.21405.47457.stgit@i1501.lan.towertech.it>

Yeah, we should have one of these.  :)


On Monday 10 November 2008, Alessandro Zummo wrote:
> @@ -30,7 +30,7 @@ config RTC_HCTOSYS
>  	  unnecessary fsck runs at boot time, and to network better.
>  
>  config RTC_HCTOSYS_DEVICE
> -	string "RTC used to set the system time"
> +	string "RTC used to set the system time on startup and resume"
>  	depends on RTC_HCTOSYS = y
>  	default "rtc0"
>  	help
> @@ -52,6 +52,23 @@ config RTC_HCTOSYS_DEVICE
>  	  sleep states. Do not specify an RTC here unless it stays powered
>  	  during all this system's supported sleep states.
>  
> +config RTC_SYSTOHC
> +	bool "Set RTC from system time in NTP sync mode"
> +	depends on RTC_CLASS = y
> +	default y
> +	help
> +	  If you say yes here, the system time (wall clock) will be written
> +	  to the hardware clock every 11 minutes, if the kernel is in NTP
> +	  mode and your platforms supports it.
> +
> +config RTC_SYSTOHC_DEVICE
> +	string "RTC used to save the system time in NTP sync mode"

Why not just use RTC_HCTOSYS_DEVICE for this?  I have a hard time
sseeing any other value make sense ... assuming there's only one
RTC involved.

A better default might be to update all the RTCs on the system.

I'm thinking of my trusty test-case here:  rtc0 is highly functional
(including wake from RTC alarm) but not battery backed, while rtc1
is battery backed but only tracks time.  NTP really needs to update
both of them ... rtc0 since that's what's used most of the time,
and also rtc1 since that's what actually *stores* the time during
power off cycles.


> +static int rtc_systohc(struct rtc_time *tm)

I think "static" will lose, especially since ...


> +EXPORT_SYMBOL(rtc_systohc);

... you want other code to call it. 

  reply	other threads:[~2008-11-10 22:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-10 15:40 [RFC PATCH] rtc: add rtc_systohc for ntp use Alessandro Zummo
2008-11-10 22:57 ` David Brownell [this message]
2008-11-10 23:05   ` Alessandro Zummo
2008-11-11 14:10 ` David Woodhouse
2008-11-11 17:17   ` Gabriel Paubert
2008-11-11 18:11   ` [rtc-linux] " Alessandro Zummo
2008-11-11 20:58   ` David Brownell
2008-11-12  8:05     ` 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=200811101457.29051.david-b@pacbell.net \
    --to=david-b@pacbell$(echo .)net \
    --cc=a.zummo@towertech$(echo .)it \
    --cc=dwmw2@infradead$(echo .)org \
    --cc=lethal@linux-sh$(echo .)org \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    --cc=rtc-linux@googlegroups$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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