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/display i915: Work aroun...



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

description:
i915: Work around lock order reversal.

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/display/intel_sprite.c |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (56 lines):

diff -r 1344baee5740 -r 94afca62ecba sys/external/bsd/drm2/dist/drm/i915/display/intel_sprite.c
--- a/sys/external/bsd/drm2/dist/drm/i915/display/intel_sprite.c        Sun Dec 19 12:04:26 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/display/intel_sprite.c        Sun Dec 19 12:04:33 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intel_sprite.c,v 1.3 2021/12/19 11:49:11 riastradh Exp $       */
+/*     $NetBSD: intel_sprite.c,v 1.4 2021/12/19 12:04:33 riastradh Exp $       */
 
 /*
  * Copyright © 2011 Intel Corporation
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intel_sprite.c,v 1.3 2021/12/19 11:49:11 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_sprite.c,v 1.4 2021/12/19 12:04:33 riastradh Exp $");
 
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
@@ -121,6 +121,7 @@
                DRM_ERROR("PSR idle timed out 0x%x, atomic update may fail\n",
                          psr_status);
 
+       spin_lock(&crtc->base.dev->event_lock);
        spin_lock(&dev_priv->drm.vbl_lock);
 
        crtc->debug.min_vbl = min;
@@ -162,6 +163,7 @@
        return;
 
 irq_disable:
+       spin_lock(&crtc->base.dev->event_lock);
        spin_lock(&dev_priv->drm.vbl_lock);
 }
 
@@ -189,17 +191,18 @@
         * event outside of the critical section - the spinlock might spin for a
         * while ... */
        if (new_crtc_state->uapi.event) {
+#ifndef __NetBSD__             /* XXX locking against self */
                WARN_ON(drm_crtc_vblank_get(&crtc->base) != 0);
-
-               spin_lock(&crtc->base.dev->event_lock);
+#endif
+
                drm_crtc_arm_vblank_event(&crtc->base,
                                          new_crtc_state->uapi.event);
-               spin_unlock(&crtc->base.dev->event_lock);
 
                new_crtc_state->uapi.event = NULL;
        }
 
        spin_unlock(&dev_priv->drm.vbl_lock);
+       spin_unlock(&crtc->base.dev->event_lock);
 
        if (intel_vgpu_active(dev_priv))
                return;



Home | Main Index | Thread Index | Old Index