Module Name: src Committed By: mrg Date: Thu Jul 20 18:02:45 UTC 2023
Modified Files: src/sys/external/bsd/drm2/dist/drm/amd/amdgpu: amdgpu_fence.c Log Message: avoid calling drm_sched_fini() for AMDGPU_RING_TYPE_KIQ rings. drm_sched_init() is not called for these rings, and we'd panic trying to mutex_destroy() a mutex that wasn't initialised. this seems like a general bug, not a bug in netbsd port. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 \ src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_fence.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_fence.c diff -u src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_fence.c:1.10 src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_fence.c:1.11 --- src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_fence.c:1.10 Sun Dec 19 12:02:39 2021 +++ src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_fence.c Thu Jul 20 18:02:45 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: amdgpu_fence.c,v 1.10 2021/12/19 12:02:39 riastradh Exp $ */ +/* $NetBSD: amdgpu_fence.c,v 1.11 2023/07/20 18:02:45 mrg Exp $ */ /* * Copyright 2009 Jerome Glisse. @@ -31,7 +31,7 @@ * Dave Airlie */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: amdgpu_fence.c,v 1.10 2021/12/19 12:02:39 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: amdgpu_fence.c,v 1.11 2023/07/20 18:02:45 mrg Exp $"); #include <linux/seq_file.h> #include <linux/atomic.h> @@ -541,7 +541,9 @@ void amdgpu_fence_driver_fini(struct amd } amdgpu_irq_put(adev, ring->fence_drv.irq_src, ring->fence_drv.irq_type); - drm_sched_fini(&ring->sched); + if (ring->funcs->type != AMDGPU_RING_TYPE_KIQ) { + drm_sched_fini(&ring->sched); + } del_timer_sync(&ring->fence_drv.fallback_timer); for (j = 0; j <= ring->fence_drv.num_fences_mask; ++j) dma_fence_put(ring->fence_drv.fences[j]);