From 5f6c4afe8826d3df52c69a968c25616858a4b052 Mon Sep 17 00:00:00 2001 From: riastradh Date: Mon, 11 Jul 2022 18:56:00 +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 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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..6471120cb661 100644 --- a/sys/external/bsd/drm2/dist/drm/i915/i915_request.c +++ b/sys/external/bsd/drm2/dist/drm/i915/i915_request.c @@ -1,4 +1,4 @@ -/* $NetBSD: i915_request.c,v 1.16 2021/12/27 13:29:15 riastradh Exp $ */ +/* $NetBSD: i915_request.c,v 1.17 2022/07/11 18:56:00 riastradh Exp $ */ /* * Copyright © 2008-2015 Intel Corporation @@ -25,7 +25,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: i915_request.c,v 1.16 2021/12/27 13:29:15 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i915_request.c,v 1.17 2022/07/11 18:56:00 riastradh Exp $"); #include #include @@ -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_);