freebsd / drm-kmod

drm driver for FreeBSD
155 stars 69 forks source link

graphics/drm-510-kmod panic with amdgpu #181

Closed jownit closed 2 years ago

jownit commented 2 years ago

Describe the bug Kernel panics when loading amdgpu and external monitor attached via USB-C dock

FreeBSD version FreeBSD joxan 14.0-CURRENT FreeBSD 14.0-CURRENT #38 main-n256222-3cbf6518d6e-dirty: Tue Jun 21 16:29:47 CEST 2022 root@xxx:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG amd64

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.113_1

To Reproduce Steps to reproduce the behavior: Connect external monitor to USB-C dock. 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 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

I think that the underlying problem is i2c related. Something i2c doesn't work and the full struct isn't init so we fail later when we try to use it.

jownit commented 2 years ago

I just updated my laptop and thought I could try drm-510-kmod again just for the sake of it. To my surprise it works now... drm-510-kmod-5.10.113_1 on 14.0-CURRENT #41 main-n256399-454adf0fa4d-dirty

dmesg: [drm] amdgpu kernel modesetting enabled. drmn0: on vgapci0 vgapci0: child drmn0 requested pci_enable_io vgapci0: child drmn0 requested pci_enable_io [drm] initializing kernel modesetting (RAVEN 0x1002:0x15D8 0x17AA:0x5126 0xD2). drmn0: Trusted Memory Zone (TMZ) feature disabled as experimental (default) [drm] register mmio base: 0xD0500000 [drm] register mmio size: 524288 [drm] add ip block number 0 [drm] add ip block number 1 [drm] add ip block number 2 [drm] add ip block number 3 [drm] add ip block number 4 [drm] add ip block number 5 [drm] add ip block number 6 [drm] add ip block number 7 [drm] add ip block number 8 drmn0: successfully loaded firmware image 'amdgpu/picasso_gpu_info.bin' drmn0: Fetched VBIOS from VFCT amdgpu: ATOM BIOS: 113-PICASSO-114 drmn0: successfully loaded firmware image 'amdgpu/picasso_sdma.bin' [drm] VCN decode is enabled in VM mode [drm] VCN encode is enabled in VM mode [drm] JPEG decode is enabled in VM mode [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 [drm] Detected VRAM RAM=2048M, BAR=2048M [drm] RAM width 128bits DDR4 [TTM] Zone kernel: Available graphics memory: 7259850 KiB [TTM] Zone dma32: Available graphics memory: 2097152 KiB [TTM] Initializing pool allocator [drm] amdgpu: 2048M of VRAM memory ready [drm] amdgpu: 3072M of GTT memory ready. [drm] GART: num cpu pages 262144, num gpu pages 262144 [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' 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' [drm] Found VCN firmware Version ENC: 1.12 DEC: 2 VEP: 0 Revision: 1 drmn0: Will use PSP to load VCN firmware [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 [drm] kiq ring mec 2 pipe 1 q 0 [drm] DM_PPLIB: values for F clock [drm] DM_PPLIB: 400000 in kHz, 2924 in mV [drm] DM_PPLIB: 933000 in kHz, 3249 in mV [drm] DM_PPLIB: 1067000 in kHz, 3924 in mV [drm] DM_PPLIB: 1200000 in kHz, 4074 in mV [drm] DM_PPLIB: values for DCF clock [drm] DM_PPLIB: 300000 in kHz, 2924 in mV [drm] DM_PPLIB: 600000 in kHz, 3249 in mV [drm] DM_PPLIB: 626000 in kHz, 3924 in mV [drm] DM_PPLIB: 654000 in kHz, 4074 in mV [drm] Display Core initialized with v3.2.104! lkpi_iic0: on drmn0 iicbus0: on lkpi_iic0 iic0: <I2C generic I/O> on iicbus0 lkpi_iic1: on drmn0 iicbus1: on lkpi_iic1 iic1: <I2C generic I/O> on iicbus1 lkpi_iic2: on drmn0 iicbus2: on lkpi_iic2 iic2: <I2C generic I/O> on iicbus2 lkpi_iic3: on drmn0 iicbus3: on lkpi_iic3 iic3: <I2C generic I/O> on iicbus3 [drm] DM_MST: Differing MST start on aconnector: 0xfffff8003bcad000 [id: 87] [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 [drm] fb mappable at 0x3BFBCA000 [drm] vram apper at 0x3BF000000 [drm] size 8294400 [drm] fb depth is 24 [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=0xfffffe01021ca000 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 iic4: <I2C generic I/O> on iicbus4 lkpi_iic5: on drm3 iicbus5: on lkpi_iic5 iic5: <I2C generic I/O> on iicbus5 lkpi_iic6: on drm4 iicbus6: on lkpi_iic6 iic6: <I2C generic I/O> on iicbus6 [drm] Initialized amdgpu 3.40.0 20150101 for drmn0 on minor 0 amdsmn0: <AMD Family 17h System Management Network> on hostb0 amdtemp0: on hostb0 Cuse v0.1.36 @ /dev/cuse iicsmb0: on iicbus0 iicsmb1: on iicbus1 iicsmb2: on iicbus2 iicsmb3: on iicbus3 iicsmb4: on iicbus4 iicsmb5: on iicbus5 iicsmb6: on iicbus6 smbus0: on iicsmb0 smb0: <SMBus generic I/O> on smbus0 smbus1: on iicsmb1 smb1: <SMBus generic I/O> on smbus1 smbus2: on iicsmb2 smb2: <SMBus generic I/O> on smbus2 smbus3: on iicsmb3 smb3: <SMBus generic I/O> on smbus3 smbus4: on iicsmb4 smb4: <SMBus generic I/O> on smbus4 smbus5: on iicsmb5 smb5: <SMBus generic I/O> on smbus5 smbus6: on iicsmb6 smb6: <SMBus generic I/O> on smbus6 WARNING: Device "spkr" is Giant locked and may be deleted before FreeBSD 14.0. driver bug: Unable to set devclass (class: ppc devname: (unknown)) driver bug: Unable to set devclass (class: ppc devname: (unknown)) acpi_ibm0: on acpi0 acpi_ibm0: Firmware version is 0x200 fbd0 on drmn0 device_attach: fbd0 attach returned 6 lkpi_iic7: on drmn0 iicbus7: on lkpi_iic7 iic7: <I2C generic I/O> on iicbus7 iicsmb7: on iicbus7 smbus7: on iicsmb7 smb7: <SMBus generic I/O> on smbus7 Intel(R) Wireless WiFi based driver for FreeBSD intsmb0: at device 20.0 on pci0 smbus8: on intsmb0 smb8: <SMBus generic I/O> on smbus8 iwm0: <Intel(R) Dual Band Wireless AC 9260> at device 0.0 on pci1 iwm0: hw rev 0x320, fw ver 34.3125811985.0, address 28:7f:cf:f8:6f:06 acpi_wmi0: on acpi0 acpi_wmi0: Embedded MOF found ACPI: \134_SB.WMIW.WQFE: 1 arguments were passed to a non-method ACPI object (Buffer) (20220331/nsarguments-361) acpi_wmi1: on acpi0 acpi_wmi1: Embedded MOF found ACPI: \134_SB.WMI1.WQBA: 1 arguments were passed to a non-method ACPI object (Buffer) (20220331/nsarguments-361) acpi_wmi2: on acpi0 acpi_wmi2: Embedded MOF found ACPI: \134_SB.WMI2.WQBB: 1 arguments were passed to a non-method ACPI object (Buffer) (20220331/nsarguments-361) acpi_wmi3: on acpi0 acpi_wmi3: Embedded MOF found ACPI: \134_SB.WMI3.WQBC: 1 arguments were passed to a non-method ACPI object (Buffer) (20220331/nsarguments-361) driver bug: Unable to set devclass (class: ppc devname: (unknown)) acpi_wmi4: on acpi0 acpi_wmi4: Embedded MOF found ACPI: \134_SB.WMI6.WQFE: 1 arguments were passed to a non-method ACPI object (Buffer) (20220331/nsarguments-361) driver bug: Unable to set devclass (class: ppc devname: (unknown)) CPU: AMD Ryzen 5 PRO 3500U w/ Radeon Vega Mobile Gfx (2096.06-MHz K8-class CPU) Origin="AuthenticAMD" Id=0x810f81 Family=0x17 Model=0x18 Stepping=1 Features=0x178bfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2,HTT> Features2=0x7ed8320b<SSE3,PCLMULQDQ,MON,SSSE3,FMA,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT,AESNI,XSAVE,OSXSAVE,AVX,F16C,RDRAND> AMD Features=0x2e500800<SYSCALL,NX,MMX+,FFXSR,Page1GB,RDTSCP,LM> AMD Features2=0x35c233ff<LAHF,CMP,SVM,ExtAPIC,CR8,ABM,SSE4A,MAS,Prefetch,OSVW,SKINIT,WDT,TCE,Topology,PCXC,PNXC,DBE,PL2I,MWAITX> Structured Extended Features=0x209c01a9<FSGSBASE,BMI1,AVX2,SMEP,BMI2,RDSEED,ADX,SMAP,CLFLUSHOPT,SHA> XSAVE Features=0xf<XSAVEOPT,XSAVEC,XINUSE,XSAVES> AMD Extended Feature Extensions ID EBX=0x1007<CLZERO,IRPerf,XSaveErPtr,IBPB> SVM: NP,NRIP,VClean,AFlush,DAssist,NAsids=32768 TSC: P-state invariant, performance statistics wlan0: Ethernet address: 28:7f:cf:f8:6f:06 bridge0: Ethernet address: 58:9c:fc:10:f5:6c lo0: link state changed to UP re0: link state changed to DOWN re0: link state changed to UP wlan0: link state changed to UP ubt0 on uhub1 ubt0: <vendor 0x8087 product 0x0025, class 224/1, rev 2.00/0.02, addr 1> on usbus2 uhid0 on uhub0 uhid0: on usbus1 uhid1 on uhub4 uhid1: <SteelSeries SteelSeries Rival 710 Gaming Mouse, class 0/0, rev 2.00/0.72, addr 4> on usbus1 uhid2 on uhub5 uhid2: <Generic ThinkPad Dock USB Audio, class 0/0, rev 2.00/0.12, addr 9> on usbus1 ums0 on uhub4 ums0: <SteelSeries SteelSeries Rival 710 Gaming Mouse, class 0/0, rev 2.00/0.72, addr 4> on usbus1 ums0: 8 buttons and [XYZT] coordinates ID=0 uaudio0 on uhub5 uaudio0: <vendor 0x046d product 0x0825, class 239/2, rev 2.00/0.12, addr 6> on usbus1 uaudio0: No playback. uaudio0: Record[0]: 48000 Hz, 1 ch, 16-bit S-LE PCM format, 2x2ms buffer. uaudio0: Record[0]: 32000 Hz, 1 ch, 16-bit S-LE PCM format, 2x2ms buffer. uaudio0: Record[0]: 24000 Hz, 1 ch, 16-bit S-LE PCM format, 2x2ms buffer. uaudio0: Record[0]: 16000 Hz, 1 ch, 16-bit S-LE PCM format, 2x2ms buffer. uaudio0: No MIDI sequencer. pcm4: on uaudio0 uaudio0: No HID volume keys found. uaudio1 on uhub5 uaudio1: on usbus1 uaudio1: Play[0]: 48000 Hz, 2 ch, 24-bit S-LE PCM format, 2x2ms buffer. uaudio1: Play[0]: 44100 Hz, 2 ch, 24-bit S-LE PCM format, 2x2ms buffer. uaudio1: Record[0]: 48000 Hz, 2 ch, 24-bit S-LE PCM format, 2x2ms buffer. uaudio1: Record[0]: 44100 Hz, 2 ch, 24-bit S-LE PCM format, 2x2ms buffer. uaudio1: No MIDI sequencer. pcm5: on uaudio1 uaudio1: No HID volume keys found. uslcom0 on uhub5 uslcom0: on usbus1 Security policy loaded: MAC/ntpd (mac_ntpd) bridge0: promiscuous mode enabled ngeth0: Ethernet address: 58:9c:fc:10:dd:0b ngeth0: link state changed to UP ngeth0: changing name to 'ng0_pyze' lo0: link state changed to UP [drm] pstate TEST_DEBUG_DATA: 0x3FFE0000 [drm] pstate TEST_DEBUG_DATA: 0x3FFE0000 [drm] pstate took longer than expected ~78us [drm] pstate took longer than expected ~93us

evadot commented 2 years ago

Mhm ok, maybe there is a race somewhere, does it works every time ?

jownit commented 2 years ago

I've rebooted a few times now (I have 'kld_list="amdgpu"' in /etc/rc.conf) I rebooted both with it docked and undocked and docking after booting I tried cold booting, both docked and undocked I tried undocking and redocking while running. No more panics so far.. I feels stable, more stable than drm-5.4 even, which would occasionally panic while booting

evadot commented 2 years ago

Ok seems good then, let's close this and if you encounter it again in the futur just re-open (if it's another panic please open a new bug).