i915: Defer final wakeup on active until after retirement.

Not sure what I was thinking when I moved this earlier!
This commit is contained in:
riastradh 2022-02-14 20:37:51 +00:00
parent 156f34a979
commit cfc2c8b7ba
1 changed files with 5 additions and 4 deletions

View File

@ -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));