summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2019-12-30 09:30:31 +0000
committermpi <mpi@openbsd.org>2019-12-30 09:30:31 +0000
commitd18c2ae1c940b3e1fdee72c298d4f86fa1259cf3 (patch)
tree363ce2dfa17ffbdb9f1852dcd86953fad59e9372
parentdocument SK API changes in PROTOCOL.u2f (diff)
downloadwireguard-openbsd-d18c2ae1c940b3e1fdee72c298d4f86fa1259cf3.tar.xz
wireguard-openbsd-d18c2ae1c940b3e1fdee72c298d4f86fa1259cf3.zip
Convert infinite sleeps to {m,t}sleep_nsec(9).
ok jsg@
-rw-r--r--sys/dev/pci/drm/drm_ioctl.c3
-rw-r--r--sys/dev/pci/drm/drm_linux.c11
-rw-r--r--sys/dev/pci/drm/include/linux/completion.h4
3 files changed, 10 insertions, 8 deletions
diff --git a/sys/dev/pci/drm/drm_ioctl.c b/sys/dev/pci/drm/drm_ioctl.c
index 3ae87cbcb66..822cd0da39f 100644
--- a/sys/dev/pci/drm/drm_ioctl.c
+++ b/sys/dev/pci/drm/drm_ioctl.c
@@ -781,7 +781,8 @@ drmioctl(dev_t kdev, u_long cmd, caddr_t data, int flags, struct proc *p)
mtx_enter(&dev->quiesce_mtx);
while (dev->quiesce)
- msleep(&dev->quiesce, &dev->quiesce_mtx, PZERO, "drmioc", 0);
+ msleep_nsec(&dev->quiesce, &dev->quiesce_mtx, PZERO, "drmioc",
+ INFSLP);
dev->quiesce_count++;
mtx_leave(&dev->quiesce_mtx);
diff --git a/sys/dev/pci/drm/drm_linux.c b/sys/dev/pci/drm/drm_linux.c
index 6f262875c3b..fe67f33f7dd 100644
--- a/sys/dev/pci/drm/drm_linux.c
+++ b/sys/dev/pci/drm/drm_linux.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: drm_linux.c,v 1.53 2019/12/26 13:36:15 jsg Exp $ */
+/* $OpenBSD: drm_linux.c,v 1.54 2019/12/30 09:30:31 mpi Exp $ */
/*
* Copyright (c) 2013 Jonathan Gray <jsg@openbsd.org>
* Copyright (c) 2015, 2016 Mark Kettenis <kettenis@openbsd.org>
@@ -240,7 +240,7 @@ kthread_parkme(void)
while (thread->flags & KTHREAD_SHOULDPARK) {
thread->flags |= KTHREAD_PARKED;
wakeup(thread);
- tsleep(thread, PPAUSE | PCATCH, "parkme", 0);
+ tsleep_nsec(thread, PPAUSE | PCATCH, "parkme", INFSLP);
thread->flags &= ~KTHREAD_PARKED;
}
}
@@ -253,7 +253,7 @@ kthread_park(struct proc *p)
while ((thread->flags & KTHREAD_PARKED) == 0) {
thread->flags |= KTHREAD_SHOULDPARK;
wake_up_process(thread->proc);
- tsleep(thread, PPAUSE | PCATCH, "park", 0);
+ tsleep_nsec(thread, PPAUSE | PCATCH, "park", INFSLP);
}
}
@@ -281,7 +281,7 @@ kthread_stop(struct proc *p)
while ((thread->flags & KTHREAD_STOPPED) == 0) {
thread->flags |= KTHREAD_SHOULDSTOP;
wake_up_process(thread->proc);
- tsleep(thread, PPAUSE | PCATCH, "stop", 0);
+ tsleep_nsec(thread, PPAUSE | PCATCH, "stop", INFSLP);
}
LIST_REMOVE(thread, next);
free(thread, M_DRM, sizeof(*thread));
@@ -1752,7 +1752,8 @@ wait_on_bit(unsigned long *word, int bit, unsigned mode)
mtx_enter(&wait_bit_mtx);
while (test_bit(bit, word)) {
- err = msleep(word, &wait_bit_mtx, PWAIT | mode, "wtb", 0);
+ err = msleep_nsec(word, &wait_bit_mtx, PWAIT | mode, "wtb",
+ INFSLP);
if (err) {
mtx_leave(&wait_bit_mtx);
return 1;
diff --git a/sys/dev/pci/drm/include/linux/completion.h b/sys/dev/pci/drm/include/linux/completion.h
index ac8a9dc0826..0fb61e8c288 100644
--- a/sys/dev/pci/drm/include/linux/completion.h
+++ b/sys/dev/pci/drm/include/linux/completion.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: completion.h,v 1.2 2019/04/23 13:35:12 visa Exp $ */
+/* $OpenBSD: completion.h,v 1.3 2019/12/30 09:30:31 mpi Exp $ */
/*
* Copyright (c) 2015, 2018 Mark Kettenis
*
@@ -65,7 +65,7 @@ wait_for_completion_interruptible(struct completion *x)
mtx_enter(&x->wait.lock);
while (x->done == 0) {
- ret = msleep(x, &x->wait.lock, PCATCH, "wfci", 0);
+ ret = msleep_nsec(x, &x->wait.lock, PCATCH, "wfci", INFSLP);
if (ret) {
mtx_leave(&x->wait.lock);
return (ret == EWOULDBLOCK) ? 0 : -ret;