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/gem i915: Fix i915_gem_o...



details:   https://anonhg.NetBSD.org/src/rev/2dca9bb67675
branches:  trunk
changeset: 1028812:2dca9bb67675
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 12:07:11 2021 +0000

description:
i915: Fix i915_gem_object_release_mmap_offset locking.

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_mman.c |  14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diffs (39 lines):

diff -r f24dd458df1a -r 2dca9bb67675 sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_mman.c
--- a/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_mman.c   Sun Dec 19 12:06:57 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_mman.c   Sun Dec 19 12:07:11 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_gem_mman.c,v 1.11 2021/12/19 11:58:41 riastradh Exp $     */
+/*     $NetBSD: i915_gem_mman.c,v 1.12 2021/12/19 12:07:11 riastradh Exp $     */
 
 /*
  * SPDX-License-Identifier: MIT
@@ -7,7 +7,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_gem_mman.c,v 1.11 2021/12/19 11:58:41 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_gem_mman.c,v 1.12 2021/12/19 12:07:11 riastradh Exp $");
 
 #include <linux/anon_inodes.h>
 #include <linux/mman.h>
@@ -698,14 +698,16 @@
        for (t = 0; t < I915_MMAP_NTYPES; t++) {
                if (t == I915_MMAP_TYPE_GTT)
                        continue;
-               /*
-                * XXX Gotta take some uvm object's lock, outside the
-                * spin lock, probably?
-                */
                for (i = 0; i < obj->base.size >> PAGE_SHIFT; i++) {
                        page = obj->mm.pages->sgl->sg_pgs[i];
                        vm_page = &page->p_vmp;
+                       /*
+                        * XXX Why do we have to have the spin lock
+                        * here at all?
+                        */
+                       spin_unlock(&obj->mmo.lock);
                        pmap_page_protect(vm_page, VM_PROT_NONE);
+                       spin_lock(&obj->mmo.lock);
                }
        }
 #else



Home | Main Index | Thread Index | Old Index