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 i915drmkms: Fix LOCKDEBU...



details:   https://anonhg.NetBSD.org/src/rev/a6a715b6fda4
branches:  trunk
changeset: 983550:a6a715b6fda4
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat May 29 08:45:38 2021 +0000

description:
i915drmkms: Fix LOCKDEBUG panic and potential deadlock.

This path is taken with a spin lock held, and possibly even in
interrupt context, where taking vmobjlock is not kosher, but we are
guaranteed to have the queue populated and unchanging.

XXX pullup-9

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/i915_drv.h |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (23 lines):

diff -r faaceba750cc -r a6a715b6fda4 sys/external/bsd/drm2/dist/drm/i915/i915_drv.h
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_drv.h    Sat May 29 08:45:29 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_drv.h    Sat May 29 08:45:38 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_drv.h,v 1.32 2020/02/23 15:46:40 ad Exp $ */
+/*     $NetBSD: i915_drv.h,v 1.33 2021/05/29 08:45:38 riastradh Exp $  */
 
 /* i915_drv.h -- Private header for the I915 driver -*- linux-c -*-
  */
@@ -3021,9 +3021,10 @@
                 * lock to prevent them from disappearing.
                 */
                KASSERT(obj->pages != NULL);
-               rw_enter(obj->base.filp->vmobjlock, RW_WRITER);
-               page = uvm_pagelookup(obj->base.filp, ptoa(n));
-               rw_exit(obj->base.filp->vmobjlock);
+               TAILQ_FOREACH(page, &obj->pageq, pageq.queue) {
+                       if (n-- == 0)
+                               break;
+               }
        }
        KASSERT(page != NULL);
        return container_of(page, struct page, p_vmp);



Home | Main Index | Thread Index | Old Index