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/include/linux amdgpu: more destroy fixes.



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

description:
amdgpu: more destroy fixes.


Author: phone <mrg%NetBSD.org@localhost>
Committer: Taylor R Campbell <riastradh%NetBSD.org@localhost>

diffstat:

 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_vm.c |   7 +++++--
 sys/external/bsd/drm2/include/linux/kfifo.h           |  14 +++++++++++++-
 2 files changed, 18 insertions(+), 3 deletions(-)

diffs (70 lines):

diff -r 5391605d1238 -r e6b0965de9ab sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_vm.c
--- a/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_vm.c     Sun Dec 19 12:32:53 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_vm.c     Sun Dec 19 12:33:02 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: amdgpu_vm.c,v 1.10 2021/12/19 12:31:45 riastradh Exp $ */
+/*     $NetBSD: amdgpu_vm.c,v 1.11 2021/12/19 12:33:02 riastradh Exp $ */
 
 /*
  * Copyright 2008 Advanced Micro Devices, Inc.
@@ -28,7 +28,7 @@
  *          Jerome Glisse
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amdgpu_vm.c,v 1.10 2021/12/19 12:31:45 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdgpu_vm.c,v 1.11 2021/12/19 12:33:02 riastradh Exp $");
 
 #include <linux/dma-fence-array.h>
 #include <linux/interval_tree_generic.h>
@@ -3120,6 +3120,8 @@
        struct amdgpu_bo *root;
        int i;
 
+       FINI_KFIFO(vm->faults);
+
        amdgpu_amdkfd_gpuvm_destroy_cb(adev, vm);
 
        root = amdgpu_bo_ref(vm->root.base.bo);
@@ -3172,6 +3174,7 @@
        for (i = 0; i < AMDGPU_MAX_VMHUBS; i++)
                amdgpu_vmid_free_reserved(adev, vm, i);
 
+       mutex_destroy(&vm->eviction_lock);
        spin_lock_destroy(&vm->invalidated_lock);
 }
 
diff -r 5391605d1238 -r e6b0965de9ab sys/external/bsd/drm2/include/linux/kfifo.h
--- a/sys/external/bsd/drm2/include/linux/kfifo.h       Sun Dec 19 12:32:53 2021 +0000
+++ b/sys/external/bsd/drm2/include/linux/kfifo.h       Sun Dec 19 12:33:02 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kfifo.h,v 1.5 2021/12/19 12:21:56 riastradh Exp $      */
+/*     $NetBSD: kfifo.h,v 1.6 2021/12/19 12:33:02 riastradh Exp $      */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -66,6 +66,11 @@
        _init_kfifo(&(FIFO).kf_meta, sizeof((FIFO).kf_buf));                  \
 } while (0)
 
+#define        FINI_KFIFO(FIFO) do                                                   \
+{                                                                            \
+       _fini_kfifo(&(FIFO).kf_meta);                                         \
+} while (0)
+
 static inline void
 _init_kfifo(struct kfifo_meta *meta, size_t nbytes)
 {
@@ -76,6 +81,13 @@
        meta->kfm_nbytes = nbytes;
 }
 
+static inline void
+_fini_kfifo(struct kfifo_meta *meta)
+{
+
+       mutex_destroy(&meta->kfm_lock);
+}
+
 _KFIFO_PTR_TYPE(kfifo, void);
 
 #define        kfifo_alloc(FIFO, SIZE, GFP)                                          \



Home | Main Index | Thread Index | Old Index