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