diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2023-02-15 10:18:27 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2023-02-15 10:18:27 +0000 |
commit | 44901528bd7aa2593d08bfccf95b3c5ea20923d2 (patch) | |
tree | f9b95e05c1594f654feac42f6401986cada6494a /sys | |
parent | 5bae663cceaa95fea8f046870e4b6bf696b49fb2 (diff) |
drm/amdgpu/fence: Fix oops due to non-matching drm_sched init/fini
From Guilherme G. Piccoli
2bcbbef9cace772f5b7128b11401c515982de34b in linux-6.1.y/6.1.12
5ad7bbf3dba5c4a684338df1f285080f2588b535 in mainline linux
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/drm/amd/amdgpu/amdgpu_fence.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_fence.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_fence.c index d3f86b3eed7..b06a0f06800 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_fence.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_fence.c @@ -584,7 +584,13 @@ void amdgpu_fence_driver_sw_fini(struct amdgpu_device *adev) if (!ring || !ring->fence_drv.initialized) continue; - if (!ring->no_scheduler) + /* + * Notice we check for sched.ops since there's some + * override on the meaning of sched.ready by amdgpu. + * The natural check would be sched.ready, which is + * set as drm_sched_init() finishes... + */ + if (ring->sched.ops) drm_sched_fini(&ring->sched); for (j = 0; j <= ring->fence_drv.num_fences_mask; ++j) |