linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Richter <Simon.Richter@hogyros.de>
To: Alessandro Zummo <azummo-lists@towertech.it>
Cc: linuxppc-dev@ozlabs.org, linuxppc-embedded@ozlabs.org,
	lm-sensors@lm-sensors.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC] RTC subsystem
Date: Thu, 22 Dec 2005 00:18:33 +0100	[thread overview]
Message-ID: <43A9E2C9.7080300@hogyros.de> (raw)
In-Reply-To: <20051221184122.5253df01@inspiron>

[-- Attachment #1: Type: text/plain, Size: 1764 bytes --]

Hello,

Alessandro Zummo schrieb:

>>It would be good to have a way to change which clock is the "primary" 
>>one from userspace later (userspace because this is clearly site policy).

>  If I'm not wrong, the RTC is usually queried at bootup
>  and written to on shutdown. If NTP mode is active, 
>  it is also written every 11 minutes.

A good ntpd will adjust the speed rather than write to the clock; the
ntpd shipped by most distributions can already handle multiple time sources.

I'm thinking of the case where a computer is not attached to a network
but needs accurate tim; in this case I'd give it a battery powered RTC
and a time signal receiver. As most time signals are low-bandwidth, they
may not carry full time information in each tick so it may take several
minutes to fully synchronize. In this case I'd like to use the battery
backed up clock first and switch later on when synchronized.

>  I guess /proc/driver/rtc will be deprecated sooner or
>  later. The /dev/rtc interface only supports one clock.
>  It can either be extended to have /dev/rtcX or we
>  can extend the sysfs one to allow clock updating.

/dev is the way to go IMO. As far as I've understood sysfs, it carries
meta information about devices and drivers only, the actual
communication then happens through device nodes still.

>  NTP mode could then be adjusted to update one or more
>  of the rtcs. Maybe each RTC could have an attribute
>  (let's say /sys/class/rtc/rtcX/ntp) which tells the
>  kernel whether to update it or not.

That's entirely a userspace thing. What the userspace needs to know from
the kernel is whether the clock is writable and whether its speed can be
adjusted.

>  -EPERM ? -EACCESS? :)

-EIO or -ENOSYS would also be possible options.

   Simon

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 374 bytes --]

  reply	other threads:[~2005-12-21 23:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20051220220022.4e9ff931@inspiron>
     [not found] ` <43A94811.4010704@hogyros.de>
     [not found]   ` <20051221160712.2d322f42@inspiron>
     [not found]     ` <43A97CAF.50301@hogyros.de>
2005-12-21 17:41       ` [RFC] RTC subsystem Alessandro Zummo
2005-12-21 23:18         ` Simon Richter [this message]
2005-12-22  6:48           ` Alessandro Zummo

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=43A9E2C9.7080300@hogyros.de \
    --to=simon.richter@hogyros.de \
    --cc=azummo-lists@towertech.it \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=linuxppc-embedded@ozlabs.org \
    --cc=lm-sensors@lm-sensors.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).