summaryrefslogtreecommitdiff
path: root/sys/dev/pv/hyperv.c
diff options
context:
space:
mode:
authorcheloha <cheloha@cvs.openbsd.org>2020-12-04 03:22:47 +0000
committercheloha <cheloha@cvs.openbsd.org>2020-12-04 03:22:47 +0000
commit38e111e802d8214ef215961c96a098752f0cabf4 (patch)
tree36f6adc2ea89765a16f9745ed6919f8db0eef15d /sys/dev/pv/hyperv.c
parent1cc276caf4f5b666939e9aa71e25c99f00711477 (diff)
hvn(4), hyperv(4): more tsleep(9) -> tsleep_nsec(9) conversions
Replace all tsleep(..., 1) calls in these drivers with tsleep_nsec(9) calls. In every case we can use the nearby delay(9) intervals as the timeout. Tested by Andre Stoebe <as@nul.space> (Hyper-V on Windows 10). "LGTM" mikeb@, ok mpi@
Diffstat (limited to 'sys/dev/pv/hyperv.c')
-rw-r--r--sys/dev/pv/hyperv.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/dev/pv/hyperv.c b/sys/dev/pv/hyperv.c
index b9ee2feec4c..4a695cc4517 100644
--- a/sys/dev/pv/hyperv.c
+++ b/sys/dev/pv/hyperv.c
@@ -558,8 +558,10 @@ hv_start(struct hv_softc *sc, struct hv_msg *msg)
s = splnet();
hv_intr();
splx(s);
- } else
- tsleep(wchan, PRIBIO, wchan, 1);
+ } else {
+ tsleep_nsec(wchan, PRIBIO, wchan,
+ USEC_TO_NSEC(delays[i]));
+ }
}
if (status != 0) {
printf("%s: posting vmbus message failed with %d\n",
@@ -620,8 +622,10 @@ hv_wait(struct hv_softc *sc, int (*cond)(struct hv_softc *, struct hv_msg *),
s = splnet();
hv_intr();
splx(s);
- } else
- tsleep(wchan, PRIBIO, wmsg ? wmsg : "hvwait", 1);
+ } else {
+ tsleep_nsec(wchan, PRIBIO, wmsg ? wmsg : "hvwait",
+ USEC_TO_NSEC(1000));
+ }
}
}