summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/pci/drm/drm_linux.c12
-rw-r--r--sys/dev/pci/drm/include/linux/wait.h14
2 files changed, 3 insertions, 23 deletions
diff --git a/sys/dev/pci/drm/drm_linux.c b/sys/dev/pci/drm/drm_linux.c
index ef138c2175b..ac90dc7db13 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.71 2020/12/10 12:24:06 jsg Exp $ */
+/* $OpenBSD: drm_linux.c,v 1.72 2020/12/13 03:15:52 jsg Exp $ */
/*
* Copyright (c) 2013 Jonathan Gray <jsg@openbsd.org>
* Copyright (c) 2015, 2016 Mark Kettenis <kettenis@openbsd.org>
@@ -1834,20 +1834,12 @@ pcie_get_width_cap(struct pci_dev *pdev)
}
int
-default_wake_function(struct wait_queue_entry *wqe, unsigned int mode,
+autoremove_wake_function(struct wait_queue_entry *wqe, unsigned int mode,
int sync, void *key)
{
wakeup(wqe);
if (wqe->proc)
wake_up_process(wqe->proc);
- return 0;
-}
-
-int
-autoremove_wake_function(struct wait_queue_entry *wqe, unsigned int mode,
- int sync, void *key)
-{
- default_wake_function(wqe, mode, sync, key);
list_del_init(&wqe->entry);
return 0;
}
diff --git a/sys/dev/pci/drm/include/linux/wait.h b/sys/dev/pci/drm/include/linux/wait.h
index 2552c534c68..44b42b4eb66 100644
--- a/sys/dev/pci/drm/include/linux/wait.h
+++ b/sys/dev/pci/drm/include/linux/wait.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: wait.h,v 1.6 2020/12/10 12:24:06 jsg Exp $ */
+/* $OpenBSD: wait.h,v 1.7 2020/12/13 03:15:52 jsg Exp $ */
/*
* Copyright (c) 2013, 2014, 2015 Mark Kettenis
* Copyright (c) 2017 Martin Pieuchot
@@ -44,7 +44,6 @@ extern int sch_priority;
struct wait_queue_head {
struct mutex lock;
- unsigned int count;
struct list_head head;
};
typedef struct wait_queue_head wait_queue_head_t;
@@ -53,13 +52,11 @@ static inline void
init_waitqueue_head(wait_queue_head_t *wqh)
{
mtx_init(&wqh->lock, IPL_TTY);
- wqh->count = 0;
INIT_LIST_HEAD(&wqh->head);
}
#define __init_waitqueue_head(wq, name, key) init_waitqueue_head(wq)
-int default_wake_function(struct wait_queue_entry *, unsigned int, int, void *);
int autoremove_wake_function(struct wait_queue_entry *, unsigned int, int, void *);
static inline void
@@ -118,11 +115,9 @@ remove_wait_queue(wait_queue_head_t *head, wait_queue_entry_t *old)
KASSERT(!cold); \
\
mtx_enter(&sch_mtx); \
- atomic_inc_int(&(wq).count); \
deadline = jiffies + ret; \
__error = msleep(&wq, &sch_mtx, prio, "drmweti", ret); \
ret = deadline - jiffies; \
- atomic_dec_int(&(wq).count); \
if (__error == ERESTART || __error == EINTR) { \
ret = -ERESTARTSYS; \
mtx_leave(&sch_mtx); \
@@ -232,7 +227,6 @@ wake_up_all_locked(wait_queue_head_t *wqh)
}
#define wake_up_interruptible(wq) wake_up(wq)
-#define waitqueue_active(wq) ((wq)->count > 0)
#define DEFINE_WAIT(name) \
struct wait_queue_entry name = { \
@@ -240,12 +234,6 @@ wake_up_all_locked(wait_queue_head_t *wqh)
.func = autoremove_wake_function, \
.entry = LIST_HEAD_INIT((name).entry), \
}
-#define DEFINE_WAIT_FUNC(name, cb) \
- struct wait_queue_entry name = { \
- .private = NULL, \
- .func = cb, \
- .entry = LIST_HEAD_INIT((name).entry), \
- }
static inline void
prepare_to_wait(wait_queue_head_t *wqh, wait_queue_entry_t *wqe, int state)