From c1bf30f58d23c7ebf294f5c1ea878b69d48eae4d Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Mon, 11 Jul 2022 18:45:18 +0000 Subject: [PATCH] i915: Defer destroying waitqueue until after callback is removed. Candidate fix for PR kern/56561. --- sys/external/bsd/drm2/dist/drm/i915/i915_request.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/external/bsd/drm2/dist/drm/i915/i915_request.c b/sys/external/bsd/drm2/dist/drm/i915/i915_request.c index e5d1cee76800..066c71a727a3 100644 --- a/sys/external/bsd/drm2/dist/drm/i915/i915_request.c +++ b/sys/external/bsd/drm2/dist/drm/i915/i915_request.c @@ -1630,7 +1630,6 @@ long i915_request_wait(struct i915_request *rq, timeout = -ETIME; } spin_unlock(rq->fence.lock); - DRM_DESTROY_WAITQUEUE(&wait.wq); #else for (;;) { set_current_state(state); @@ -1657,6 +1656,9 @@ long i915_request_wait(struct i915_request *rq, #endif dma_fence_remove_callback(&rq->fence, &wait.cb); +#ifdef __NetBSD__ + DRM_DESTROY_WAITQUEUE(&wait.wq); +#endif out: mutex_release(&rq->engine->gt->reset.mutex.dep_map, _THIS_IP_);