Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/dist/drm/i915 i915: Fix wakeref destru...



details:   https://anonhg.NetBSD.org/src/rev/bb3f96016128
branches:  trunk
changeset: 1028951:bb3f96016128
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 12:33:56 2021 +0000

description:
i915: Fix wakeref destruction.

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/gt/intel_engine_cs.c |   5 +++--
 sys/external/bsd/drm2/dist/drm/i915/gt/intel_engine_pm.c |  11 +++++++++--
 sys/external/bsd/drm2/dist/drm/i915/gt/intel_engine_pm.h |   3 ++-
 sys/external/bsd/drm2/dist/drm/i915/gt/intel_gt_pm.c     |   5 +++--
 sys/external/bsd/drm2/dist/drm/i915/intel_wakeref.c      |  14 ++++++++++----
 sys/external/bsd/drm2/dist/drm/i915/intel_wakeref.h      |   4 +++-
 6 files changed, 30 insertions(+), 12 deletions(-)

diffs (160 lines):

diff -r 1877f9fd5b83 -r bb3f96016128 sys/external/bsd/drm2/dist/drm/i915/gt/intel_engine_cs.c
--- a/sys/external/bsd/drm2/dist/drm/i915/gt/intel_engine_cs.c  Sun Dec 19 12:33:48 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/gt/intel_engine_cs.c  Sun Dec 19 12:33:56 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intel_engine_cs.c,v 1.7 2021/12/19 12:32:15 riastradh Exp $    */
+/*     $NetBSD: intel_engine_cs.c,v 1.8 2021/12/19 12:33:56 riastradh Exp $    */
 
 /*
  * Copyright © 2016 Intel Corporation
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intel_engine_cs.c,v 1.7 2021/12/19 12:32:15 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_engine_cs.c,v 1.8 2021/12/19 12:33:56 riastradh Exp $");
 
 #include <drm/drm_print.h>
 
@@ -812,6 +812,7 @@
        cleanup_status_page(engine);
 
        intel_engine_fini_retire(engine);
+       intel_engine_fini__pm(engine);
        intel_engine_pool_fini(&engine->pool);
        intel_engine_fini_breadcrumbs(engine);
        intel_engine_cleanup_cmd_parser(engine);
diff -r 1877f9fd5b83 -r bb3f96016128 sys/external/bsd/drm2/dist/drm/i915/gt/intel_engine_pm.c
--- a/sys/external/bsd/drm2/dist/drm/i915/gt/intel_engine_pm.c  Sun Dec 19 12:33:48 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/gt/intel_engine_pm.c  Sun Dec 19 12:33:56 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intel_engine_pm.c,v 1.3 2021/12/19 11:52:07 riastradh Exp $    */
+/*     $NetBSD: intel_engine_pm.c,v 1.4 2021/12/19 12:33:56 riastradh Exp $    */
 
 /*
  * SPDX-License-Identifier: MIT
@@ -7,7 +7,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intel_engine_pm.c,v 1.3 2021/12/19 11:52:07 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_engine_pm.c,v 1.4 2021/12/19 12:33:56 riastradh Exp $");
 
 #include "i915_drv.h"
 
@@ -292,6 +292,13 @@
        intel_engine_init_heartbeat(engine);
 }
 
+void
+intel_engine_fini__pm(struct intel_engine_cs *engine)
+{
+
+       intel_wakeref_fini(&engine->wakeref);
+}
+
 #if IS_ENABLED(CONFIG_DRM_I915_SELFTEST)
 #include "selftest_engine_pm.c"
 #endif
diff -r 1877f9fd5b83 -r bb3f96016128 sys/external/bsd/drm2/dist/drm/i915/gt/intel_engine_pm.h
--- a/sys/external/bsd/drm2/dist/drm/i915/gt/intel_engine_pm.h  Sun Dec 19 12:33:48 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/gt/intel_engine_pm.h  Sun Dec 19 12:33:56 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intel_engine_pm.h,v 1.2 2021/12/18 23:45:30 riastradh Exp $    */
+/*     $NetBSD: intel_engine_pm.h,v 1.3 2021/12/19 12:33:56 riastradh Exp $    */
 
 /*
  * SPDX-License-Identifier: MIT
@@ -65,5 +65,6 @@
 }
 
 void intel_engine_init__pm(struct intel_engine_cs *engine);
+void intel_engine_fini__pm(struct intel_engine_cs *engine);
 
 #endif /* INTEL_ENGINE_PM_H */
diff -r 1877f9fd5b83 -r bb3f96016128 sys/external/bsd/drm2/dist/drm/i915/gt/intel_gt_pm.c
--- a/sys/external/bsd/drm2/dist/drm/i915/gt/intel_gt_pm.c      Sun Dec 19 12:33:48 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/gt/intel_gt_pm.c      Sun Dec 19 12:33:56 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intel_gt_pm.c,v 1.4 2021/12/19 12:32:15 riastradh Exp $        */
+/*     $NetBSD: intel_gt_pm.c,v 1.5 2021/12/19 12:33:56 riastradh Exp $        */
 
 /*
  * SPDX-License-Identifier: MIT
@@ -7,7 +7,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intel_gt_pm.c,v 1.4 2021/12/19 12:32:15 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_gt_pm.c,v 1.5 2021/12/19 12:33:56 riastradh Exp $");
 
 #include <linux/suspend.h>
 
@@ -177,6 +177,7 @@
 {
        intel_rps_fini(&gt->rps);
        intel_rc6_fini(&gt->rc6);
+       intel_wakeref_fini(&gt->wakeref);
 }
 
 int intel_gt_resume(struct intel_gt *gt)
diff -r 1877f9fd5b83 -r bb3f96016128 sys/external/bsd/drm2/dist/drm/i915/intel_wakeref.c
--- a/sys/external/bsd/drm2/dist/drm/i915/intel_wakeref.c       Sun Dec 19 12:33:48 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/intel_wakeref.c       Sun Dec 19 12:33:56 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intel_wakeref.c,v 1.4 2021/12/19 12:32:15 riastradh Exp $      */
+/*     $NetBSD: intel_wakeref.c,v 1.5 2021/12/19 12:33:57 riastradh Exp $      */
 
 /*
  * SPDX-License-Identifier: MIT
@@ -7,7 +7,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intel_wakeref.c,v 1.4 2021/12/19 12:32:15 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_wakeref.c,v 1.5 2021/12/19 12:33:57 riastradh Exp $");
 
 #include <linux/wait_bit.h>
 
@@ -75,8 +75,6 @@
        }
 
        mutex_unlock(&wf->mutex);
-       DRM_DESTROY_WAITQUEUE(&wf->wq);
-       mutex_destroy(&wf->mutex);
 }
 
 void __intel_wakeref_put_last(struct intel_wakeref *wf, unsigned long flags)
@@ -120,6 +118,14 @@
        lockdep_init_map(&wf->work.lockdep_map, "wakeref.work", &key->work, 0);
 }
 
+void
+intel_wakeref_fini(struct intel_wakeref *wf)
+{
+
+       DRM_DESTROY_WAITQUEUE(&wf->wq);
+       mutex_destroy(&wf->mutex);
+}
+
 int intel_wakeref_wait_for_idle(struct intel_wakeref *wf)
 {
        int err;
diff -r 1877f9fd5b83 -r bb3f96016128 sys/external/bsd/drm2/dist/drm/i915/intel_wakeref.h
--- a/sys/external/bsd/drm2/dist/drm/i915/intel_wakeref.h       Sun Dec 19 12:33:48 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/intel_wakeref.h       Sun Dec 19 12:33:56 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intel_wakeref.h,v 1.3 2021/12/19 11:49:11 riastradh Exp $      */
+/*     $NetBSD: intel_wakeref.h,v 1.4 2021/12/19 12:33:57 riastradh Exp $      */
 
 /*
  * SPDX-License-Identifier: MIT
@@ -64,6 +64,8 @@
        __intel_wakeref_init((wf), (rpm), (ops), &__key);               \
 } while (0)
 
+void intel_wakeref_fini(struct intel_wakeref *);
+
 int __intel_wakeref_get_first(struct intel_wakeref *wf);
 void __intel_wakeref_put_last(struct intel_wakeref *wf, unsigned long flags);
 



Home | Main Index | Thread Index | Old Index