Module Name: src
Committed By: riastradh
Date: Mon Feb 14 20:37:51 UTC 2022
Modified Files:
src/sys/external/bsd/drm2/dist/drm/i915: i915_active.c
Log Message:
i915: Defer final wakeup on active until after retirement.
Not sure what I was thinking when I moved this earlier!
To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 \
src/sys/external/bsd/drm2/dist/drm/i915/i915_active.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/external/bsd/drm2/dist/drm/i915/i915_active.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/i915_active.c:1.10 src/sys/external/bsd/drm2/dist/drm/i915/i915_active.c:1.11
--- src/sys/external/bsd/drm2/dist/drm/i915/i915_active.c:1.10 Fri Dec 24 00:14:03 2021
+++ src/sys/external/bsd/drm2/dist/drm/i915/i915_active.c Mon Feb 14 20:37:51 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: i915_active.c,v 1.10 2021/12/24 00:14:03 riastradh Exp $ */
+/* $NetBSD: i915_active.c,v 1.11 2022/02/14 20:37:51 riastradh Exp $ */
/*
* SPDX-License-Identifier: MIT
@@ -7,7 +7,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_active.c,v 1.10 2021/12/24 00:14:03 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_active.c,v 1.11 2022/02/14 20:37:51 riastradh Exp $");
#include <linux/debugobjects.h>
@@ -195,8 +195,6 @@ __active_retire(struct i915_active *ref)
#endif
ref->cache = NULL;
- DRM_SPIN_WAKEUP_ALL(&ref->tree_wq, &ref->tree_lock);
-
spin_unlock_irqrestore(&ref->tree_lock, flags);
/* After the final retire, the entire struct may be freed */
@@ -204,6 +202,9 @@ __active_retire(struct i915_active *ref)
ref->retire(ref);
/* ... except if you wait on it, you must manage your own references! */
+ spin_lock(&ref->tree_lock);
+ DRM_SPIN_WAKEUP_ALL(&ref->tree_wq, &ref->tree_lock);
+ spin_unlock(&ref->tree_lock);
rbtree_postorder_for_each_entry_safe(it, n, &root, node) {
GEM_BUG_ON(i915_active_fence_isset(&it->base));