[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to ensure clock is updated in a device driver



On 5/13/2014 2:58 AM, Andrei POPESCU wrote:
On Lu, 12 mai 14, 16:58:21, Jerry Stuckle wrote:
Hi, all,

I'm working on a driver to monitor a device.  One of the things I need is an
accurate time, and ARM clocks are notoriously subject to drift. Once the
system is booted, that's not a problem as I can use an ntp server in a cron
job to correct the time as necessary.

However, I need the time to be accurate during device driver initialization,
also.  How can I ensure ntp has run to update the system clock during
initialization?

This is probably an obvious solution, but I'll post it anyway: you could
(re)load your driver in an initscript that depends on ntp.

Kind regards,
Andrei


Andrei,

It would be a good solution in many instances, but once everything is working correctly we plan to build everything into a custom kernel. So I need a way to determine when the clock has been updated (or failed, i.e. due to lack of connectivity). I was hoping there was a way to determine that.

But thanks for the suggestion; if we were loading the driver separately it would be a great idea. But even now it's still useful; I guess I could issue an IOCTL call to do the initialization in the initscript.

Jerry


Reply to: