freebsd / drm-kmod

drm driver for FreeBSD
148 stars 68 forks source link

graphics/drm-510-kmod panic with screen on usb-c dock in fbd_register #162

Closed jownit closed 1 year ago

jownit commented 2 years ago

Describe the bug After installing graphics/drm-510-kmod the kernel panics when loading amdgpu.ko

FreeBSD version 14.0-CURRENT #23 main-n255143-271f6d52a60

PCI Info

pciconf -lv hostb0@pci0:0:0:0: class=0x060000 rev=0x00 hdr=0x00 vendor=0x1022 device=0x15d0 subvendor=0x1022 subdevice=0x15d0 vendor = 'Advanced Micro Devices, Inc. [AMD]' device = 'Raven/Raven2 Root Complex' class = bridge subclass = HOST-PCI none0@pci0:0:0:2: class=0x080600 rev=0x00 hdr=0x00 vendor=0x1022 device=0x15d1 subvendor=0x1022 subdevice=0x15d1 vendor = 'Advanced Micro Devices, Inc. [AMD]' device = 'Raven/Raven2 IOMMU' class = base peripheral subclass = IOMMU hostb1@pci0:0:1:0: class=0x060000 rev=0x00 hdr=0x00 vendor=0x1022 device=0x1452 subvendor=0x0000 subdevice=0x0000 vendor = 'Advanced Micro Devices, Inc. [AMD]' device = 'Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge' class = bridge subclass = HOST-PCI pcib1@pci0:0:1:2: class=0x060400 rev=0x00 hdr=0x01 vendor=0x1022 device=0x15d3 subvendor=0x17aa subdevice=0x5126 vendor = 'Advanced Micro Devices, Inc. [AMD]' device = 'Raven/Raven2 PCIe GPP Bridge [6:0]' class = bridge subclass = PCI-PCI pcib2@pci0:0:1:3: class=0x060400 rev=0x00 hdr=0x01 vendor=0x1022 device=0x15d3 subvendor=0x17aa subdevice=0x5126 vendor = 'Advanced Micro Devices, Inc. [AMD]' device = 'Raven/Raven2 PCIe GPP Bridge [6:0]' class = bridge subclass = PCI-PCI pcib3@pci0:0:1:4: class=0x060400 rev=0x00 hdr=0x01 vendor=0x1022 device=0x15d3 subvendor=0x17aa subdevice=0x5126 vendor = 'Advanced Micro Devices, Inc. [AMD]' device = 'Raven/Raven2 PCIe GPP Bridge [6:0]' class = bridge subclass = PCI-PCI pcib4@pci0:0:1:7: class=0x060400 rev=0x00 hdr=0x01 vendor=0x1022 device=0x15d3 subvendor=0x17aa subdevice=0x5126 vendor = 'Advanced Micro Devices, Inc. [AMD]' device = 'Raven/Raven2 PCIe GPP Bridge [6:0]' class = bridge subclass = PCI-PCI hostb2@pci0:0:8:0: class=0x060000 rev=0x00 hdr=0x00 vendor=0x1022 device=0x1452 subvendor=0x0000 subdevice=0x0000 vendor = 'Advanced Micro Devices, Inc. [AMD]' device = 'Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge' class = bridge subclass = HOST-PCI pcib5@pci0:0:8:1: class=0x060400 rev=0x00 hdr=0x01 vendor=0x1022 device=0x15db subvendor=0x5126 subdevice=0x17aa vendor = 'Advanced Micro Devices, Inc. [AMD]' device = 'Raven/Raven2 Internal PCIe GPP Bridge 0 to Bus A' class = bridge subclass = PCI-PCI intsmb0@pci0:0:20:0: class=0x0c0500 rev=0x61 hdr=0x00 vendor=0x1022 device=0x790b subvendor=0x17aa subdevice=0x5126 vendor = 'Advanced Micro Devices, Inc. [AMD]' device = 'FCH SMBus Controller' class = serial bus subclass = SMBus isab0@pci0:0:20:3: class=0x060100 rev=0x51 hdr=0x00 vendor=0x1022 device=0x790e subvendor=0x17aa subdevice=0x5126 vendor = 'Advanced Micro Devices, Inc. [AMD]' device = 'FCH LPC Bridge' class = bridge subclass = PCI-ISA hostb3@pci0:0:24:0: class=0x060000 rev=0x00 hdr=0x00 vendor=0x1022 device=0x15e8 subvendor=0x0000 subdevice=0x0000 vendor = 'Advanced Micro Devices, Inc. [AMD]' device = 'Raven/Raven2 Device 24: Function 0' class = bridge subclass = HOST-PCI hostb4@pci0:0:24:1: class=0x060000 rev=0x00 hdr=0x00 vendor=0x1022 device=0x15e9 subvendor=0x0000 subdevice=0x0000 vendor = 'Advanced Micro Devices, Inc. [AMD]' device = 'Raven/Raven2 Device 24: Function 1' class = bridge subclass = HOST-PCI hostb5@pci0:0:24:2: class=0x060000 rev=0x00 hdr=0x00 vendor=0x1022 device=0x15ea subvendor=0x0000 subdevice=0x0000 vendor = 'Advanced Micro Devices, Inc. [AMD]' device = 'Raven/Raven2 Device 24: Function 2' class = bridge subclass = HOST-PCI hostb6@pci0:0:24:3: class=0x060000 rev=0x00 hdr=0x00 vendor=0x1022 device=0x15eb subvendor=0x0000 subdevice=0x0000 vendor = 'Advanced Micro Devices, Inc. [AMD]' device = 'Raven/Raven2 Device 24: Function 3' class = bridge subclass = HOST-PCI hostb7@pci0:0:24:4: class=0x060000 rev=0x00 hdr=0x00 vendor=0x1022 device=0x15ec subvendor=0x0000 subdevice=0x0000 vendor = 'Advanced Micro Devices, Inc. [AMD]' device = 'Raven/Raven2 Device 24: Function 4' class = bridge subclass = HOST-PCI hostb8@pci0:0:24:5: class=0x060000 rev=0x00 hdr=0x00 vendor=0x1022 device=0x15ed subvendor=0x0000 subdevice=0x0000 vendor = 'Advanced Micro Devices, Inc. [AMD]' device = 'Raven/Raven2 Device 24: Function 5' class = bridge subclass = HOST-PCI hostb9@pci0:0:24:6: class=0x060000 rev=0x00 hdr=0x00 vendor=0x1022 device=0x15ee subvendor=0x0000 subdevice=0x0000 vendor = 'Advanced Micro Devices, Inc. [AMD]' device = 'Raven/Raven2 Device 24: Function 6' class = bridge subclass = HOST-PCI hostb10@pci0:0:24:7: class=0x060000 rev=0x00 hdr=0x00 vendor=0x1022 device=0x15ef subvendor=0x0000 subdevice=0x0000 vendor = 'Advanced Micro Devices, Inc. [AMD]' device = 'Raven/Raven2 Device 24: Function 7' class = bridge subclass = HOST-PCI iwm0@pci0:1:0:0: class=0x028000 rev=0x29 hdr=0x00 vendor=0x8086 device=0x2526 subvendor=0x8086 subdevice=0x0014 vendor = 'Intel Corporation' device = 'Wireless-AC 9260' class = network nvme0@pci0:2:0:0: class=0x010802 rev=0x00 hdr=0x00 vendor=0x15b7 device=0x5006 subvendor=0x15b7 subdevice=0x5006 vendor = 'Sandisk Corp' device = 'WD Black SN750 / PC SN730 NVMe SSD' class = mass storage subclass = NVM re0@pci0:3:0:0: class=0x020000 rev=0x0e hdr=0x00 vendor=0x10ec device=0x8168 subvendor=0x17aa subdevice=0x5126 vendor = 'Realtek Semiconductor Co., Ltd.' device = 'RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller' class = network subclass = ethernet none1@pci0:3:0:1: class=0x070002 rev=0x0e hdr=0x00 vendor=0x10ec device=0x816a subvendor=0x17aa subdevice=0x5126 vendor = 'Realtek Semiconductor Co., Ltd.' device = 'RTL8111xP UART' class = simple comms subclass = UART none2@pci0:3:0:2: class=0x070002 rev=0x0e hdr=0x00 vendor=0x10ec device=0x816b subvendor=0x17aa subdevice=0x5126 vendor = 'Realtek Semiconductor Co., Ltd.' device = 'RTL8111xP UART' class = simple comms subclass = UART none3@pci0:3:0:3: class=0x0c0701 rev=0x0e hdr=0x00 vendor=0x10ec device=0x816c subvendor=0x17aa subdevice=0x5126 vendor = 'Realtek Semiconductor Co., Ltd.' device = 'RTL8111xP IPMI interface' class = serial bus subclass = IPMI ehci0@pci0:3:0:4: class=0x0c0320 rev=0x0e hdr=0x00 vendor=0x10ec device=0x816d subvendor=0x17aa subdevice=0x5126 vendor = 'Realtek Semiconductor Co., Ltd.' device = 'RTL811x EHCI host controller' class = serial bus subclass = USB rtsx0@pci0:4:0:0: class=0xff0000 rev=0x01 hdr=0x00 vendor=0x10ec device=0x522a subvendor=0x17aa subdevice=0x5126 vendor = 'Realtek Semiconductor Co., Ltd.' device = 'RTS522A PCI Express Card Reader' vgapci0@pci0:5:0:0: class=0x030000 rev=0xd2 hdr=0x00 vendor=0x1002 device=0x15d8 subvendor=0x17aa subdevice=0x5126 vendor = 'Advanced Micro Devices, Inc. [AMD/ATI]' device = 'Picasso/Raven 2 [Radeon Vega Series / Radeon Vega Mobile Series]' class = display subclass = VGA hdac0@pci0:5:0:1: class=0x040300 rev=0x00 hdr=0x00 vendor=0x1002 device=0x15de subvendor=0x17aa subdevice=0x5126 vendor = 'Advanced Micro Devices, Inc. [AMD/ATI]' device = 'Raven/Raven2/Fenghuang HDMI/DP Audio Controller' class = multimedia subclass = HDA none4@pci0:5:0:2: class=0x108000 rev=0x00 hdr=0x00 vendor=0x1022 device=0x15df subvendor=0x17aa subdevice=0x5126 vendor = 'Advanced Micro Devices, Inc. [AMD]' device = 'Family 17h (Models 10h-1fh) Platform Security Processor' class = encrypt/decrypt xhci0@pci0:5:0:3: class=0x0c0330 rev=0x00 hdr=0x00 vendor=0x1022 device=0x15e0 subvendor=0x17aa subdevice=0x5126 vendor = 'Advanced Micro Devices, Inc. [AMD]' device = 'Raven USB 3.1' class = serial bus subclass = USB xhci1@pci0:5:0:4: class=0x0c0330 rev=0x00 hdr=0x00 vendor=0x1022 device=0x15e1 subvendor=0x17aa subdevice=0x5126 vendor = 'Advanced Micro Devices, Inc. [AMD]' device = 'Raven USB 3.1' class = serial bus subclass = USB none5@pci0:5:0:5: class=0x048000 rev=0x00 hdr=0x00 vendor=0x1022 device=0x15e2 subvendor=0x17aa subdevice=0x5126 vendor = 'Advanced Micro Devices, Inc. [AMD]' device = 'ACP/ACP3X/ACP6x Audio Coprocessor' class = multimedia hdac1@pci0:5:0:6: class=0x040300 rev=0x00 hdr=0x00 vendor=0x1022 device=0x15e3 subvendor=0x17aa subdevice=0x5126 vendor = 'Advanced Micro Devices, Inc. [AMD]' device = 'Family 17h/19h HD Audio Controller' class = multimedia subclass = HDA

DRM KMOD version drm-510-kmod-5.10.0

To Reproduce Steps to reproduce the behavior:

kldload amdgpu.ko

Screenshots If applicable, add screenshots to help explain your problem.

Additional context

<6>[drm] amdgpu kernel modesetting enabled. drmn0: on vgapci0 vgapci0: child drmn0 requested pci_enable_io vgapci0: child drmn0 requested pci_enable_io <6>[drm] initializing kernel modesetting (RAVEN 0x1002:0x15D8 0x17AA:0x5126 0xD2). drmn0: Trusted Memory Zone (TMZ) feature disabled as experimental (default) <6>[drm] register mmio base: 0xD0500000 <6>[drm] register mmio size: 524288 <6>[drm] add ip block number 0 <6>[drm] add ip block number 1 <6>[drm] add ip block number 2 <6>[drm] add ip block number 3 <6>[drm] add ip block number 4 <6>[drm] add ip block number 5 <6>[drm] add ip block number 6 <6>[drm] add ip block number 7 <6>[drm] add ip block number 8 drmn0: successfully loaded firmware image 'amdgpu/picasso_gpu_info.bin' drmn0: Fetched VBIOS from VFCT <6>amdgpu: ATOM BIOS: 113-PICASSO-114 drmn0: successfully loaded firmware image 'amdgpu/picasso_sdma.bin' <6>[drm] VCN decode is enabled in VM mode <6>[drm] VCN encode is enabled in VM mode <6>[drm] JPEG decode is enabled in VM mode <6>[drm] vm size is 262144 GB, 4 levels, block size is 9-bit, fragment size is 9-bit drmn0: VRAM: 2048M 0x000000F400000000 - 0x000000F47FFFFFFF (2048M used) drmn0: GART: 1024M 0x0000000000000000 - 0x000000003FFFFFFF drmn0: AGP: 267419648M 0x000000F800000000 - 0x0000FFFFFFFFFFFF <6>[drm] Detected VRAM RAM=2048M, BAR=2048M <6>[drm] RAM width 128bits DDR4 <6>[TTM] Zone kernel: Available graphics memory: 7259850 KiB <6>[TTM] Zone dma32: Available graphics memory: 2097152 KiB <6>[TTM] Initializing pool allocator <6>[drm] amdgpu: 2048M of VRAM memory ready <6>[drm] amdgpu: 3072M of GTT memory ready. <6>[drm] GART: num cpu pages 262144, num gpu pages 262144 <6>[drm] PCIE GART of 1024M enabled (table at 0x000000F400900000). drmn0: successfully loaded firmware image 'amdgpu/picasso_asd.bin' drmn0: successfully loaded firmware image 'amdgpu/picasso_ta.bin' drmn0: successfully loaded firmware image 'amdgpu/picasso_pfp.bin' drmn0: successfully loaded firmware image 'amdgpu/picasso_me.bin' drmn0: successfully loaded firmware image 'amdgpu/picasso_ce.bin' drmn0: successfully loaded firmware image 'amdgpu/picasso_rlc.bin' drmn0: successfully loaded firmware image 'amdgpu/picasso_mec.bin' drmn0: successfully loaded firmware image 'amdgpu/picasso_mec2.bin' <6>amdgpu: hwmgr_sw_init smu backed is smu10_smu drmn0: successfully loaded firmware image 'amdgpu/raven_dmcu.bin' drmn0: successfully loaded firmware image 'amdgpu/picasso_vcn.bin' <6>[drm] Found VCN firmware Version ENC: 1.12 DEC: 2 VEP: 0 Revision: 1 <6>[drm] PSP loading VCN firmware <6>[drm] reserve 0x400000 from 0xf47fc00000 for PSP TMR drmn0: RAS: optional ras ta ucode is not available drmn0: RAP: optional rap ta ucode is not available <6>[drm] kiq ring mec 2 pipe 1 q 0 <6>[drm] DM_PPLIB: values for F clock <6>[drm] DM_PPLIB: 400000 in kHz, 2924 in mV <6>[drm] DM_PPLIB: 933000 in kHz, 3249 in mV <6>[drm] DM_PPLIB: 1067000 in kHz, 3924 in mV <6>[drm] DM_PPLIB: 1200000 in kHz, 4074 in mV <6>[drm] DM_PPLIB: values for DCF clock <6>[drm] DM_PPLIB: 300000 in kHz, 2924 in mV <6>[drm] DM_PPLIB: 600000 in kHz, 3249 in mV <6>[drm] DM_PPLIB: 626000 in kHz, 3924 in mV <6>[drm] DM_PPLIB: 654000 in kHz, 4074 in mV <6>[drm] Display Core initialized with v3.2.104! lkpi_iic0: on drmn0 iicbus0: on lkpi_iic0 iicsmb0: on iicbus0 smbus1: on iicsmb0 smb1: on smbus1 iic0: on iicbus0 lkpi_iic1: on drmn0 iicbus1: on lkpi_iic1 iicsmb1: on iicbus1 smbus2: on iicsmb1 smb2: on smbus2 iic1: on iicbus1 lkpi_iic2: on drmn0 iicbus2: on lkpi_iic2 iicsmb2: on iicbus2 smbus3: on iicsmb2 smb3: on smbus3 iic2: on iicbus2 lkpi_iic3: on drmn0 iicbus3: on lkpi_iic3 iicsmb3: on iicbus3 smbus4: on iicsmb3 smb4: on smbus4 iic3: on iicbus3 <6>[drm] DM_MST: Differing MST start on aconnector: 0xfffff8018e74f000 [id: 87] <6>[drm] VCN decode and encode initialized successfully(under SPG Mode). drmn0: SE 1, SH per SE 1, CU per SH 11, active_cu_number 8 <6>[drm] fb mappable at 0x3BFBCA000 <6>[drm] vram apper at 0x3BF000000 <6>[drm] size 8294400 <6>[drm] fb depth is 24 <6>[drm] pitch is 7680 VT: Replacing driver "efifb" with new "fb". start FB_INFO: type=11 height=1080 width=1920 depth=32 pbase=0x3bfbca000 vbase=0xfffffe01061ca000 name=drmn0 flags=0x0 stride=7680 bpp=32 end FB_INFO drmn0: ring gfx uses VM inv eng 0 on hub 0 drmn0: ring comp_1.0.0 uses VM inv eng 1 on hub 0 drmn0: ring comp_1.1.0 uses VM inv eng 4 on hub 0 drmn0: ring comp_1.2.0 uses VM inv eng 5 on hub 0 drmn0: ring comp_1.3.0 uses VM inv eng 6 on hub 0 drmn0: ring comp_1.0.1 uses VM inv eng 7 on hub 0 drmn0: ring comp_1.1.1 uses VM inv eng 8 on hub 0 drmn0: ring comp_1.2.1 uses VM inv eng 9 on hub 0 drmn0: ring comp_1.3.1 uses VM inv eng 10 on hub 0 drmn0: ring kiq_2.1.0 uses VM inv eng 11 on hub 0 drmn0: ring sdma0 uses VM inv eng 0 on hub 1 drmn0: ring vcn_dec uses VM inv eng 1 on hub 1 drmn0: ring vcn_enc0 uses VM inv eng 4 on hub 1 drmn0: ring vcn_enc1 uses VM inv eng 5 on hub 1 drmn0: ring jpeg_dec uses VM inv eng 6 on hub 1 vgapci0: child drmn0 requested pci_get_powerstate sysctl_warn_reuse: can't re-use a leaf (hw.dri.debug)! <6>[drm] Initialized amdgpu 3.40.0 20150101 for drmn0 on minor 0 fbd0 on drmn0 WARNING: Device "fb" is Giant locked and may be deleted before FreeBSD 14.0. Fatal trap 12: page fault while in kernel mode cpuid = 4; apic id = 04 fault virtual address = 0x1e fault code = supervisor write data, page not present instruction pointer = 0x20:0xffffffff806702c6 stack pointer = 0x28:0xfffffe00b4765aa0 frame pointer = 0x28:0xfffffe00b4765ad0 code segment = base rx0, 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_long_wq_6) trap number = 12 WARNING !drm_modeset_is_locked(&crtc->mutex) failed at /usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10_4/drivers/gpu/drm/drm_atomic_helper.c:619 WARNING !drm_modeset_is_locked(&crtc->mutex) failed at /usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10_4/drivers/gpu/drm/drm_atomic_helper.c:619 WARNING !drm_modeset_is_locked(&crtc->mutex) failed at /usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10_4/drivers/gpu/drm/drm_atomic_helper.c:619 WARNING !drm_modeset_is_locked(&crtc->mutex) failed at /usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10_4/drivers/gpu/drm/drm_atomic_helper.c:619 WARNING !drm_modeset_is_locked(&dev->mode_config.connection_mutex) failed at /usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10_4/drivers/gpu/drm/drm_atomic_helper.c:669 WARNING !drm_modeset_is_locked(&plane->mutex) failed at /usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10_4/drivers/gpu/drm/drm_atomic_helper.c:894 WARNING !drm_modeset_is_locked(&plane->mutex) failed at /usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10_4/drivers/gpu/drm/drm_atomic_helper.c:894 WARNING !drm_modeset_is_locked(&plane->mutex) failed at /usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10_4/drivers/gpu/drm/drm_atomic_helper.c:894 WARNING !drm_modeset_is_locked(&plane->mutex) failed at /usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10_4/drivers/gpu/drm/drm_atomic_helper.c:894 WARNING !drm_modeset_is_locked(&plane->mutex) failed at /usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10_4/drivers/gpu/drm/drm_atomic_helper.c:894 WARNING !drm_modeset_is_locked(&plane->mutex) failed at /usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10_4/drivers/gpu/drm/drm_atomic_helper.c:894 WARNING !drm_modeset_is_locked(&plane->mutex) failed at /usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10_4/drivers/gpu/drm/drm_atomic_helper.c:894 WARNING !drm_modeset_is_locked(&plane->mutex) failed at /usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10_4/drivers/gpu/drm/drm_atomic_helper.c:894 WARNING !drm_modeset_is_locked(&plane->mutex) failed at /usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10_4/drivers/gpu/drm/drm_atomic_helper.c:894 panic: page fault cpuid = 4 time = 1651491261 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00b4765860 vpanic() at vpanic+0x17f/frame 0xfffffe00b47658b0 panic() at panic+0x43/frame 0xfffffe00b4765910 trap_fatal() at trap_fatal+0x385/frame 0xfffffe00b4765970 trap_pfault() at trap_pfault+0x4f/frame 0xfffffe00b47659d0 calltrap() at calltrap+0x8/frame 0xfffffe00b47659d0 --- trap 0xc, rip = 0xffffffff806702c6, rsp = 0xfffffe00b4765aa0, rbp = 0xfffffe00b4765ad0 --- fbd_register() at fbd_register+0xe6/frame 0xfffffe00b4765ad0 device_attach() at device_attach+0x3c3/frame 0xfffffe00b4765b20 bus_generic_attach() at bus_generic_attach+0x4b/frame 0xfffffe00b4765b50 lkpi_i2c_add_adapter() at lkpi_i2c_add_adapter+0x5b/frame 0xfffffe00b4765b70 drm_dp_port_set_pdt() at drm_dp_port_set_pdt+0x1e9/frame 0xfffffe00b4765bc0 drm_dp_send_link_address() at drm_dp_send_link_address+0x89a/frame 0xfffffe00b4765cf0 drm_dp_check_and_send_link_address() at drm_dp_check_and_send_link_address+0x27/frame 0xfffffe00b4765d30 drm_dp_mst_link_probe_work() at drm_dp_mst_link_probe_work+0x268/frame 0xfffffe00b4765de0 linux_work_fn() at linux_work_fn+0xe3/frame 0xfffffe00b4765e40 taskqueue_run_locked() at taskqueue_run_locked+0x181/frame 0xfffffe00b4765ec0 taskqueue_thread_loop() at taskqueue_thread_loop+0xc2/frame 0xfffffe00b4765ef0 fork_exit() at fork_exit+0x7e/frame 0xfffffe00b4765f30 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe00b4765f30 --- trap 0, rip = 0, rsp = 0, rbp = 0 --- KDB: enter: panic
jownit commented 2 years ago

Additional info: 5.5 worked 5.7 paniced in the same way as 5.10

Now I built drm-54-kmod-5.4.144 on FreeBSD 14.0-CURRENT #23 main-n255143-271f6d52a60 and it works.

So it broke between 5.5 and 5.7.

evadot commented 2 years ago

I don't understand why you have 'fbd0 on drmn0' printed. Or more exactly why I don't have it ... Is it GENERIC without any tuning ?

jownit commented 2 years ago

GENERIC-NODEBUG no tuning

debdrup commented 2 years ago

As a follow-up from #166 above, core.txt can be found here.

evadot commented 2 years ago

So, I believe this is happening when one have multiple screen with different resolution. I'll try to debug that soon.

jownit commented 2 years ago

So, I believe this is happening when one have multiple screen with different resolution. I'll try to debug that soon.

This is true in my setup. The ThinkPad has an internal screen with 1920x1080, and there is a 4K monitor and a 1920x1200 monitor connected to the dock.

evadot commented 2 years ago

Could you confirm that with only the laptop screen everything work ? I'm not at home this week so testing multiple display is hard right now for me.

jownit commented 2 years ago

Could you confirm that with only the laptop screen everything work ? I'm not at home this week so testing multiple display is hard right now for me.

Confirmed. Loading the module with the laptop undocked it works. Docking it immediately panics. I also tested having it docked with the external monitors unplugged, it works. If I plug in a monitor in, it panics.

evadot commented 2 years ago

Thanks for confirmation, this will help me to fix this quickly when I'm back :)

evadot commented 2 years ago

@debdrup @jownit Are both your docks usb-c ? I cannot reproduce here with multiple screen and different resolution on multiple machines.

jownit commented 2 years ago

@debdrup @jownit Are both your docks usb-c ? I cannot reproduce here with multiple screen and different resolution on multiple machines.

Mine is. I could try plugging in a monitor directly in the HDMI port on the laptop and see what results I get.

jownit commented 2 years ago

@debdrup @jownit Are both your docks usb-c ? I cannot reproduce here with multiple screen and different resolution on multiple machines.

Mine is. I could try plugging in a monitor directly in the HDMI port on the laptop and see what results I get.

I just tried that. With a 4K monitor plugged in to the laptops HDMI port, it works. Plugging in another monitor in the dock displayport (which is USB-C) panics.

So it seems the problem is with USB-C. Loading drm-54-kmod works.

debdrup commented 2 years ago

@debdrup @jownit Are both your docks usb-c ? I cannot reproduce here with multiple screen and different resolution on multiple machines.

I'm using this dock.

@debdrup @jownit Are both your docks usb-c ? I cannot reproduce here with multiple screen and different resolution on multiple machines.

Mine is. I could try plugging in a monitor directly in the HDMI port on the laptop and see what results I get.

I just tried that. With a 4K monitor plugged in to the laptops HDMI port, it works. Plugging in another monitor in the dock displayport (which is USB-C) panics.

So it seems the problem is with USB-C. Loading drm-54-kmod works.

Should I try to reproduce this too? I'd need to get a USB-C to DisplayPort connector in order to try it, unless I can locate a spare HDMI cable that isn't embedded in a wall.

evadot commented 2 years ago

So, I can't reproduce with an USB-C HDMI dongle. I don't have a dock here.

jownit commented 2 years ago

So, I can't reproduce with an USB-C HDMI dongle. I don't have a dock here.

Anything I can do to help debugging?

evadot commented 2 years ago

Forgot that I had a dock on my work laptop. I managed to find the problem and https://cgit.freebsd.org/src/commit/?id=3cbf6518d6eea08e0fbe6d7c609debac5ab31992 fixes this for me. Please let me know if that fixes it for you too.

jownit commented 2 years ago

I did not fix it for me. I did get a different panic though:

<6>[drm] amdgpu kernel modesetting enabled. drmn0: on vgapci0 vgapci0: child drmn0 requested pci_enable_io vgapci0: child drmn0 requested pci_enable_io <6>[drm] initializing kernel modesetting (RAVEN 0x1002:0x15D8 0x17AA:0x5126 0xD2). drmn0: Trusted Memory Zone (TMZ) feature disabled as experimental (default) <6>[drm] register mmio base: 0xD0500000 <6>[drm] register mmio size: 524288 <6>[drm] add ip block number 0 <6>[drm] add ip block number 1 <6>[drm] add ip block number 2 <6>[drm] add ip block number 3 <6>[drm] add ip block number 4 <6>[drm] add ip block number 5 <6>[drm] add ip block number 6 <6>[drm] add ip block number 7 <6>[drm] add ip block number 8 drmn0: successfully loaded firmware image 'amdgpu/picasso_gpu_info.bin' drmn0: Fetched VBIOS from VFCT <6>amdgpu: ATOM BIOS: 113-PICASSO-114 drmn0: successfully loaded firmware image 'amdgpu/picasso_sdma.bin' <6>[drm] VCN decode is enabled in VM mode <6>[drm] VCN encode is enabled in VM mode <6>[drm] JPEG decode is enabled in VM mode <6>[drm] vm size is 262144 GB, 4 levels, block size is 9-bit, fragment size is 9-bit drmn0: VRAM: 2048M 0x000000F400000000 - 0x000000F47FFFFFFF (2048M used) drmn0: GART: 1024M 0x0000000000000000 - 0x000000003FFFFFFF drmn0: AGP: 267419648M 0x000000F800000000 - 0x0000FFFFFFFFFFFF <6>[drm] Detected VRAM RAM=2048M, BAR=2048M <6>[drm] RAM width 128bits DDR4 <6>[TTM] Zone kernel: Available graphics memory: 7259850 KiB <6>[TTM] Zone dma32: Available graphics memory: 2097152 KiB <6>[TTM] Initializing pool allocator <6>[drm] amdgpu: 2048M of VRAM memory ready <6>[drm] amdgpu: 3072M of GTT memory ready. <6>[drm] GART: num cpu pages 262144, num gpu pages 262144 <6>[drm] PCIE GART of 1024M enabled (table at 0x000000F400900000). drmn0: successfully loaded firmware image 'amdgpu/picasso_asd.bin' drmn0: successfully loaded firmware image 'amdgpu/picasso_ta.bin' drmn0: successfully loaded firmware image 'amdgpu/picasso_pfp.bin' drmn0: successfully loaded firmware image 'amdgpu/picasso_me.bin' drmn0: successfully loaded firmware image 'amdgpu/picasso_ce.bin' drmn0: successfully loaded firmware image 'amdgpu/picasso_rlc.bin' drmn0: successfully loaded firmware image 'amdgpu/picasso_mec.bin' drmn0: successfully loaded firmware image 'amdgpu/picasso_mec2.bin' <6>amdgpu: hwmgr_sw_init smu backed is smu10_smu drmn0: successfully loaded firmware image 'amdgpu/raven_dmcu.bin' drmn0: successfully loaded firmware image 'amdgpu/picasso_vcn.bin' <6>[drm] Found VCN firmware Version ENC: 1.12 DEC: 2 VEP: 0 Revision: 1 drmn0: Will use PSP to load VCN firmware <6>[drm] reserve 0x400000 from 0xf47fc00000 for PSP TMR drmn0: RAS: optional ras ta ucode is not available drmn0: RAP: optional rap ta ucode is not available <6>[drm] kiq ring mec 2 pipe 1 q 0 <6>[drm] DM_PPLIB: values for F clock <6>[drm] DM_PPLIB: 400000 in kHz, 2924 in mV <6>[drm] DM_PPLIB: 933000 in kHz, 3249 in mV <6>[drm] DM_PPLIB: 1067000 in kHz, 3924 in mV <6>[drm] DM_PPLIB: 1200000 in kHz, 4074 in mV <6>[drm] DM_PPLIB: values for DCF clock <6>[drm] DM_PPLIB: 300000 in kHz, 2924 in mV <6>[drm] DM_PPLIB: 600000 in kHz, 3249 in mV <6>[drm] DM_PPLIB: 626000 in kHz, 3924 in mV <6>[drm] DM_PPLIB: 654000 in kHz, 4074 in mV <6>[drm] Display Core initialized with v3.2.104! lkpi_iic0: on drmn0 iicbus0: on lkpi_iic0 iicsmb0: on iicbus0 smbus1: on iicsmb0 smb1: on smbus1 iic0: on iicbus0 lkpi_iic1: on drmn0 iicbus1: on lkpi_iic1 iicsmb1: on iicbus1 smbus2: on iicsmb1 smb2: on smbus2 iic1: on iicbus1 lkpi_iic2: on drmn0 iicbus2: on lkpi_iic2 iicsmb2: on iicbus2 smbus3: on iicsmb2 smb3: on smbus3 iic2: on iicbus2 lkpi_iic3: on drmn0 iicbus3: on lkpi_iic3 iicsmb3: on iicbus3 smbus4: on iicsmb3 smb4: on smbus4 iic3: on iicbus3 <6>[drm] DM_MST: Differing MST start on aconnector: 0xfffff8022a971000 [id: 87] <6>[drm] VCN decode and encode initialized successfully(under SPG Mode). drmn0: SE 1, SH per SE 1, CU per SH 11, active_cu_number 8 <6>[drm] fb mappable at 0x3BFBCA000 <6>[drm] vram apper at 0x3BF000000 <6>[drm] size 8294400 <6>[drm] fb depth is 24 <6>[drm] pitch is 7680 VT: Replacing driver "efifb" with new "fb". start FB_INFO: type=11 height=1080 width=1920 depth=32 pbase=0x3bfbca000 vbase=0xfffffe01067ca000 name=drmn0 flags=0x0 stride=7680 bpp=32 end FB_INFO drmn0: ring gfx uses VM inv eng 0 on hub 0 drmn0: ring comp_1.0.0 uses VM inv eng 1 on hub 0 drmn0: ring comp_1.1.0 uses VM inv eng 4 on hub 0 drmn0: ring comp_1.2.0 uses VM inv eng 5 on hub 0 drmn0: ring comp_1.3.0 uses VM inv eng 6 on hub 0 drmn0: ring comp_1.0.1 uses VM inv eng 7 on hub 0 drmn0: ring comp_1.1.1 uses VM inv eng 8 on hub 0 drmn0: ring comp_1.2.1 uses VM inv eng 9 on hub 0 drmn0: ring comp_1.3.1 uses VM inv eng 10 on hub 0 drmn0: ring kiq_2.1.0 uses VM inv eng 11 on hub 0 drmn0: ring sdma0 uses VM inv eng 0 on hub 1 drmn0: ring vcn_dec uses VM inv eng 1 on hub 1 drmn0: ring vcn_enc0 uses VM inv eng 4 on hub 1 drmn0: ring vcn_enc1 uses VM inv eng 5 on hub 1 drmn0: ring jpeg_dec uses VM inv eng 6 on hub 1 vgapci0: child drmn0 requested pci_get_powerstate sysctl_warn_reuse: can't re-use a leaf (hw.dri.debug)! lkpi_iic4: on drm1 iicbus4: on lkpi_iic4 iicsmb4: on iicbus4 smbus5: on iicsmb4 smb5: on smbus5 iic4: on iicbus4 lkpi_iic5: on drm3 iicbus5: on lkpi_iic5 iicsmb5: on iicbus5 smbus6: on iicsmb5 smb6: on smbus6 iic5: on iicbus5 lkpi_iic6: on drm4 iicbus6: on lkpi_iic6 iicsmb6: on iicbus6 smbus7: on iicsmb6 smb7: on smbus7 iic6: on iicbus6 <6>[drm] Initialized amdgpu 3.40.0 20150101 for drmn0 on minor 0 fbd0 on drmn0 device_attach: fbd0 attach returned 6 lkpi_iic7: on drmn0 iicbus7: on lkpi_iic7 iicsmb7: on iicbus7 smbus8: on iicsmb7 smb8: on smbus8 iic7: on iicbus7 fbd0 on drmn0 device_attach: fbd0 attach returned 6 lkpi_iic8: on drmn0 iicbus8: on lkpi_iic8 iicsmb8: on iicbus8 smbus9: on iicsmb8 smb9: on smbus9 iic8: on iicbus8 [drm ERROR :drm_dp_send_dpcd_read] mstb 0xfffff8022a96fd00 port 2: DPCD read on addr 0x60 for 1 bytes NAKed Fatal trap 12: page fault while in kernel mode cpuid = 4; apic id = 04 fault virtual address = 0x448 fault code = supervisor read data, page not present instruction pointer = 0x20:0xffffffff80bf4cb8 stack pointer = 0x0:0xfffffe00b476a750 frame pointer = 0x0:0xfffffe00b476a7f0 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_long_wq_5) trap number = 12 WARNING !mutex_is_locked(&mgr->qlock) failed at /usr/ports/graphics/drm-510-kmod/work/drm-kmod-drm_v5.10.113_2/drivers/gpu/drm/drm_dp_mst_topology.c:2895 kernel trap 12 with interrupts disabled Fatal trap 12: page fault while in kernel mode cpuid = 4; apic id = 04 fault virtual address = 0x28 fault code = supervisor write data, page not present instruction pointer = 0x20:0xffffffff80c48e65 stack pointer = 0x0:0xfffffe00b4769ae0 frame pointer = 0x0:0xfffffe00b4769b10 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_long_wq_5) trap number = 12 panic: page fault cpuid = 4 time = 1655824201 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00b47698a0 vpanic() at vpanic+0x151/frame 0xfffffe00b47698f0 panic() at panic+0x43/frame 0xfffffe00b4769950 trap_fatal() at trap_fatal+0x387/frame 0xfffffe00b47699b0 trap_pfault() at trap_pfault+0x4f/frame 0xfffffe00b4769a10 calltrap() at calltrap+0x8/frame 0xfffffe00b4769a10 --- trap 0xc, rip = 0xffffffff80c48e65, rsp = 0xfffffe00b4769ae0, rbp = 0xfffffe00b4769b10 --- sleepq_add() at sleepq_add+0xb5/frame 0xfffffe00b4769b10 linux_add_to_sleepqueue() at linux_add_to_sleepqueue+0x35/frame 0xfffffe00b4769b60 linux_wait_event_common() at linux_wait_event_common+0x11e/frame 0xfffffe00b4769ba0 drm_dp_mst_wait_tx_reply() at drm_dp_mst_wait_tx_reply+0x1a8/frame 0xfffffe00b4769c20 drm_dp_payload_send_msg() at drm_dp_payload_send_msg+0x34e/frame 0xfffffe00b4769d00 drm_dp_update_payload_part2() at drm_dp_update_payload_part2+0x1c6/frame 0xfffffe00b4769d40 dm_helpers_dp_mst_send_payload_allocation() at dm_helpers_dp_mst_send_payload_allocation+0x54/frame 0xfffffe00b4769d70 dc_link_allocate_mst_payload() at dc_link_allocate_mst_payload+0x2e3/frame 0xfffffe00b4769dd0 core_link_enable_stream() at core_link_enable_stream+0x69f/frame 0xfffffe00b4769e30 dce110_apply_ctx_to_hw() at dce110_apply_ctx_to_hw+0x62d/frame 0xfffffe00b4769f00 dc_commit_state() at dc_commit_state+0x9d8/frame 0xfffffe00b4769f90 amdgpu_dm_atomic_commit_tail() at amdgpu_dm_atomic_commit_tail+0x592/frame 0xfffffe00b476a2d0 commit_tail() at commit_tail+0xa4/frame 0xfffffe00b476a320 drm_atomic_helper_commit() at drm_atomic_helper_commit+0x1e6/frame 0xfffffe00b476a360 drm_client_modeset_commit_atomic() at drm_client_modeset_commit_atomic+0x158/frame 0xfffffe00b476a3d0 drm_client_modeset_commit_locked() at drm_client_modeset_commit_locked+0x74/frame 0xfffffe00b476a410 drm_client_modeset_commit() at drm_client_modeset_commit+0x21/frame 0xfffffe00b476a430 drm_fb_helper_restore_fbdev_mode_unlocked() at drm_fb_helper_restore_fbdev_mode_unlocked+0x81/frame 0xfffffe00b476a460 vt_kms_postswitch() at vt_kms_postswitch+0x167/frame 0xfffffe00b476a490 vt_window_switch() at vt_window_switch+0x2d4/frame 0xfffffe00b476a4d0 vtterm_cngrab() at vtterm_cngrab+0x4f/frame 0xfffffe00b476a4f0 cngrab() at cngrab+0x26/frame 0xfffffe00b476a510 vpanic() at vpanic+0xf0/frame 0xfffffe00b476a560 panic() at panic+0x43/frame 0xfffffe00b476a5c0 trap_fatal() at trap_fatal+0x387/frame 0xfffffe00b476a620 trap_pfault() at trap_pfault+0x4f/frame 0xfffffe00b476a680 calltrap() at calltrap+0x8/frame 0xfffffe00b476a680 --- trap 0xc, rip = 0xffffffff80bf4cb8, rsp = 0xfffffe00b476a750, rbp = 0xfffffe00b476a7f0 --- _sx_xlock_hard() at _sx_xlock_hard+0x178/frame 0xfffffe00b476a7f0 compute_mst_dsc_configs_for_state() at compute_mst_dsc_configs_for_state+0x14f/frame 0xfffffe00b476aad0 amdgpu_dm_atomic_check() at amdgpu_dm_atomic_check+0x9a6/frame 0xfffffe00b476ab50 drm_atomic_check_only() at drm_atomic_check_only+0x3fc/frame 0xfffffe00b476abd0 drm_atomic_commit() at drm_atomic_commit+0x13/frame 0xfffffe00b476abf0 drm_client_modeset_commit_atomic() at drm_client_modeset_commit_atomic+0x158/frame 0xfffffe00b476ac60 drm_client_modeset_commit_locked() at drm_client_modeset_commit_locked+0x74/frame 0xfffffe00b476aca0 drm_client_modeset_commit() at drm_client_modeset_commit+0x21/frame 0xfffffe00b476acc0 drm_fb_helper_restore_fbdev_mode_unlocked() at drm_fb_helper_restore_fbdev_mode_unlocked+0x81/frame 0xfffffe00b476acf0 drm_fb_helper_hotplug_event() at drm_fb_helper_hotplug_event+0x133/frame 0xfffffe00b476ad10 drm_kms_helper_hotplug_event() at drm_kms_helper_hotplug_event+0x23/frame 0xfffffe00b476ad30 drm_dp_mst_link_probe_work() at drm_dp_mst_link_probe_work+0x2bd/frame 0xfffffe00b476ade0 linux_work_fn() at linux_work_fn+0xe3/frame 0xfffffe00b476ae40 taskqueue_run_locked() at taskqueue_run_locked+0x191/frame 0xfffffe00b476aec0 taskqueue_thread_loop() at taskqueue_thread_loop+0xc3/frame 0xfffffe00b476aef0 fork_exit() at fork_exit+0x7e/frame 0xfffffe00b476af30 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe00b476af30 --- trap 0xb8fcd0d4, rip = 0xb0bbd87bbcfbd87a, rsp = 0x9fac43229adc4336, rbp = 0x23b36f5537f36f18 --- KDB: enter: panic
evadot commented 2 years ago

That's not the same problem. Can you open an new issue please ? I'll wait for @debdrup to confirm or not that it fixed it for him before closing this one.

jownit commented 2 years ago

Issue #181 opened.

evadot commented 1 year ago

Closing this one now, @debdrup please re-open if my patch didn't fixed this for you, what @jownit is seeing is another problem.