Patch works.

hw.sensors.vmt0.timedelta0=0.000109 secs, OK, Thu Dec 17 09:29:31.932


Dec 17 09:29:19 ianm-openbsd ntpd[882]: ntp engine ready
Dec 17 09:29:20 ianm-openbsd ntpd[5528]: set local clock to Thu Dec 17 09:29:20 
AEDT 2015 (offset 0.937695s)
Dec 17 09:29:20 ianm-openbsd savecore: no core dump
Dec 17 09:29:21 ianm-openbsd apmd: battery status: absent. external power 
status: connected. estimated battery life 0%
Dec 17 09:29:22 ianm-openbsd ntpd[882]: constraint reply from 216.58.220.132: 
offset -0.635569
Dec 17 09:29:42 ianm-openbsd ntpd[882]: peer 129.250.35.251 now valid
Dec 17 09:29:43 ianm-openbsd ntpd[882]: peer 121.0.0.42 now valid
Dec 17 09:29:43 ianm-openbsd ntpd[882]: peer 121.0.0.41 now valid
Dec 17 09:29:48 ianm-openbsd ntpd[882]: peer 202.127.210.36 now valid
Dec 17 09:30:47 ianm-openbsd ntpd[12574]: adjusting local clock by 0.054113s

I'll keep an eye out for any further issues.

Thanks.

Ian McWilliam

________________________________________
From: Martin Pieuchot [m...@openbsd.org]
Sent: Thursday, 17 December 2015 1:31 AM
To: Mike Belopuhov
Cc: Ian Mcwilliam; tech@openbsd.org
Subject: Re: ntpd setting date incorrectly

On 16/12/15(Wed) 14:56, Mike Belopuhov wrote:
> On Wed, Dec 16, 2015 at 03:53 +0000, Ian Mcwilliam wrote:
> >
> > Disable sensors * in ntpd.conf and time is good again.
> >
> > I see this on boot up when things go strange.
> >
> > hw.sensors.vmt0.timedelta0=1450237689.498077 secs, OK, Tue Nov 29 
> > 18:36:38.371
> >
> > I wonder if it's related to this change? Thoughts?
> >
>
> Bah, I've noticed that, but forgot to mention this to mpi@.
> Martin, what has prompted you to change the behaviour here?
> It's the only spot in that commit that has changed the
> mountroot to a startup hook.

Because this driver is using the same function for a hook and a timer,
both taking (void *) pointer.

I don't understand for which reason this driver is using a hook, but
tell me if this works.

Index: dev/pv/vmt.c
===================================================================
RCS file: /cvs/src/sys/dev/pv/vmt.c,v
retrieving revision 1.6
diff -u -p -r1.6 vmt.c
--- dev/pv/vmt.c        11 Dec 2015 16:07:01 -0000      1.6
+++ dev/pv/vmt.c        16 Dec 2015 14:29:54 -0000
@@ -208,6 +208,7 @@ void         vmt_shutdown(void *);
 void    vmt_update_guest_info(struct vmt_softc *);
 void    vmt_update_guest_uptime(struct vmt_softc *);

+void    vmt_tick_hook(struct device *self);
 void    vmt_tick(void *);
 void    vmt_resume(void);

@@ -364,9 +365,7 @@ vmt_attach(struct device *parent, struct
        sensor_attach(&sc->sc_sensordev, &sc->sc_sensor);
        sensordev_install(&sc->sc_sensordev);

-       timeout_set(&sc->sc_tick, vmt_tick, sc);
-       if (startuphook_establish(vmt_tick, sc) == NULL)
-               DPRINTF("%s: unable to establish tick\n", DEVNAME(sc));
+       config_mountroot(self, vmt_tick_hook);

        timeout_set(&sc->sc_tclo_tick, vmt_tclo_tick, sc);
        timeout_add_sec(&sc->sc_tclo_tick, 1);
@@ -467,6 +466,15 @@ vmt_update_guest_info(struct vmt_softc *

                sc->sc_set_guest_os = 1;
        }
+}
+
+void
+vmt_tick_hook(struct device *self)
+{
+       struct vmt_softc *sc = (struct vmt_softc *)self;
+
+       timeout_set(&sc->sc_tick, vmt_tick, sc);
+       vmt_tick(sc);
 }

 void

Reply via email to