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/b540298546d5
branches:  trunk
changeset: 379344:b540298546d5
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 5184e6b718ed -r b540298546d5 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 @@ i915_gem_object_get_page(struct drm_i915
                 * 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