On Sun, Jun 14, 2026 at 09:52:53PM +0300, Petre Rodan wrote:
> pulse amd radeon rx6800 sapphire related page fault while running 'startx' on
> a fresh install of OpenBSD 7.9
>
> drm_sched_entity_init: called with uninitialized scheduler
> drm_sched_entity_init: called with uninitialized scheduler
> drm:pid84477:drm_sched_job_init *ERROR* drm_sched_job_init: entity has no rq!
> uvm_fault(0xfffffd8738629018, 0x210, 0, 1) -> e
> kernel: page fault trap, code=0
> Stopped at amdgpu_bo_unreserve+0x1a: movq 0x210(%rdi),%rdi
> TID PID UID PRFLAGS PFLAGS CPU COMMAND
> *102762 84477 1000 0x2 0 1K Xorg
> amdgpu_bo_unreserve(0) at amdgpu_bo_unreserve+0x1a
> amdgpu_vm_init(ffff80000050b000,ffff8000016d9000,0,0) at amdgpu_vm_init+0x510
> amdgpu_driver_open_kms(ffff80000050b058,ffff800001780c00) at
> amdgpu_driver_open
> _kms+0x145
> drm_file_alloc(ffff8000004fb500) at drm_file_alloc+0x251
> drmopen(15700,3,2000,ffff80006bcb82e0) at drmopen+0x12c
> spec_open_clone(ffff80006bd055a8) at spec_open_clone+0x166
> spec_open(ffff80006bd055a8) at spec_open+0x198
> VOP_OPEN(fffffd8739550d08,3,fffffd883eae1a90,ffff80006bcb82e0) at
> VOP_OPEN+0x57
I don't yet see how vm->root.bo could be NULL in this error path.
Try this diff (against -current, might apply to 7.9)
Index: sys/dev/pci/drm/amd/amdgpu/amdgpu_vm.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/drm/amd/amdgpu/amdgpu_vm.c,v
diff -u -p -r1.35 amdgpu_vm.c
--- sys/dev/pci/drm/amd/amdgpu/amdgpu_vm.c 10 Jun 2026 00:19:24 -0000
1.35
+++ sys/dev/pci/drm/amd/amdgpu/amdgpu_vm.c 15 Jun 2026 00:06:30 -0000
@@ -2749,7 +2749,8 @@ error_free_root:
vm->pasid = 0;
}
amdgpu_vm_pt_free_root(adev, vm);
- amdgpu_bo_unreserve(vm->root.bo);
+ if (vm->root.bo)
+ amdgpu_bo_unreserve(vm->root.bo);
amdgpu_bo_unref(&root_bo);
error_free_delayed: