diff --git a/sys/dev/hyperv/hvkbd.c b/sys/dev/hyperv/hvkbd.c index 032ca3992b5f..e87b447744c4 100644 --- a/sys/dev/hyperv/hvkbd.c +++ b/sys/dev/hyperv/hvkbd.c @@ -1,4 +1,4 @@ -/* $NetBSD: hvkbd.c,v 1.2.2.1 2019/11/16 16:51:45 martin Exp $ */ +/* $NetBSD: hvkbd.c,v 1.2.2.2 2019/11/24 08:13:07 martin Exp $ */ /*- * Copyright (c) 2017 Microsoft Corp. @@ -36,7 +36,7 @@ #endif /* _KERNEL_OPT */ #include -__KERNEL_RCSID(0, "$NetBSD: hvkbd.c,v 1.2.2.1 2019/11/16 16:51:45 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hvkbd.c,v 1.2.2.2 2019/11/24 08:13:07 martin Exp $"); #include #include @@ -359,13 +359,13 @@ hvkbd_connect(struct hvkbd_softc *sc) } do { - if (cold) + if (cold) { delay(1000); - else - tsleep(sc, PRIBIO | PCATCH, "hvkbdcon", 1); - s = spltty(); - hvkbd_intr(sc); - splx(s); + s = spltty(); + hvkbd_intr(sc); + splx(s); + } else + tsleep(sc, PRIBIO | PCATCH, "hvkbdcon", mstohz(1)); } while (--timo > 0 && sc->sc_connected == 0); if (timo == 0 && sc->sc_connected == 0) { diff --git a/sys/dev/hyperv/if_hvn.c b/sys/dev/hyperv/if_hvn.c index 92672f7e9d16..5f23e734a316 100644 --- a/sys/dev/hyperv/if_hvn.c +++ b/sys/dev/hyperv/if_hvn.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_hvn.c,v 1.4.2.2 2019/11/18 19:46:33 martin Exp $ */ +/* $NetBSD: if_hvn.c,v 1.4.2.3 2019/11/24 08:13:07 martin Exp $ */ /* $OpenBSD: if_hvn.c,v 1.39 2018/03/11 14:31:34 mikeb Exp $ */ /*- @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_hvn.c,v 1.4.2.2 2019/11/18 19:46:33 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_hvn.c,v 1.4.2.3 2019/11/24 08:13:07 martin Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -1069,7 +1069,7 @@ hvn_nvs_cmd(struct hvn_softc *sc, void *cmd, size_t cmdsize, uint64_t tid, if (cold) delay(1000); else - tsleep(cmd, PRIBIO, "nvsout", 1); + tsleep(cmd, PRIBIO, "nvsout", mstohz(1)); } else if (rv) { DPRINTF("%s: NVSP operation %u send error %d\n", device_xname(sc->sc_dev), hdr->nvs_type, rv); @@ -1087,13 +1087,13 @@ hvn_nvs_cmd(struct hvn_softc *sc, void *cmd, size_t cmdsize, uint64_t tid, return 0; do { - if (cold) + if (cold) { delay(1000); - else - tsleep(sc, PRIBIO | PCATCH, "nvscmd", 1); - s = splnet(); - hvn_nvs_intr(sc); - splx(s); + s = splnet(); + hvn_nvs_intr(sc); + splx(s); + } else + tsleep(sc, PRIBIO | PCATCH, "nvscmd", mstohz(1)); } while (--timo > 0 && sc->sc_nvsdone != 1); if (timo == 0 && sc->sc_nvsdone != 1) { @@ -1391,7 +1391,7 @@ hvn_rndis_cmd(struct hvn_softc *sc, struct rndis_cmd *rc, int timo) if (cold) delay(1000); else - tsleep(rc, PRIBIO, "rndisout", 1); + tsleep(rc, PRIBIO, "rndisout", mstohz(1)); } else if (rv) { DPRINTF("%s: RNDIS operation %u send error %d\n", device_xname(sc->sc_dev), hdr->rm_type, rv); @@ -1410,13 +1410,13 @@ hvn_rndis_cmd(struct hvn_softc *sc, struct rndis_cmd *rc, int timo) BUS_DMASYNC_POSTWRITE); do { - if (cold) + if (cold) { delay(1000); - else - tsleep(rc, PRIBIO | PCATCH, "rndiscmd", 1); - s = splnet(); - hvn_nvs_intr(sc); - splx(s); + s = splnet(); + hvn_nvs_intr(sc); + splx(s); + } else + tsleep(rc, PRIBIO | PCATCH, "rndiscmd", mstohz(1)); } while (--timo > 0 && rc->rc_done != 1); bus_dmamap_sync(sc->sc_dmat, rc->rc_dmap, 0, PAGE_SIZE, diff --git a/sys/dev/hyperv/vmbus.c b/sys/dev/hyperv/vmbus.c index 7a91b79a923b..6c15601b6a1a 100644 --- a/sys/dev/hyperv/vmbus.c +++ b/sys/dev/hyperv/vmbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: vmbus.c,v 1.4 2019/07/09 10:07:11 nakayama Exp $ */ +/* $NetBSD: vmbus.c,v 1.4.2.1 2019/11/24 08:13:07 martin Exp $ */ /* $OpenBSD: hyperv.c,v 1.43 2017/06/27 13:56:15 mikeb Exp $ */ /*- @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vmbus.c,v 1.4 2019/07/09 10:07:11 nakayama Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vmbus.c,v 1.4.2.1 2019/11/24 08:13:07 martin Exp $"); #include #include @@ -604,7 +604,7 @@ vmbus_start(struct vmbus_softc *sc, struct vmbus_msg *msg, paddr_t msg_pa) hyperv_intr(); splx(s); } else - tsleep(wchan, PRIBIO, wchan, 1); + tsleep(wchan, PRIBIO, wchan, mstohz(delays[i])); } if (status != HYPERCALL_STATUS_SUCCESS) { device_printf(sc->sc_dev, @@ -666,7 +666,8 @@ vmbus_wait(struct vmbus_softc *sc, hyperv_intr(); splx(s); } else - tsleep(wchan, PRIBIO, wmsg ? wmsg : "hvwait", 1); + tsleep(wchan, PRIBIO, wmsg ? wmsg : "hvwait", + mstohz(1)); } }