In drm linux spinlocks are mapped to mutex(9). Locks without calls to spin_lock_irqsave(), spin_lock_irq() and the like (which block interrupts) can be changed to IPL_NONE.
Index: sys/dev/pci/drm/drm_legacy_misc.c =================================================================== RCS file: /cvs/src/sys/dev/pci/drm/drm_legacy_misc.c,v retrieving revision 1.1 diff -u -p -r1.1 drm_legacy_misc.c --- sys/dev/pci/drm/drm_legacy_misc.c 8 Jun 2020 04:47:58 -0000 1.1 +++ sys/dev/pci/drm/drm_legacy_misc.c 11 Jul 2020 02:49:18 -0000 @@ -47,7 +47,7 @@ void drm_legacy_init_members(struct drm_ INIT_LIST_HEAD(&dev->ctxlist); INIT_LIST_HEAD(&dev->vmalist); INIT_LIST_HEAD(&dev->maplist); - mtx_init(&dev->buf_lock, IPL_TTY); + mtx_init(&dev->buf_lock, IPL_NONE); rw_init(&dev->ctxlist_mutex, "drmoctx"); } Index: sys/dev/pci/drm/amd/amdgpu/amdgpu_device.c =================================================================== RCS file: /cvs/src/sys/dev/pci/drm/amd/amdgpu/amdgpu_device.c,v retrieving revision 1.10 diff -u -p -r1.10 amdgpu_device.c --- sys/dev/pci/drm/amd/amdgpu/amdgpu_device.c 9 Jul 2020 10:25:28 -0000 1.10 +++ sys/dev/pci/drm/amd/amdgpu/amdgpu_device.c 10 Jul 2020 16:40:38 -0000 @@ -2987,13 +2987,13 @@ int amdgpu_device_init(struct amdgpu_dev mtx_init(&adev->gc_cac_idx_lock, IPL_TTY); mtx_init(&adev->se_cac_idx_lock, IPL_TTY); mtx_init(&adev->audio_endpt_idx_lock, IPL_TTY); - mtx_init(&adev->mm_stats.lock, IPL_TTY); + mtx_init(&adev->mm_stats.lock, IPL_NONE); INIT_LIST_HEAD(&adev->shadow_list); rw_init(&adev->shadow_list_lock, "sdwlst"); INIT_LIST_HEAD(&adev->ring_lru_list); - mtx_init(&adev->ring_lru_list_lock, IPL_TTY); + mtx_init(&adev->ring_lru_list_lock, IPL_NONE); INIT_DELAYED_WORK(&adev->delayed_init_work, amdgpu_device_delayed_init_work_handler); Index: sys/dev/pci/drm/amd/amdgpu/amdgpu_gtt_mgr.c =================================================================== RCS file: /cvs/src/sys/dev/pci/drm/amd/amdgpu/amdgpu_gtt_mgr.c,v retrieving revision 1.2 diff -u -p -r1.2 amdgpu_gtt_mgr.c --- sys/dev/pci/drm/amd/amdgpu/amdgpu_gtt_mgr.c 8 Jun 2020 04:47:59 -0000 1.2 +++ sys/dev/pci/drm/amd/amdgpu/amdgpu_gtt_mgr.c 10 Jul 2020 16:43:28 -0000 @@ -99,7 +99,7 @@ static int amdgpu_gtt_mgr_init(struct tt start = AMDGPU_GTT_MAX_TRANSFER_SIZE * AMDGPU_GTT_NUM_TRANSFER_WINDOWS; size = (adev->gmc.gart_size >> PAGE_SHIFT) - start; drm_mm_init(&mgr->mm, start, size); - mtx_init(&mgr->lock, IPL_TTY); + mtx_init(&mgr->lock, IPL_NONE); atomic64_set(&mgr->available, p_size); man->priv = mgr; Index: sys/dev/pci/drm/amd/amdgpu/amdgpu_vm.c =================================================================== RCS file: /cvs/src/sys/dev/pci/drm/amd/amdgpu/amdgpu_vm.c,v retrieving revision 1.8 diff -u -p -r1.8 amdgpu_vm.c --- sys/dev/pci/drm/amd/amdgpu/amdgpu_vm.c 22 Jun 2020 10:11:55 -0000 1.8 +++ sys/dev/pci/drm/amd/amdgpu/amdgpu_vm.c 10 Jul 2020 16:44:17 -0000 @@ -2867,7 +2867,7 @@ int amdgpu_vm_init(struct amdgpu_device INIT_LIST_HEAD(&vm->moved); INIT_LIST_HEAD(&vm->idle); INIT_LIST_HEAD(&vm->invalidated); - mtx_init(&vm->invalidated_lock, IPL_TTY); + mtx_init(&vm->invalidated_lock, IPL_NONE); INIT_LIST_HEAD(&vm->freed); Index: sys/dev/pci/drm/amd/amdgpu/amdgpu_vram_mgr.c =================================================================== RCS file: /cvs/src/sys/dev/pci/drm/amd/amdgpu/amdgpu_vram_mgr.c,v retrieving revision 1.2 diff -u -p -r1.2 amdgpu_vram_mgr.c --- sys/dev/pci/drm/amd/amdgpu/amdgpu_vram_mgr.c 8 Jun 2020 04:47:59 -0000 1.2 +++ sys/dev/pci/drm/amd/amdgpu/amdgpu_vram_mgr.c 10 Jul 2020 16:45:44 -0000 @@ -168,7 +168,7 @@ static int amdgpu_vram_mgr_init(struct t return -ENOMEM; drm_mm_init(&mgr->mm, 0, p_size); - mtx_init(&mgr->lock, IPL_TTY); + mtx_init(&mgr->lock, IPL_NONE); man->priv = mgr; /* Add the two VRAM-related sysfs files */ Index: sys/dev/pci/drm/amd/amdgpu/gmc_v10_0.c =================================================================== RCS file: /cvs/src/sys/dev/pci/drm/amd/amdgpu/gmc_v10_0.c,v retrieving revision 1.1 diff -u -p -r1.1 gmc_v10_0.c --- sys/dev/pci/drm/amd/amdgpu/gmc_v10_0.c 8 Jun 2020 04:47:59 -0000 1.1 +++ sys/dev/pci/drm/amd/amdgpu/gmc_v10_0.c 10 Jul 2020 16:46:43 -0000 @@ -767,7 +767,7 @@ static int gmc_v10_0_sw_init(void *handl gfxhub_v2_0_init(adev); mmhub_v2_0_init(adev); - mtx_init(&adev->gmc.invalidate_lock, IPL_TTY); + mtx_init(&adev->gmc.invalidate_lock, IPL_NONE); r = amdgpu_atomfirmware_get_vram_info(adev, &vram_width, &vram_type, &vram_vendor); Index: sys/dev/pci/drm/amd/amdgpu/gmc_v9_0.c =================================================================== RCS file: /cvs/src/sys/dev/pci/drm/amd/amdgpu/gmc_v9_0.c,v retrieving revision 1.7 diff -u -p -r1.7 gmc_v9_0.c --- sys/dev/pci/drm/amd/amdgpu/gmc_v9_0.c 8 Jun 2020 04:47:59 -0000 1.7 +++ sys/dev/pci/drm/amd/amdgpu/gmc_v9_0.c 10 Jul 2020 16:46:36 -0000 @@ -1107,7 +1107,7 @@ static int gmc_v9_0_sw_init(void *handle else mmhub_v1_0_init(adev); - mtx_init(&adev->gmc.invalidate_lock, IPL_TTY); + mtx_init(&adev->gmc.invalidate_lock, IPL_NONE); r = amdgpu_atomfirmware_get_vram_info(adev, &vram_width, &vram_type, &vram_vendor); Index: sys/dev/pci/drm/i915/i915_gem.c =================================================================== RCS file: /cvs/src/sys/dev/pci/drm/i915/i915_gem.c,v retrieving revision 1.127 diff -u -p -r1.127 i915_gem.c --- sys/dev/pci/drm/i915/i915_gem.c 14 Jun 2020 15:20:07 -0000 1.127 +++ sys/dev/pci/drm/i915/i915_gem.c 11 Jul 2020 03:23:59 -0000 @@ -1293,7 +1293,7 @@ void i915_gem_init_early(struct drm_i915 i915_gem_init__mm(dev_priv); i915_gem_init__contexts(dev_priv); - mtx_init(&dev_priv->fb_tracking.lock, IPL_TTY); + mtx_init(&dev_priv->fb_tracking.lock, IPL_NONE); } void i915_gem_cleanup_early(struct drm_i915_private *dev_priv) Index: sys/dev/pci/drm/i915/gem/i915_gem_context.c =================================================================== RCS file: /cvs/src/sys/dev/pci/drm/i915/gem/i915_gem_context.c,v retrieving revision 1.1 diff -u -p -r1.1 i915_gem_context.c --- sys/dev/pci/drm/i915/gem/i915_gem_context.c 8 Jun 2020 04:48:13 -0000 1.1 +++ sys/dev/pci/drm/i915/gem/i915_gem_context.c 11 Jul 2020 03:09:55 -0000 @@ -897,7 +897,7 @@ i915_gem_create_context(struct drm_i915_ static void init_contexts(struct i915_gem_contexts *gc) { - mtx_init(&gc->lock, IPL_TTY); + mtx_init(&gc->lock, IPL_NONE); INIT_LIST_HEAD(&gc->list); INIT_WORK(&gc->free_work, contexts_free_worker); Index: sys/dev/pci/drm/i915/gem/i915_gem_object.c =================================================================== RCS file: /cvs/src/sys/dev/pci/drm/i915/gem/i915_gem_object.c,v retrieving revision 1.1 diff -u -p -r1.1 i915_gem_object.c --- sys/dev/pci/drm/i915/gem/i915_gem_object.c 8 Jun 2020 04:48:13 -0000 1.1 +++ sys/dev/pci/drm/i915/gem/i915_gem_object.c 11 Jul 2020 03:11:17 -0000 @@ -71,14 +71,14 @@ void i915_gem_object_init(struct drm_i91 rw_init(&obj->mm.lock, "objmm"); #endif - mtx_init(&obj->vma.lock, IPL_TTY); + mtx_init(&obj->vma.lock, IPL_NONE); INIT_LIST_HEAD(&obj->vma.list); INIT_LIST_HEAD(&obj->mm.link); INIT_LIST_HEAD(&obj->lut_list); - mtx_init(&obj->mmo.lock, IPL_TTY); + mtx_init(&obj->mmo.lock, IPL_NONE); obj->mmo.offsets = RB_ROOT; init_rcu_head(&obj->rcu); Index: sys/dev/pci/drm/i915/gt/intel_gtt.c =================================================================== RCS file: /cvs/src/sys/dev/pci/drm/i915/gt/intel_gtt.c,v retrieving revision 1.3 diff -u -p -r1.3 intel_gtt.c --- sys/dev/pci/drm/i915/gt/intel_gtt.c 14 Jun 2020 15:20:07 -0000 1.3 +++ sys/dev/pci/drm/i915/gt/intel_gtt.c 11 Jul 2020 03:14:55 -0000 @@ -15,7 +15,7 @@ void stash_init(struct pagestash *stash) { pagevec_init(&stash->pvec); - mtx_init(&stash->lock, IPL_TTY); + mtx_init(&stash->lock, IPL_NONE); } static struct vm_page *stash_pop_page(struct pagestash *stash) Index: sys/dev/pci/drm/i915/gt/intel_ppgtt.c =================================================================== RCS file: /cvs/src/sys/dev/pci/drm/i915/gt/intel_ppgtt.c,v retrieving revision 1.1 diff -u -p -r1.1 intel_ppgtt.c --- sys/dev/pci/drm/i915/gt/intel_ppgtt.c 8 Jun 2020 04:48:13 -0000 1.1 +++ sys/dev/pci/drm/i915/gt/intel_ppgtt.c 11 Jul 2020 03:18:11 -0000 @@ -35,7 +35,7 @@ struct i915_page_directory *__alloc_pd(s if (unlikely(!pd)) return NULL; - mtx_init(&pd->lock, IPL_TTY); + mtx_init(&pd->lock, IPL_NONE); return pd; } Index: sys/dev/pci/drm/i915/gt/intel_timeline.c =================================================================== RCS file: /cvs/src/sys/dev/pci/drm/i915/gt/intel_timeline.c,v retrieving revision 1.2 diff -u -p -r1.2 intel_timeline.c --- sys/dev/pci/drm/i915/gt/intel_timeline.c 9 Jul 2020 10:19:44 -0000 1.2 +++ sys/dev/pci/drm/i915/gt/intel_timeline.c 11 Jul 2020 03:19:09 -0000 @@ -273,7 +273,7 @@ void intel_gt_init_timelines(struct inte { struct intel_gt_timelines *timelines = >->timelines; - mtx_init(&timelines->lock, IPL_TTY); + mtx_init(&timelines->lock, IPL_NONE); INIT_LIST_HEAD(&timelines->active_list); mtx_init(&timelines->hwsp_lock, IPL_TTY); Index: sys/dev/pci/drm/i915/gt/uc/intel_guc_submission.c =================================================================== RCS file: /cvs/src/sys/dev/pci/drm/i915/gt/uc/intel_guc_submission.c,v retrieving revision 1.1 diff -u -p -r1.1 intel_guc_submission.c --- sys/dev/pci/drm/i915/gt/uc/intel_guc_submission.c 8 Jun 2020 04:48:13 -0000 1.1 +++ sys/dev/pci/drm/i915/gt/uc/intel_guc_submission.c 11 Jul 2020 03:16:14 -0000 @@ -532,7 +532,7 @@ int intel_guc_submission_init(struct int if (ret) goto err_workqueue; - mtx_init(&guc->wq_lock, IPL_TTY); + mtx_init(&guc->wq_lock, IPL_NONE); return 0; Index: sys/dev/pci/drm/ttm/ttm_memory.c =================================================================== RCS file: /cvs/src/sys/dev/pci/drm/ttm/ttm_memory.c,v retrieving revision 1.16 diff -u -p -r1.16 ttm_memory.c --- sys/dev/pci/drm/ttm/ttm_memory.c 8 Jun 2020 04:48:16 -0000 1.16 +++ sys/dev/pci/drm/ttm/ttm_memory.c 11 Jul 2020 01:44:56 -0000 @@ -417,7 +417,7 @@ int ttm_mem_global_init(struct ttm_mem_g int i; struct ttm_mem_zone *zone; - mtx_init(&glob->lock, IPL_TTY); + mtx_init(&glob->lock, IPL_NONE); glob->swap_queue = create_singlethread_workqueue("ttm_swap"); INIT_WORK(&glob->work, ttm_shrink_work); ret = kobject_init_and_add(