From: jgunthorpe@obsidianresearch.com (Jason Gunthorpe)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] NTP: Add a CONFIG_RTC_SYSTOHC configuration
Date: Wed, 12 Dec 2012 22:21:32 -0700 [thread overview]
Message-ID: <20121213052132.GA19577@obsidianresearch.com> (raw)
In-Reply-To: <50C91ED7.5050905@linaro.org>
On Wed, Dec 12, 2012 at 04:18:31PM -0800, John Stultz wrote:
> I do, although again, in the case where the arch specific
> implementation is "better", we end up losing granularity (s390 is
> the specific example I'm thinking of), since this prefers the RTC
> implementation over the arch specific one. So maybe I'd suggest
> switching it so we prefer the arch specific one, and then remove the
> arch specific implementations where they are inferior to the RTC
> one.
Unfortunately I put rtc_update_persistent_clock first because it can
have sensible error reporting. update_persistent_clock will return 0
if there is no RTC device available, or if the RTC was successfully
updated.
I can make rtc_update_persistent_clock return -ENODEV.
> As long as we have a clear iterative path forward, with a solution
> for the cases where the arch method is actually preferred, I think
> it sounds like a reasonable approach.
I think it is fine to leave it as a configure option, archs can
default it to yes when it is appropriate for them.
A quick scan through the 3.7 tree for update_persistent_clock::
alpha - single non class RTC clock scheme
cris - printk's and does nothing
mips - weak function rtc_mips_set_time, all implementations are
non class rtc
mn10300 - single non class RTC clock scheme
powerpc - indirects through ppc_md.set_rtc_time, all implementations
do not use class RTC
sh - indirects through rtc_sh_set_time, two implementations, neither
use class RTC
sparc - Seems to be class rtc converted. Already implements this
patch's functionality in an arch specific file
x86 - All the functions under the set_wallclock indirection seem
to be non class RTC cases
No other arches seem to have update_persistent_clock in them.
I think the s390 functionality you are refering to is in its
read_persistant_clock, which looks like it has ns resolution.
That is also fine because s390 does not use class rtc so there is no
duplicate path to the 'tod' code either through
rtc_update_persistent_clock or through rtc_hctosys.
Basically, as far as I can tell, if rtc_update_persistent_clock
succeeds then update_persistent_clock is a nop. I can't find any case
where *both* could succeed. Thus trying rtc_update_persistent_clock
first is OK.
Jason
next prev parent reply other threads:[~2012-12-13 5:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-12 5:56 [PATCH] NTP: Add a CONFIG_RTC_SYSTOHC configuration Jason Gunthorpe
2012-12-12 19:40 ` John Stultz
2012-12-12 21:04 ` Jason Gunthorpe
2012-12-13 0:18 ` John Stultz
2012-12-13 5:21 ` Jason Gunthorpe [this message]
2012-12-14 1:29 ` John Stultz
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=20121213052132.GA19577@obsidianresearch.com \
--to=jgunthorpe@obsidianresearch.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).