summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/drm/drm_linux.c
diff options
context:
space:
mode:
authorjsg <jsg@openbsd.org>2021-02-14 03:42:55 +0000
committerjsg <jsg@openbsd.org>2021-02-14 03:42:55 +0000
commit15e28df90169d92731a148fca7d948f804296fe6 (patch)
tree7c1305460e6af898e6d6f1bba395c4cecb0fb652 /sys/dev/pci/drm/drm_linux.c
parentCleanup lldb amd64 support. (diff)
downloadwireguard-openbsd-15e28df90169d92731a148fca7d948f804296fe6.tar.xz
wireguard-openbsd-15e28df90169d92731a148fca7d948f804296fe6.zip
correct drm work flush behaviour
Don't set taskq to system_wq in INIT_WORK(). Test if taskq pointer is non-NULL before calling taskq_barrier() in flush functions. fixes a black screen on boot problem with 5.10.y drm using nano x1 bisected by jcs@ to 'drm/i915: Always flush the active worker before returning from the wait'
Diffstat (limited to 'sys/dev/pci/drm/drm_linux.c')
-rw-r--r--sys/dev/pci/drm/drm_linux.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/dev/pci/drm/drm_linux.c b/sys/dev/pci/drm/drm_linux.c
index d400d72ebc9..1fc4db15c86 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.77 2021/02/08 08:18:45 mpi Exp $ */
+/* $OpenBSD: drm_linux.c,v 1.78 2021/02/14 03:42:55 jsg Exp $ */
/*
* Copyright (c) 2013 Jonathan Gray <jsg@openbsd.org>
* Copyright (c) 2015, 2016 Mark Kettenis <kettenis@openbsd.org>
@@ -158,7 +158,8 @@ flush_workqueue(struct workqueue_struct *wq)
if (cold)
return;
- taskq_barrier((struct taskq *)wq);
+ if (wq)
+ taskq_barrier((struct taskq *)wq);
}
bool
@@ -167,7 +168,8 @@ flush_work(struct work_struct *work)
if (cold)
return false;
- taskq_barrier(work->tq);
+ if (work->tq)
+ taskq_barrier(work->tq);
return false;
}
@@ -184,7 +186,8 @@ flush_delayed_work(struct delayed_work *dwork)
ret = true;
}
- taskq_barrier(dwork->tq ? dwork->tq : (struct taskq *)system_wq);
+ if (dwork->tq)
+ taskq_barrier(dwork->tq);
return ret;
}