Re: [chrony-dev] [PATCH 1/2] New refclock for RTCs |
[ Thread Index |
Date Index
| More chrony.tuxfamily.org/chrony-dev Archives
]
- To: chrony-dev@xxxxxxxxxxxxxxxxxxxx
- Subject: Re: [chrony-dev] [PATCH 1/2] New refclock for RTCs
- From: Miroslav Lichvar <mlichvar@xxxxxxxxxx>
- Date: Thu, 1 Jul 2021 12:43:57 +0200
- Authentication-results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mlichvar@xxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625136241; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kPWJvtl2ddMMsunBxVI0i+7y6uACoU0EjdPbr2goYxY=; b=h8X1MFSae7LuEYdp80k19k6PYt0XwS6hlAPg97bBhrmbJY/hwiu/pz5os5+DPgHt8Aem5W nHotu4+fNt9gapLT/AQZEjXCxLWvow9E1NVu3vJhepydhTEDo96gjD+Yw6aYdBqrd2zaXs Rbx1Zihs3ad/ttcc/J414gvNQrC0/bw=
On Wed, Jun 30, 2021 at 04:47:21PM +0200, Uwe Kleine-König wrote:
> This refclock uses an RTC as reference source. If the RTC doesn't
> support reporting an update event this source is quite coarse as it
> usually needs a slow bus access to be read and has a precision of only
> one second. If reporting an update event is available, the time is read
> just after such an event which improves precision.
Have you considered reusing the existing rtc_linux.c code? I'd prefer
avoid duplicating the code unless there is a good reason for it. If it
needs some refactoring, I think that would be fine.
> if [ $feat_refclock = "1" ]; then
> add_def FEAT_REFCLOCK
> - EXTRA_OBJECTS="$EXTRA_OBJECTS refclock.o refclock_phc.o refclock_pps.o refclock_shm.o refclock_sock.o"
> + EXTRA_OBJECTS="$EXTRA_OBJECTS refclock.o refclock_phc.o refclock_pps.o refclock_shm.o refclock_sock.o refclock_rtc.o"
> fi
I think this needs to be conditioned on Linux and also the RTC support
if its code will be reused.
> +
> +static int refrtc_initialise(RCL_Instance instance) {
Just a nit. Please follow the coding style of the existing code.
--
Miroslav Lichvar
--
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble? Email listmaster@xxxxxxxxxxxxxxxxxxxx.