All of lore.kernel.org
 help / color / mirror / Atom feed
From: linux@armlinux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: On NTP, RTCs and accurately setting their time
Date: Thu, 21 Sep 2017 13:28:53 +0100	[thread overview]
Message-ID: <20170921122852.GX20805@n2100.armlinux.org.uk> (raw)
In-Reply-To: <20170920224522.GB20974@obsidianresearch.com>

On Wed, Sep 20, 2017 at 04:45:22PM -0600, Jason Gunthorpe wrote:
> What do you think of this untested approach in the below patch?

There's another issue.

Most drivers use rtc_device_register() or devm_rtc_device_register()
rather than rtc_allocate_device() (which is static.)  This does not
give RTC drivers a chance to set rtc->time_set_nsec before the
RTC is registered with the kernel.

Setting it after the device has been registered is racy.  So, having
this member in struct rtc_device and assuming that drivers will override
the value doesn't work.

It doesn't make sense to put it in rtc_class_ops as it isn't an
operation, but we could add a callback in there which is used during
initialisation but before registration which could be used to set this
member.

Thoughts?

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up

  parent reply	other threads:[~2017-09-21 12:28 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-20 11:21 On NTP, RTCs and accurately setting their time Russell King - ARM Linux
2017-09-20 13:23 ` Russell King - ARM Linux
2017-09-20 16:22 ` Jason Gunthorpe
2017-09-20 16:51   ` Russell King - ARM Linux
2017-09-20 17:16     ` Jason Gunthorpe
2017-09-20 22:45     ` Jason Gunthorpe
2017-09-21  7:59       ` Russell King - ARM Linux
2017-09-21  9:32         ` Russell King - ARM Linux
2017-09-21 11:30           ` Russell King - ARM Linux
2017-09-21 22:05           ` Jason Gunthorpe
2017-09-21 22:45             ` Russell King - ARM Linux
2017-09-21 23:20               ` Jason Gunthorpe
2017-09-22  9:57                 ` Russell King - ARM Linux
2017-09-22 12:24                   ` Russell King - ARM Linux
2017-09-22 16:28                     ` Russell King - ARM Linux
2017-09-22 16:48                   ` Jason Gunthorpe
2017-09-22 17:20                     ` Russell King - ARM Linux
2017-09-22 18:24                       ` Jason Gunthorpe
2017-09-23 18:23                         ` Russell King - ARM Linux
2017-09-23 19:05                           ` Russell King - ARM Linux
2017-09-24  1:30                           ` Jason Gunthorpe
2017-09-21  9:46       ` Russell King - ARM Linux
2017-09-21 11:29       ` Russell King - ARM Linux
2017-09-21 12:28       ` Russell King - ARM Linux [this message]
2017-09-26 11:58         ` Alexandre Belloni

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=20170921122852.GX20805@n2100.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.