FreeBSD keeps crashing - not sure where to start, any ideas?

Have a FreeBSD system which has frequently started crashing a fair bit off late - earlier it was somewhat better. Sometimes the screen changes colours and restarts, other times it just hangs ...... Is this some issue with drm?

Here is the dmesg from the last crash

Code:
wg0: link state changed to UP
drmn0: [drm] GPU HANG: ecode 5:1:86fffffd, in chrome [100895]
drmn0: [drm] Resetting chip for stopped heartbeat on rcs0
drmn0: [drm] chrome[100895] context reset due to GPU hang
drmn0: [drm] GPU HANG: ecode 5:1:00ffffff, in chrome [100895]


Fatal trap 12: page fault while in kernel mode
cpuid = 0; apic id = 00
fault virtual address    = 0x61
fault code        = supervisor read data, page not present
instruction pointer    = 0x20:0xffffffff80f528e7
stack pointer            = 0x28:0xfffffe0081eb3b60
frame pointer            = 0x28:0xfffffe0081eb3ba0
code segment        = base 0x0, limit 0xfffff, type 0x1b
            = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags    = interrupt enabled, resume, IOPL = 0
current process        = 0 (linuxkpi_short_wq_0)
trap number        = 12
WARNING !drm_modeset_is_locked(&crtc->mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:619
WARNING !drm_modeset_is_locked(&crtc->mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:619
WARNING !drm_modeset_is_locked(&dev->mode_config.connection_mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:669


Fatal trap 9: general protection fault while in kernel mode
cpuid = 0; apic id = 00
instruction pointer    = 0x20:0xffffffff82becd20
stack pointer            = 0x28:0xfffffe0081eb3550
frame pointer            = 0x28:0xfffffe0081eb3590
code segment        = base 0x0, limit 0xfffff, type 0x1b
            = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags    = resume, IOPL = 0
current process        = 0 (linuxkpi_short_wq_0)
trap number        = 9
panic: general protection fault
cpuid = 0
time = 1675027637
KDB: stack backtrace:
#0 0xffffffff80c694a5 at kdb_backtrace+0x65
#1 0xffffffff80c1bb5f at vpanic+0x17f
#2 0xffffffff80c1b9d3 at panic+0x43
#3 0xffffffff810afdf5 at trap_fatal+0x385
#4 0xffffffff810875b8 at calltrap+0x8
#5 0xffffffff82b44979 at intel_bw_calc_min_cdclk+0x89
#6 0xffffffff82b74e10 at intel_atomic_check_cdclk+0xb0
#7 0xffffffff82b7481f at intel_atomic_check+0x1bcf
#8 0xffffffff82ca75dc at drm_atomic_check_only+0x3fc
#9 0xffffffff82ca7a13 at drm_atomic_commit+0x13
#10 0xffffffff82cb6518 at drm_client_modeset_commit_atomic+0x158
#11 0xffffffff82cb6604 at drm_client_modeset_commit_locked+0x74
#12 0xffffffff82cb6791 at drm_client_modeset_commit+0x21
#13 0xffffffff82cf63f2 at drm_fb_helper_restore_fbdev_mode_unlocked+0x82
#14 0xffffffff82ce43e3 at vt_kms_postswitch+0x163
#15 0xffffffff80a70860 at vt_window_switch+0x120
#16 0xffffffff80a6db7f at vtterm_cngrab+0x4f
#17 0xffffffff80bb3956 at cngrab+0x26
WARNING !drm_modeset_is_locked(&crtc->mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:619
WARNING !drm_modeset_is_locked(&crtc->mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:619
WARNING !drm_modeset_is_locked(&dev->mode_config.connection_mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:669


Fatal trap 9: general protection fault while in kernel mode
cpuid = 0; apic id = 00
instruction pointer    = 0x20:0xffffffff82becd20
stack pointer            = 0x28:0xfffffe0081eb2f90
frame pointer            = 0x28:0xfffffe0081eb2fd0
code segment        = base 0x0, limit 0xfffff, type 0x1b
            = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags    = resume, IOPL = 0
current process        = 0 (linuxkpi_short_wq_0)
trap number        = 9
panic: general protection fault
cpuid = 0
time = 1675027637
KDB: stack backtrace:
#0 0xffffffff80c694a5 at kdb_backtrace+0x65
#1 0xffffffff80c1bb5f at vpanic+0x17f
#2 0xffffffff80c1b9d3 at panic+0x43
#3 0xffffffff810afdf5 at trap_fatal+0x385
#4 0xffffffff810875b8 at calltrap+0x8
#5 0xffffffff82b44979 at intel_bw_calc_min_cdclk+0x89
#6 0xffffffff82b74e10 at intel_atomic_check_cdclk+0xb0
#7 0xffffffff82b7481f at intel_atomic_check+0x1bcf
#8 0xffffffff82ca75dc at drm_atomic_check_only+0x3fc
#9 0xffffffff82ca7a13 at drm_atomic_commit+0x13
#10 0xffffffff82cb6518 at drm_client_modeset_commit_atomic+0x158
#11 0xffffffff82cb6604 at drm_client_modeset_commit_locked+0x74
#12 0xffffffff82cb6791 at drm_client_modeset_commit+0x21
#13 0xffffffff82cf63f2 at drm_fb_helper_restore_fbdev_mode_unlocked+0x82
#14 0xffffffff82ce43e3 at vt_kms_postswitch+0x163
#15 0xffffffff80a70a19 at vt_window_switch+0x2d9
#16 0xffffffff80c1b47c at kern_reboot+0x17c
#17 0xffffffff80c1bbce at vpanic+0x1ee
WARNING !drm_modeset_is_locked(&crtc->mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:619
WARNING !drm_modeset_is_locked(&crtc->mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:619
WARNING !drm_modeset_is_locked(&dev->mode_config.connection_mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:669


Fatal trap 9: general protection fault while in kernel mode
cpuid = 0; apic id = 00
instruction pointer    = 0x20:0xffffffff82becd20
stack pointer            = 0x28:0xfffffe0081eb29d0
frame pointer            = 0x28:0xfffffe0081eb2a10
code segment        = base 0x0, limit 0xfffff, type 0x1b
            = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags    = resume, IOPL = 0
current process        = 0 (linuxkpi_short_wq_0)
trap number        = 9
panic: general protection fault
cpuid = 0
time = 1675027637
KDB: stack backtrace:
#0 0xffffffff80c694a5 at kdb_backtrace+0x65
#1 0xffffffff80c1bb5f at vpanic+0x17f
#2 0xffffffff80c1b9d3 at panic+0x43
#3 0xffffffff810afdf5 at trap_fatal+0x385
#4 0xffffffff810875b8 at calltrap+0x8
#5 0xffffffff82b44979 at intel_bw_calc_min_cdclk+0x89
#6 0xffffffff82b74e10 at intel_atomic_check_cdclk+0xb0
#7 0xffffffff82b7481f at intel_atomic_check+0x1bcf
#8 0xffffffff82ca75dc at drm_atomic_check_only+0x3fc
#9 0xffffffff82ca7a13 at drm_atomic_commit+0x13
#10 0xffffffff82cb6518 at drm_client_modeset_commit_atomic+0x158
#11 0xffffffff82cb6604 at drm_client_modeset_commit_locked+0x74
#12 0xffffffff82cb6791 at drm_client_modeset_commit+0x21
#13 0xffffffff82cf63f2 at drm_fb_helper_restore_fbdev_mode_unlocked+0x82
#14 0xffffffff82ce43e3 at vt_kms_postswitch+0x163
#15 0xffffffff80a70a19 at vt_window_switch+0x2d9
#16 0xffffffff80c1b47c at kern_reboot+0x17c
#17 0xffffffff80c1bbce at vpanic+0x1ee
WARNING !drm_modeset_is_locked(&crtc->mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:619
WARNING !drm_modeset_is_locked(&crtc->mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:619
WARNING !drm_modeset_is_locked(&dev->mode_config.connection_mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:669


Fatal trap 9: general protection fault while in kernel mode
cpuid = 0; apic id = 00
instruction pointer    = 0x20:0xffffffff82becd20
stack pointer            = 0x28:0xfffffe0081eb2410
frame pointer            = 0x28:0xfffffe0081eb2450
code segment        = base 0x0, limit 0xfffff, type 0x1b
            = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags    = resume, IOPL = 0
current process        = 0 (linuxkpi_short_wq_0)
trap number        = 9
panic: general protection fault
cpuid = 0
time = 1675027637
KDB: stack backtrace:
#0 0xffffffff80c694a5 at kdb_backtrace+0x65
#1 0xffffffff80c1bb5f at vpanic+0x17f
#2 0xffffffff80c1b9d3 at panic+0x43
#3 0xffffffff810afdf5 at trap_fatal+0x385
#4 0xffffffff810875b8 at calltrap+0x8
#5 0xffffffff82b44979 at intel_bw_calc_min_cdclk+0x89
#6 0xffffffff82b74e10 at intel_atomic_check_cdclk+0xb0
#7 0xffffffff82b7481f at intel_atomic_check+0x1bcf
#8 0xffffffff82ca75dc at drm_atomic_check_only+0x3fc
#9 0xffffffff82ca7a13 at drm_atomic_commit+0x13
#10 0xffffffff82cb6518 at drm_client_modeset_commit_atomic+0x158
#11 0xffffffff82cb6604 at drm_client_modeset_commit_locked+0x74
#12 0xffffffff82cb6791 at drm_client_modeset_commit+0x21
#13 0xffffffff82cf63f2 at drm_fb_helper_restore_fbdev_mode_unlocked+0x82
#14 0xffffffff82ce43e3 at vt_kms_postswitch+0x163
#15 0xffffffff80a70a19 at vt_window_switch+0x2d9
#16 0xffffffff80c1b47c at kern_reboot+0x17c
#17 0xffffffff80c1bbce at vpanic+0x1ee
WARNING !drm_modeset_is_locked(&crtc->mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:619
WARNING !drm_modeset_is_locked(&crtc->mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:619
WARNING !drm_modeset_is_locked(&dev->mode_config.connection_mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:669


Fatal trap 9: general protection fault while in kernel mode
cpuid = 0; apic id = 00
instruction pointer    = 0x20:0xffffffff82becd20
stack pointer            = 0x28:0xfffffe0081eb1e50
frame pointer            = 0x28:0xfffffe0081eb1e90
code segment        = base 0x0, limit 0xfffff, type 0x1b
            = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags    = resume, IOPL = 0
current process        = 0 (linuxkpi_short_wq_0)
trap number        = 9
panic: general protection fault
cpuid = 0
time = 1675027637
KDB: stack backtrace:
#0 0xffffffff80c694a5 at kdb_backtrace+0x65
#1 0xffffffff80c1bb5f at vpanic+0x17f
#2 0xffffffff80c1b9d3 at panic+0x43
#3 0xffffffff810afdf5 at trap_fatal+0x385
#4 0xffffffff810875b8 at calltrap+0x8
#5 0xffffffff82b44979 at intel_bw_calc_min_cdclk+0x89
#6 0xffffffff82b74e10 at intel_atomic_check_cdclk+0xb0
#7 0xffffffff82b7481f at intel_atomic_check+0x1bcf
#8 0xffffffff82ca75dc at drm_atomic_check_only+0x3fc
#9 0xffffffff82ca7a13 at drm_atomic_commit+0x13
#10 0xffffffff82cb6518 at drm_client_modeset_commit_atomic+0x158
#11 0xffffffff82cb6604 at drm_client_modeset_commit_locked+0x74
#12 0xffffffff82cb6791 at drm_client_modeset_commit+0x21
#13 0xffffffff82cf63f2 at drm_fb_helper_restore_fbdev_mode_unlocked+0x82
#14 0xffffffff82ce43e3 at vt_kms_postswitch+0x163
#15 0xffffffff80a70a19 at vt_window_switch+0x2d9
#16 0xffffffff80c1b47c at kern_reboot+0x17c
#17 0xffffffff80c1bbce at vpanic+0x1ee
WARNING !drm_modeset_is_locked(&crtc->mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:619
WARNING !drm_modeset_is_locked(&crtc->mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:619
WARNING !drm_modeset_is_locked(&dev->mode_config.connection_mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:669


Fatal trap 9: general protection fault while in kernel mode
cpuid = 0; apic id = 00
instruction pointer    = 0x20:0xffffffff82becd20
stack pointer            = 0x28:0xfffffe0081eb1890
frame pointer            = 0x28:0xfffffe0081eb18d0
code segment        = base 0x0, limit 0xfffff, type 0x1b
            = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags    = resume, IOPL = 0
current process        = 0 (linuxkpi_short_wq_0)
trap number        = 9
panic: general protection fault
cpuid = 0
time = 1675027637
KDB: stack backtrace:
#0 0xffffffff80c694a5 at kdb_backtrace+0x65
#1 0xffffffff80c1bb5f at vpanic+0x17f
#2 0xffffffff80c1b9d3 at panic+0x43
#3 0xffffffff810afdf5 at trap_fatal+0x385
#4 0xffffffff810875b8 at calltrap+0x8
#5 0xffffffff82b44979 at intel_bw_calc_min_cdclk+0x89
#6 0xffffffff82b74e10 at intel_atomic_check_cdclk+0xb0
#7 0xffffffff82b7481f at intel_atomic_check+0x1bcf
#8 0xffffffff82ca75dc at drm_atomic_check_only+0x3fc
#9 0xffffffff82ca7a13 at drm_atomic_commit+0x13
#10 0xffffffff82cb6518 at drm_client_modeset_commit_atomic+0x158
#11 0xffffffff82cb6604 at drm_client_modeset_commit_locked+0x74
#12 0xffffffff82cb6791 at drm_client_modeset_commit+0x21
#13 0xffffffff82cf63f2 at drm_fb_helper_restore_fbdev_mode_unlocked+0x82
#14 0xffffffff82ce43e3 at vt_kms_postswitch+0x163
#15 0xffffffff80a70a19 at vt_window_switch+0x2d9
#16 0xffffffff80c1b47c at kern_reboot+0x17c
#17 0xffffffff80c1bbce at vpanic+0x1ee
WARNING !drm_modeset_is_locked(&crtc->mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:619
WARNING !drm_modeset_is_locked(&crtc->mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:619
WARNING !drm_modeset_is_locked(&dev->mode_config.connection_mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:669


Fatal trap 9: general protection fault while in kernel mode
cpuid = 0; apic id = 00
instruction pointer    = 0x20:0xffffffff82becd20
stack pointer            = 0x28:0xfffffe0081eb12d0
frame pointer            = 0x28:0xfffffe0081eb1310
code segment        = base 0x0, limit 0xfffff, type 0x1b
            = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags    = resume, IOPL = 0
current process        = 0 (linuxkpi_short_wq_0)
trap number        = 9
panic: general protection fault
cpuid = 0
time = 1675027637
KDB: stack backtrace:
#0 0xffffffff80c694a5 at kdb_backtrace+0x65
#1 0xffffffff80c1bb5f at vpanic+0x17f
#2 0xffffffff80c1b9d3 at panic+0x43
#3 0xffffffff810afdf5 at trap_fatal+0x385
#4 0xffffffff810875b8 at calltrap+0x8
#5 0xffffffff82b44979 at intel_bw_calc_min_cdclk+0x89
#6 0xffffffff82b74e10 at intel_atomic_check_cdclk+0xb0
#7 0xffffffff82b7481f at intel_atomic_check+0x1bcf
#8 0xffffffff82ca75dc at drm_atomic_check_only+0x3fc
#9 0xffffffff82ca7a13 at drm_atomic_commit+0x13
#10 0xffffffff82cb6518 at drm_client_modeset_commit_atomic+0x158
#11 0xffffffff82cb6604 at drm_client_modeset_commit_locked+0x74
#12 0xffffffff82cb6791 at drm_client_modeset_commit+0x21
#13 0xffffffff82cf63f2 at drm_fb_helper_restore_fbdev_mode_unlocked+0x82
#14 0xffffffff82ce43e3 at vt_kms_postswitch+0x163
#15 0xffffffff80a70a19 at vt_window_switch+0x2d9
#16 0xffffffff80c1b47c at kern_reboot+0x17c
#17 0xffffffff80c1bbce at vpanic+0x1ee
WARNING !drm_modeset_is_locked(&crtc->mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:619
WARNING !drm_modeset_is_locked(&crtc->mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:619
WARNING !drm_modeset_is_locked(&dev->mode_config.connection_mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:669


Fatal trap 9: general protection fault while in kernel mode
cpuid = 0; apic id = 00
instruction pointer    = 0x20:0xffffffff82becd20
stack pointer            = 0x28:0xfffffe0081eb0d10
frame pointer            = 0x28:0xfffffe0081eb0d50
code segment        = base 0x0, limit 0xfffff, type 0x1b
            = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags    = resume, IOPL = 0
current process        = 0 (linuxkpi_short_wq_0)
trap number        = 9
panic: general protection fault
cpuid = 0
time = 1675027637
KDB: stack backtrace:
#0 0xffffffff80c694a5 at kdb_backtrace+0x65
#1 0xffffffff80c1bb5f at vpanic+0x17f
#2 0xffffffff80c1b9d3 at panic+0x43
#3 0xffffffff810afdf5 at trap_fatal+0x385
#4 0xffffffff810875b8 at calltrap+0x8
#5 0xffffffff82b44979 at intel_bw_calc_min_cdclk+0x89
#6 0xffffffff82b74e10 at intel_atomic_check_cdclk+0xb0
#7 0xffffffff82b7481f at intel_atomic_check+0x1bcf
#8 0xffffffff82ca75dc at drm_atomic_check_only+0x3fc
#9 0xffffffff82ca7a13 at drm_atomic_commit+0x13
#10 0xffffffff82cb6518 at drm_client_modeset_commit_atomic+0x158
#11 0xffffffff82cb6604 at drm_client_modeset_commit_locked+0x74
#12 0xffffffff82cb6791 at drm_client_modeset_commit+0x21
#13 0xffffffff82cf63f2 at drm_fb_helper_restore_fbdev_mode_unlocked+0x82
#14 0xffffffff82ce43e3 at vt_kms_postswitch+0x163
#15 0xffffffff80a70a19 at vt_window_switch+0x2d9
#16 0xffffffff80c1b47c at kern_reboot+0x17c
#17 0xffffffff80c1bbce at vpanic+0x1ee
WARNING !drm_modeset_is_locked(&crtc->mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:619
WARNING !drm_modeset_is_locked(&crtc->mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:619
WARNING !drm_modeset_is_locked(&dev->mode_config.connection_mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:669


Fatal trap 9: general protection fault while in kernel mode
cpuid = 0; apic id = 00
instruction pointer    = 0x20:0xffffffff82becd20
stack pointer            = 0x28:0xfffffe0081eb0750
frame pointer            = 0x28:0xfffffe0081eb0790
code segment        = base 0x0, limit 0xfffff, type 0x1b
            = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags    = resume, IOPL = 0
current process        = 0 (linuxkpi_short_wq_0)
trap number        = 9
panic: general protection fault
cpuid = 0
time = 1675027637
KDB: stack backtrace:

Fatal double fault
rip 0xffffffff80a68e18 rsp 0xfffffe0081eb0000 rbp 0xfffffe0081eb0010
rax 0xf rdx 0xfffffe000ee062c0 rbx 0xffffffff818e7ed8
rcx 0 rsi 0xffffffff818e7ed8 rdi 0xffffffff818e7db8
r8 0x8 r9 0x10 r10 0xffffffff818e7db8
r11 0x3 r12 0x2f0 r13 0x1c20004b
r14 0x5e00 r15 0 rflags 0x10046
cs 0x20 ss 0x28 ds 0x3b es 0x3b fs 0x13 gs 0x1b
fsbase 0x800e70120 gsbase 0xffffffff82a10000 kgsbase 0
cpuid = 0; apic id = 00
panic: double fault
cpuid = 0
time = 1675027637
KDB: stack backtrace:
WARNING !drm_modeset_is_locked(&crtc->mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:619
WARNING !drm_modeset_is_locked(&crtc->mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:619
WARNING !drm_modeset_is_locked(&dev->mode_config.connection_mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:669


Fatal trap 9: general protection fault while in kernel mode
cpuid = 0; apic id = 00
instruction pointer    = 0x20:0xffffffff82becd20
stack pointer            = 0x28:0xffffffff81d499e0
frame pointer            = 0x28:0xffffffff81d49a20
code segment        = base 0x0, limit 0xfffff, type 0x1b
            = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags    = resume, IOPL = 0
current process        = 0 (linuxkpi_short_wq_0)
trap number        = 9
panic: general protection fault
cpuid = 0
time = 1675027637
KDB: stack backtrace:
WARNING !drm_modeset_is_locked(&crtc->mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:619
WARNING !drm_modeset_is_locked(&crtc->mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:619
WARNING !drm_modeset_is_locked(&dev->mode_config.connection_mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:669


Fatal trap 9: general protection fault while in kernel mode
cpuid = 0; apic id = 00
instruction pointer    = 0x20:0xffffffff82becd20
stack pointer            = 0x28:0xffffffff81d49420
frame pointer            = 0x28:0xffffffff81d49460
code segment        = base 0x0, limit 0xfffff, type 0x1b
            = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags    = resume, IOPL = 0
current process        = 0 (linuxkpi_short_wq_0)
trap number        = 9
panic: general protection fault
cpuid = 0
time = 1675027637
KDB: stack backtrace:
WARNING !drm_modeset_is_locked(&crtc->mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:619
WARNING !drm_modeset_is_locked(&crtc->mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:619
WARNING !drm_modeset_is_locked(&dev->mode_config.connection_mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:669


Fatal trap 9: general protection fault while in kernel mode
cpuid = 0; apic id = 00
instruction pointer    = 0x20:0xffffffff82becd20
stack pointer            = 0x28:0xffffffff81d48e60
frame pointer            = 0x28:0xffffffff81d48ea0
code segment        = base 0x0, limit 0xfffff, type 0x1b
            = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags    = resume, IOPL = 0
current process        = 0 (linuxkpi_short_wq_0)
trap number        = 9
panic: general protection fault
cpuid = 0
time = 1675027637
KDB: stack backtrace:
WARNING !drm_modeset_is_locked(&crtc->mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:619
WARNING !drm_modeset_is_locked(&crtc->mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:619
WARNING !drm_modeset_is_locked(&dev->mode_config.connection_mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:669


Fatal trap 9: general protection fault while in kernel mode
cpuid = 0; apic id = 00
instruction pointer    = 0x20:0xffffffff82becd20
stack pointer            = 0x28:0xffffffff81d488a0
frame pointer            = 0x28:0xffffffff81d488e0
code segment        = base 0x0, limit 0xfffff, type 0x1b
            = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags    = resume, IOPL = 0
current process        = 0 (linuxkpi_short_wq_0)
trap number        = 9
panic: general protection fault
cpuid = 0
time = 1675027637
KDB: stack backtrace:
WARNING !drm_modeset_is_locked(&crtc->mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:619
WARNING !drm_modeset_is_locked(&crtc->mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:619
WARNING !drm_modeset_is_locked(&dev->mode_config.connection_mutex) failed at /wrkdirs/usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.163/drivers/gpu/drm/drm_atomic_helper.c:669

While booting also it seems to show the following message that doesn't seem normal

Code:
....
vgapci0: child drmn0 requested pci_enable_io
vgapci0: child drmn0 requested pci_enable_io
[drm] Unable to create a private tmpfs mount, hugepage support will be disabled(-19).
[drm] Got stolen memory base 0xb8000000, size 0x8000000
sysctl_warn_reuse: can't re-use a leaf (hw.dri.debug)!
[drm] Initialized i915 1.6.0 20200917 for drmn0 on minor 0
VT: Replacing driver "vga" with new "fb".
start FB_INFO:
type=11 height=768 width=1366 depth=32
pbase=0xc0010000 vbase=0xfffff800c0010000
name=drmn0 flags=0x0 stride=5504 bpp=32
end FB_INFO
....
 
Which FreeBSD version? I don't think that error is related to drm but zfs. Also, something is telling me you are on FreeBSD-current (14.0). Am I right?
 
Which FreeBSD version? I don't think that error is related to drm but zfs. Also, something is telling me you are on FreeBSD-current (14.0). Am I right?
This is 13.1 ..... what makes you think this is zfs related? Previously had an issue with zfs which corrupted the hard drive and all it's data.

I thought this was somehow drm related since it mentioned it in the bootup process as well as the crash (earlier corruption of zfs/hard drive also had similar errors which mentioned drm - so I really don't know what to make of it)
 
That's interesting because I'm getting something similar. After a couple of years of maybe crashing every few months, if that, I've been getting roughly daily crashes for at least a week. The machine just freezes and then reboots. There aren't any obvious changes which might have caused this. The version is:

Code:
> freebsd-version -kru && uname -aKU
13.1-RELEASE-p3
13.1-RELEASE-p3
13.1-RELEASE-p5
FreeBSD airloom.org 13.1-RELEASE-p3 FreeBSD 13.1-RELEASE-p3 GENERIC amd64 1301000 1301000

The debug log for the latest one starts with (it goes on to nearly 20,000 lines so I won't post it all) as follows

Code:
airloom.org dumped core - see /var/crash/vmcore.4

Mon Jan 30 10:43:15 AWST 2023

FreeBSD airloom.org 13.1-RELEASE-p3 FreeBSD 13.1-RELEASE-p3 GENERIC  amd64

panic: page fault

GNU gdb (GDB) 12.1 [GDB v12.1 for FreeBSD]
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-portbld-freebsd13.1".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /boot/kernel/kernel...
Reading symbols from /usr/lib/debug//boot/kernel/kernel.debug...

Unread portion of the kernel message buffer:
drmn0: [drm] GPU HANG: ecode 6:1:cfcfcfcf, in MainThread [100252]


Fatal trap 12: page fault while in kernel mode
cpuid = 0; apic id = 00
fault virtual address    = 0x61
fault code        = supervisor read data, page not present
instruction pointer    = 0x20:0xffffffff80f528e7
stack pointer            = 0x28:0xfffffe00085feb60
frame pointer            = 0x28:0xfffffe00085feba0
code segment        = base 0x0, limit 0xfffff, type 0x1b
            = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags    = interrupt enabled, resume, IOPL = 0
current process        = 0 (linuxkpi_short_wq_1)
trap number        = 12
panic: page fault
cpuid = 0
time = 1675046526
KDB: stack backtrace:
#0 0xffffffff80c694a5 at kdb_backtrace+0x65
#1 0xffffffff80c1bb5f at vpanic+0x17f
#2 0xffffffff80c1b9d3 at panic+0x43
#3 0xffffffff810afdf5 at trap_fatal+0x385
#4 0xffffffff810afe4f at trap_pfault+0x4f
#5 0xffffffff810875b8 at calltrap+0x8
#6 0xffffffff80f529dd at kmem_free+0x2d
#7 0xffffffff82c5e59d at __i915_gpu_coredump_free+0x12d
#8 0xffffffff82c2fb59 at intel_gt_handle_error+0xa9
#9 0xffffffff82c1b041 at heartbeat+0x2a1
#10 0xffffffff80e6e603 at linux_work_fn+0xe3
#11 0xffffffff80c7da81 at taskqueue_run_locked+0x181
#12 0xffffffff80c7ed92 at taskqueue_thread_loop+0xc2
#13 0xffffffff80bd8a9e at fork_exit+0x7e
#14 0xffffffff8108862e at fork_trampoline+0xe
Uptime: 41m51s
Dumping 534 out of 3775 MB:..3% (CTRL-C to abort)

The current dmesg has a similar entry about "drm", but I think that's been there since installation.

I was thinking I'd try reinstalling to see if that fiixed it, so I'd be interested if anyone has any better ideas.
 
After a couple of years of maybe crashing every few months, if that, I've been getting roughly daily crashes for at least a week. The machine just freezes and then reboots. There aren't any obvious changes which might have caused this
This has been my experience too - and frankly is making FreeBSD quite a bit unusable. I loved the stability of the system earlier, but now almost daily crashes have just become a huge pain.

Hoping someone can shed more light and this gets fixed.

PS: I actually re-installed it because apparently this lead to zfs error with the hard drive - but the crashes continue. I would guess 12.x was more stable and something introduced in 13.x is the issue at play here, but again it's a guess based on strong hunch- can't definitively say.
 
First thing I would do is not load DRM modules, boot the system to console and make sure it stays stable that way.
It will help isolate "DRM or something else".
Then you can alway handload the drm bits you need and see how your desktop goes then. Sometimes there is a bit of timing issue.
It may also help if tell us what kind of hardware (graphics hardware at least) you're using.
Where are you loading the drm bits from, /boot/loader.conf or from kldlist in /etc/rc.conf? I prefer loading it from rc.conf.
What type of boot, UEFI or BIOS?
 
Where are you loading the drm bits from, /boot/loader.conf or from kldlist in /etc/rc.conf? I prefer loading it from rc.conf.
From rc.conf "i915kms"

I just tried commenting it out and booting and the error messages related to drm that I posted above (again mentioned below) have vanished. Can't see the drm messages anymore (even though the graphics are messed up). Does this help?
vgapci0: child drmn0 requested pci_enable_io vgapci0: child drmn0 requested pci_enable_io [drm] Unable to create a private tmpfs mount, hugepage support will be disabled(-19). [drm] Got stolen memory base 0xb8000000, size 0x8000000 sysctl_warn_reuse: can't re-use a leaf (hw.dri.debug)! [drm] Initialized i915 1.6.0 20200917 for drmn0 on minor 0 VT: Replacing driver "vga" with new "fb". start FB_INFO: type=11 height=768 width=1366 depth=32 pbase=0xc0010000 vbase=0xfffff800c0010000 name=drmn0 flags=0x0 stride=5504 bpp=32 end FB_INFO
Not sure what to do about it next.
 
I just tried commenting it out and booting and the error messages related to drm that I posted above have vanished. Can't see the drm messages anymore (even though the graphics are messed up). Does this help?
A little bit. As the system boots, I'm assuming it stays in text mode? If you don't load the drm modules you won't see error messages. It's likely staying in some default mode for graphics, lower resolution, not accelerated.
What I was trying to determine: Is the system stable without the drm loaded, even if it's using worse resolution.
So basically, it may be optimal but if the system is usable (more or less) try using it for a little bit and see if it crashes.
If it doesn't crash, then as root "kldload i915kms" should bring back your resolution and acceleration and maybe crash.
 
If you don't load the drm modules you won't see error messages.
Yes, I think that's what happened.
It's likely staying in some default mode for graphics, lower resolution, not accelerated.
True, the graphics are running and are not very pleasant compared to the earlier with drm loaded.
If it doesn't crash, then as root "kldload i915kms" should bring back your resolution and acceleration and maybe crash.
Yes - but still doesn't solve the issue of _why_ these kind of crashes are happening, I suppose quite a lot of others may be facing this similar issue - and manually loading it just makes it a pain.
 
Yes - but still doesn't solve the issue of _why_ these kind of crashes are happening, I suppose quite a lot of others may be facing this similar issue - and manually loading it just makes it a pain.
First rule of debugging crashes is to isolate.

Example: I'm running same patch versions as you, using i915kms driver and have had zero crashes on my system.

So trying to isolate why you are and why I'm not is a tedious process because everything is remote. Sorry about that but not much I can do.
 
Did you build the OS from source? Or the graphics/drm-kmod from ports? Is there anything in /etc/make.conf?
No - didn't build OS from source.
But I do have a vague memory that I _may_ have built drm from ports - Is there some way to check if I built from ports or installed from packages? In case it matters
(FWIW I tried the following commands that returned no results)
Code:
pkg query --all '%o %n-%v %R' | grep unknown
pkg query --all '%o %n-%v %R' | grep repository
Also - there is no /etc/make.conf on the system
So trying to isolate why you are and why I'm not is a tedious process because everything is remote. Sorry about that but not much I can do.
No worries - I guess you helped me isolate it to drm - I don't think there is an easy solution to the issue perhaps. So thanks for trying, appreciate it.
 
So I actually tried a couple of suggestions as pointed out by mer , but seems like its very inconvenient
1) Tried commenting out kld_list="i915kms" from /etc/rc.conf ..... while that worked for a bit (couldn't run long enough for the following reasons) it lead to horrible graphics and the screen also went blank after waking up from sleep after lid close.
2) When the above was commented out - loading drm via kldload again made the screen go blank and unusable.

These hacks are not the solution for the long run, in case it saves someone else the trouble of trying this approach.
 
Also - there is no /etc/make.conf on the system
Alright. That's the only thing I was after. Some people seem to think they can change various compiler optimization settings, which often causes weird and wonderful problems including weird crashes.

These hacks are not the solution for the long run
They weren't intended as a solution but as a troubleshooting method. Remove the suspected module out of the way, no more crashes. Then it's fairly certain the problem is caused by that module. It helps narrowing down the cause of the crash.

You should probably create a PR for this issue. We've narrowed the cause down to a specific module. Now a developer might be able to reproduce the crash. It's a royal pain to debug an issue if you can't easily reproduce it.
 
Back
Top