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 drm: Must hold event_lock aro...



details:   https://anonhg.NetBSD.org/src/rev/c03da8ef0537
branches:  trunk
changeset: 1028970:c03da8ef0537
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 12:36:31 2021 +0000

description:
drm: Must hold event_lock around wait on event_queue.

We must not have hit this path before if it never crashed!

diffstat:

 sys/external/bsd/drm2/dist/drm/drm_vblank.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (31 lines):

diff -r aa263a0dfeb6 -r c03da8ef0537 sys/external/bsd/drm2/dist/drm/drm_vblank.c
--- a/sys/external/bsd/drm2/dist/drm/drm_vblank.c       Sun Dec 19 12:36:24 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_vblank.c       Sun Dec 19 12:36:31 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drm_vblank.c,v 1.14 2021/12/19 12:32:01 riastradh Exp $        */
+/*     $NetBSD: drm_vblank.c,v 1.15 2021/12/19 12:36:31 riastradh Exp $        */
 
 /*
  * drm_irq.c IRQ and vblank support
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_vblank.c,v 1.14 2021/12/19 12:32:01 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_vblank.c,v 1.15 2021/12/19 12:36:31 riastradh Exp $");
 
 #include <linux/export.h>
 #include <linux/moduleparam.h>
@@ -1787,10 +1787,12 @@
 
                DRM_DEBUG("waiting on vblank count %"PRIu64", crtc %u\n",
                          req_seq, pipe);
+               spin_lock(&dev->event_lock);
                DRM_SPIN_TIMED_WAIT_UNTIL(wait, &vblank->queue,
                    &dev->event_lock, msecs_to_jiffies(3000),
                    (vblank_passed(drm_vblank_count(dev, pipe), req_seq) ||
                        !READ_ONCE(vblank->enabled)));
+               spin_unlock(&dev->event_lock);
 
                switch (wait) {
                case 0:



Home | Main Index | Thread Index | Old Index