Raven: HDMI screen disappears and reappears during state changes leading to lockups and crashes.
Brief summary of the problem:
Multiple issues with Raven (Ryzen 2500U) laptop with external HDMI display. The first sign is extensive flickering of the laptop display whenever the external HDMI display changes state. This leads to lock-ups and crashes in mutlple situations.
Hardware description:
- CPU: AMD Ryzen 5 2500U with Radeon Vega Mobile Gfx
- GPU: AMD Radeon(TM) Vega 8 Graphics (RAVEN, DRM 3.40.0, 5.11.0-gentoo, LLVM 11.0.0)
- System Memory: 16GB
- Display(s): Laptop screen (1920x1080) + ThinkVision 24" HDMI (1920x1080)
- Type of Diplay Connection: Laptop internal screen + HDMI
System infomration:
- Distro name and Version: Gentoo
- Kernel version: 5.10.x 5.11.0 -- the situation is worse in 5.11
- Custom kernel: N/A
- AMD package version: N/A
How to reproduce the issue:
1.) connect HDMI display to a Raven laptop 2.) observe flickering hangs and crashes
mutliple problems can be traced back to the original issue of the HDMI screen disappearing/reappearing multiple ties on any state change. 1.) plymouth fails to display LUKS password prompt. This works OK with a single laptop screen, or on an i915 machine using identical software configuration using the same HDMI display. plymouth screen is stuck in text mode with 2-3 flickers showing the graphics loading screen. switching between text and graphics mode doesn't work. Using ctrl+alt+del to reboot does worked. Can be worked around by disabling boot splash and booting in text mode.
2.) Excessive flickering when HDMI display state changes. Any time there's a change to the HDMI display (connected cable, entering screen powersave, resuming screen powersave). Changing display configuration in gnome-shell has 50:50 chance of working, accompanied with excessive flickering and the settings interface rapidly switching between recognizing one screen and two screens.
3.) HDMI powersaving mode doesn't work. Locking the screen in gnome shell turns both screens dark, the laptop screen enters powersaving mode, then flickers stays on displaying the lock screen. Logging back in sees locations all application windows perturbed, consistent with disconnecting and reconnecting external display.
Attached files:
5.11 produces the following in dmesg:
[ 244.093310] [drm] amdgpu_dm_irq_schedule_work FAILED src 2
[ 245.883682] [drm:amdgpu_dm_atomic_check [amdgpu]] *ERROR* [CRTC:70:crtc-1] hw_done or flip_done timed out
[ 245.883931] [drm:drm_atomic_helper_wait_for_flip_done] *ERROR* [CRTC:70:crtc-1] flip_done timed out
[ 252.003410] [drm] amdgpu_dm_irq_schedule_work FAILED src 2
[ 252.703407] [drm] amdgpu_dm_irq_schedule_work FAILED src 2
[ 256.123664] [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CRTC:70:crtc-1] flip_done timed out
[ 266.363661] [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [PLANE:50:plane-2] flip_done timed out
[ 266.401358] ------------[ cut here ]------------
[ 266.401361] WARNING: CPU: 7 PID: 533 at drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:7754 amdgpu_dm_atomic_commit_tail+0x2190/0x2200 [amdgpu]
[ 266.401622] Modules linked in: bnep xfs iwlmvm wmi_bmof mac80211 kvm_amd libarc4 snd_hda_codec_conexant snd_hda_codec_hdmi snd_hda_codec_generic kvm irqbypass uvcvideo snd_hda_intel btusb videobuf2_vmalloc snd_intel_dspcfg btrtl videobuf2_memops snd_hda_codec videobuf2_v4l2 btintel videobuf2_common iwlwifi snd_hwdep bluetooth i2c_piix4 snd_hda_core snd_pcm cfg80211 ucsi_acpi tpm_crb typec_ucsi typec wmi thinkpad_acpi tpm_tis i2c_scmi tpm_tis_core amdgpu crc32_pclmul drm_ttm_helper ttm mfd_core ccp iommu_v2 sdhci_pci gpu_sched iosf_mbi cqhci btrfs xor zstd_compress raid6_pq
[ 266.401622] CPU: 7 PID: 533 Comm: kworker/7:2 Tainted: G T 5.11.0-gentoo #1
[ 266.401622] Hardware name: LENOVO 20KUCTO1WW/20KUCTO1WW, BIOS R0UET78W (1.58 ) 11/17/2020
[ 266.401622] Workqueue: events dm_irq_work_func [amdgpu]
[ 266.401622] RIP: 0010:amdgpu_dm_atomic_commit_tail+0x2190/0x2200 [amdgpu]
[ 266.401622] Code: 00 00 01 00 c7 84 24 c4 00 00 00 20 00 00 00 c6 84 24 c8 00 00 00 00 e8 8e f2 12 00 e9 9b fb ff ff 0f 0b e9 e2 f9 ff ff 0f 0b <0f> 0b e9 2f fa ff ff 0f 0b 0f 1f 80 00 00 00 00 e9 40 fa ff ff 48
[ 266.401622] RSP: 0018:ffffb2988066fa78 EFLAGS: 00010002
[ 266.401622] RAX: 0000000000000292 RBX: 0000000000000002 RCX: 0000000000000461
[ 266.401622] RDX: 0000000000000001 RSI: 0000000000000293 RDI: ffffa067cf480188
[ 266.401622] RBP: ffffb2988066fd90 R08: 0000000000000005 R09: 0000000000000000
[ 266.401622] R10: 0000000000005076 R11: 0000000000000000 R12: 0000000000000292
[ 266.401622] R13: ffffa068a4d53400 R14: ffffa067c5927880 R15: ffffa067ce650000
[ 266.401622] FS: 0000000000000000(0000) GS:ffffa06aff3c0000(0000) knlGS:0000000000000000
[ 266.401622] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 266.401622] CR2: 000039a5d0995000 CR3: 00000001d896e000 CR4: 00000000003506e0
[ 266.401622] Call Trace:
[ 266.401622] commit_tail+0x93/0x130
[ 266.401622] drm_atomic_helper_commit+0x12f/0x160
[ 266.401622] dm_restore_drm_connector_state+0x108/0x1c0 [amdgpu]
[ 266.401622] handle_hpd_irq+0x13a/0x180 [amdgpu]
[ 266.401622] dm_irq_work_func+0x49/0x60 [amdgpu]
[ 266.401622] process_one_work+0x1e1/0x380
[ 266.401622] worker_thread+0x4d/0x390
[ 266.401622] ? process_one_work+0x380/0x380
[ 266.401622] kthread+0xff/0x140
[ 266.401622] ? kthread_park+0x90/0x90
[ 266.401622] ret_from_fork+0x22/0x30
[ 266.401622] ---[ end trace 7b7e29893dc7c544 ]---
[ 266.401622] ------------[ cut here ]------------
[ 266.401622] WARNING: CPU: 7 PID: 533 at drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:7354 amdgpu_dm_atomic_commit_tail+0x2197/0x2200 [amdgpu]
[ 266.401622] Modules linked in: bnep xfs iwlmvm wmi_bmof mac80211 kvm_amd libarc4 snd_hda_codec_conexant snd_hda_codec_hdmi snd_hda_codec_generic kvm irqbypass uvcvideo snd_hda_intel btusb videobuf2_vmalloc snd_intel_dspcfg btrtl videobuf2_memops snd_hda_codec videobuf2_v4l2 btintel videobuf2_common iwlwifi snd_hwdep bluetooth i2c_piix4 snd_hda_core snd_pcm cfg80211 ucsi_acpi tpm_crb typec_ucsi typec wmi thinkpad_acpi tpm_tis i2c_scmi tpm_tis_core amdgpu crc32_pclmul drm_ttm_helper ttm mfd_core ccp iommu_v2 sdhci_pci gpu_sched iosf_mbi cqhci btrfs xor zstd_compress raid6_pq
[ 266.401622] CPU: 7 PID: 533 Comm: kworker/7:2 Tainted: G W T 5.11.0-gentoo #1
[ 266.401622] Hardware name: LENOVO 20KUCTO1WW/20KUCTO1WW, BIOS R0UET78W (1.58 ) 11/17/2020
[ 266.401622] Workqueue: events dm_irq_work_func [amdgpu]
[ 266.401622] RIP: 0010:amdgpu_dm_atomic_commit_tail+0x2197/0x2200 [amdgpu]
[ 266.401622] Code: c4 00 00 00 20 00 00 00 c6 84 24 c8 00 00 00 00 e8 8e f2 12 00 e9 9b fb ff ff 0f 0b e9 e2 f9 ff ff 0f 0b 0f 0b e9 2f fa ff ff <0f> 0b 0f 1f 80 00 00 00 00 e9 40 fa ff ff 48 8b 74 24 60 31 c0 48
[ 266.401622] RSP: 0018:ffffb2988066fa78 EFLAGS: 00010086
[ 266.401622] RAX: 0000000000000001 RBX: 0000000000000002 RCX: 0000000000000461
[ 266.401622] RDX: 0000000000000001 RSI: 0000000000000293 RDI: ffffa067cf480188
[ 266.401622] RBP: ffffb2988066fd90 R08: 0000000000000005 R09: 0000000000000000
[ 266.401622] R10: 0000000000005076 R11: 0000000000000000 R12: 0000000000000292
[ 266.401622] R13: ffffa068a4d53400 R14: ffffa067c5927880 R15: ffffa067ce650000
[ 266.401622] FS: 0000000000000000(0000) GS:ffffa06aff3c0000(0000) knlGS:0000000000000000
[ 266.401622] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 266.401622] CR2: 000039a5d0995000 CR3: 00000001d896e000 CR4: 00000000003506e0
[ 266.401622] Call Trace:
[ 266.401622] commit_tail+0x93/0x130
[ 266.401622] drm_atomic_helper_commit+0x12f/0x160
[ 266.401622] dm_restore_drm_connector_state+0x108/0x1c0 [amdgpu]
[ 266.401622] handle_hpd_irq+0x13a/0x180 [amdgpu]
[ 266.401622] dm_irq_work_func+0x49/0x60 [amdgpu]
[ 266.401622] process_one_work+0x1e1/0x380
[ 266.401622] worker_thread+0x4d/0x390
[ 266.401622] ? process_one_work+0x380/0x380
[ 266.401622] kthread+0xff/0x140
[ 266.401622] ? kthread_park+0x90/0x90
[ 266.401622] ret_from_fork+0x22/0x30
[ 266.401622] ---[ end trace 7b7e29893dc7c545 ]---
[ 266.571247] gnome-shell[1205]: segfault at ffffffffffffffb8 ip 00007faf44f40df7 sp 00007ffec8e715b8 error 5 in libmutter-6.so.0.0.0[7faf44f13000+10d000]
[ 266.571260] Code: fd ff 48 89 ef 48 8b 40 30 48 83 c4 08 5b 5d ff e0 66 90 48 63 05 4d b0 16 00 48 8b 04 07 c3 0f 1f 40 00 48 63 05 3d b0 16 00 <48> 8b 44 38 08 c3 0f 1f 00 48 8b 07 ff a0 88 00 00 00 0f 1f 80 00
[ 267.348173] [drm:dc_remove_stream_from_ctx [amdgpu]] *ERROR* Pipe not found for stream 0000000021d660a7 !
[ 267.349016] [drm:dc_remove_stream_from_ctx [amdgpu]] *ERROR* Pipe not found for stream 0000000021d660a7 !
[ 267.349321] [drm:dc_remove_stream_from_ctx [amdgpu]] *ERROR* Pipe not found for stream 0000000021d660a7 !
[ 267.349687] [drm:dc_remove_stream_from_ctx [amdgpu]] *ERROR* Pipe not found for stream 0000000021d660a7 !
[ 267.424107] rfkill: input handler enabled
[ 267.443951] [drm:dc_remove_stream_from_ctx [amdgpu]] *ERROR* Pipe not found for stream 0000000021d660a7 !
[ 267.444299] ------------[ cut here ]------------
[ 267.444300] atomic remove_fb failed with -22
[ 267.444312] WARNING: CPU: 0 PID: 15 at drivers/gpu/drm/drm_framebuffer.c:1113 drm_framebuffer_remove+0x3d2/0x410
[ 267.444321] Modules linked in: bnep xfs iwlmvm wmi_bmof mac80211 kvm_amd libarc4 snd_hda_codec_conexant snd_hda_codec_hdmi snd_hda_codec_generic kvm irqbypass uvcvideo snd_hda_intel btusb videobuf2_vmalloc snd_intel_dspcfg btrtl videobuf2_memops snd_hda_codec videobuf2_v4l2 btintel videobuf2_common iwlwifi snd_hwdep bluetooth i2c_piix4 snd_hda_core snd_pcm cfg80211 ucsi_acpi tpm_crb typec_ucsi typec wmi thinkpad_acpi tpm_tis i2c_scmi tpm_tis_core amdgpu crc32_pclmul drm_ttm_helper ttm mfd_core ccp iommu_v2 sdhci_pci gpu_sched iosf_mbi cqhci btrfs xor zstd_compress raid6_pq
[ 267.444382] CPU: 0 PID: 15 Comm: kworker/0:1 Tainted: G W T 5.11.0-gentoo #1
[ 267.444386] Hardware name: LENOVO 20KUCTO1WW/20KUCTO1WW, BIOS R0UET78W (1.58 ) 11/17/2020
[ 267.444389] Workqueue: events drm_mode_rmfb_work_fn
[ 267.444393] RIP: 0010:drm_framebuffer_remove+0x3d2/0x410
[ 267.444397] Code: fd ff ff 48 8d 7c 24 18 bd f4 ff ff ff e8 b6 be ff ff 48 8d 7c 24 18 e8 2c bd ff ff 89 ee 48 c7 c7 48 61 3d aa e8 05 5a 4a 00 <0f> 0b e9 57 fe ff ff be 03 00 00 00 4c 89 ff e8 5a 6f e7 ff e9 1e
[ 267.444401] RSP: 0018:ffffb2988014fdc0 EFLAGS: 00010282
[ 267.444405] RAX: 0000000000000000 RBX: ffffa068949c1d00 RCX: 0000000000000027
[ 267.444407] RDX: 0000000000000027 RSI: 00000000ffff7fff RDI: ffffa06aff2175c8
[ 267.444409] RBP: 00000000ffffffea R08: ffffa06aff2175c0 R09: ffffb2988014fbe8
[ 267.444411] R10: 0000000000000001 R11: 0000000000000001 R12: ffffa067cf480010
[ 267.444412] R13: 0000000000000000 R14: ffffa068efc10000 R15: ffffa067e0e10c00
[ 267.444414] FS: 0000000000000000(0000) GS:ffffa06aff200000(0000) knlGS:0000000000000000
[ 267.444416] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 267.444418] CR2: 000055c1d1bc47d8 CR3: 0000000102474000 CR4: 00000000003506f0
[ 267.444421] Call Trace:
[ 267.444427] drm_mode_rmfb_work_fn+0x4f/0x60
[ 267.444431] process_one_work+0x1e1/0x380
[ 267.444438] worker_thread+0x1d0/0x390
[ 267.444442] ? process_one_work+0x380/0x380
[ 267.444445] kthread+0xff/0x140
[ 267.444449] ? kthread_park+0x90/0x90
[ 267.444453] ret_from_fork+0x22/0x30
[ 267.444459] ---[ end trace 7b7e29893dc7c546 ]---
[ 267.539128] [drm:dc_remove_stream_from_ctx [amdgpu]] *ERROR* Pipe not found for stream 0000000021d660a7 !
[ 267.539931] [drm:dc_remove_stream_from_ctx [amdgpu]] *ERROR* Pipe not found for stream 0000000021d660a7 !
[ 267.839350] [drm:dc_remove_stream_from_ctx [amdgpu]] *ERROR* Pipe not found for stream 0000000021d660a7 !
[ 267.839598] [drm:handle_hpd_irq [amdgpu]] *ERROR* Restoring old state failed with -22
[ 267.842031] [drm:dc_remove_stream_from_ctx [amdgpu]] *ERROR* Pipe not found for stream 0000000021d660a7 !
[ 270.016518] rfkill: input handler disabled
[ 270.407840] [drm:dc_add_plane_to_context [amdgpu]] *ERROR* Head pipe not found for stream_state 0000000021d660a7 !
[ 270.458913] [drm:dc_add_plane_to_context [amdgpu]] *ERROR* Head pipe not found for stream_state 0000000021d660a7 !
[ 270.459133] [drm:dc_commit_updates_for_stream [amdgpu]] *ERROR* Failed to add streams for new validate context!
[ 270.462745] [drm:dc_add_plane_to_context [amdgpu]] *ERROR* Head pipe not found for stream_state 0000000021d660a7 !
[ 280.699656] [drm:drm_atomic_helper_wait_for_flip_done] *ERROR* [CRTC:70:crtc-1] flip_done timed out
[ 280.699660] [drm:amdgpu_dm_atomic_check [amdgpu]] *ERROR* [CRTC:70:crtc-1] hw_done or flip_done timed out
[ 280.739852] [drm:dc_remove_stream_from_ctx [amdgpu]] *ERROR* Pipe not found for stream 0000000021d660a7 !
[ 280.740058] [drm:handle_hpd_irq [amdgpu]] *ERROR* Restoring old state failed with -22
[ 291.963663] [drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CRTC:70:crtc-1] flip_done timed out
[ 291.963822] [drm:dc_add_plane_to_context [amdgpu]] *ERROR* Head pipe not found for stream_state 0000000021d660a7 !
[ 291.966528] [drm:dc_add_plane_to_context [amdgpu]] *ERROR* Head pipe not found for stream_state 0000000021d660a7 !
[ 291.990856] [drm:dc_remove_stream_from_ctx [amdgpu]] *ERROR* Pipe not found for stream 0000000021d660a7 !
[ 291.991280] [drm:handle_hpd_irq [amdgpu]] *ERROR* Restoring old state failed with -22
[ 292.878679] [drm:dc_add_plane_to_context [amdgpu]] *ERROR* Head pipe not found for stream_state 0000000021d660a7 !
[ 292.917776] [drm:dc_add_plane_to_context [amdgpu]] *ERROR* Head pipe not found for stream_state 0000000021d660a7 !
[ 306.329451] rfkill: input handler enabled
[ 309.119748] rfkill: input handler disabled
[ 309.481861] [drm:dc_remove_stream_from_ctx [amdgpu]] *ERROR* Pipe not found for stream 0000000021d660a7 !
[ 309.738388] [drm:dc_remove_stream_from_ctx [amdgpu]] *ERROR* Pipe not found for stream 0000000021d660a7 !
[ 309.738668] ------------[ cut here ]------------
[ 309.738669] atomic remove_fb failed with -22
[ 309.738681] WARNING: CPU: 4 PID: 92 at drivers/gpu/drm/drm_framebuffer.c:1113 drm_framebuffer_remove+0x3d2/0x410
[ 309.738689] Modules linked in: bnep xfs iwlmvm wmi_bmof mac80211 kvm_amd libarc4 snd_hda_codec_conexant snd_hda_codec_hdmi snd_hda_codec_generic kvm irqbypass uvcvideo snd_hda_intel btusb videobuf2_vmalloc snd_intel_dspcfg btrtl videobuf2_memops snd_hda_codec videobuf2_v4l2 btintel videobuf2_common iwlwifi snd_hwdep bluetooth i2c_piix4 snd_hda_core snd_pcm cfg80211 ucsi_acpi tpm_crb typec_ucsi typec wmi thinkpad_acpi tpm_tis i2c_scmi tpm_tis_core amdgpu crc32_pclmul drm_ttm_helper ttm mfd_core ccp iommu_v2 sdhci_pci gpu_sched iosf_mbi cqhci btrfs xor zstd_compress raid6_pq
[ 309.738749] CPU: 4 PID: 92 Comm: kworker/4:1 Tainted: G W T 5.11.0-gentoo #1
[ 309.738753] Hardware name: LENOVO 20KUCTO1WW/20KUCTO1WW, BIOS R0UET78W (1.58 ) 11/17/2020
[ 309.738757] Workqueue: events drm_mode_rmfb_work_fn
[ 309.738761] RIP: 0010:drm_framebuffer_remove+0x3d2/0x410
[ 309.738765] Code: fd ff ff 48 8d 7c 24 18 bd f4 ff ff ff e8 b6 be ff ff 48 8d 7c 24 18 e8 2c bd ff ff 89 ee 48 c7 c7 48 61 3d aa e8 05 5a 4a 00 <0f> 0b e9 57 fe ff ff be 03 00 00 00 4c 89 ff e8 5a 6f e7 ff e9 1e
[ 309.738768] RSP: 0018:ffffb29880447dc0 EFLAGS: 00010282
[ 309.738771] RAX: 0000000000000000 RBX: ffffa068c7c17700 RCX: 0000000000000027
[ 309.738773] RDX: 0000000000000027 RSI: 00000000ffff7fff RDI: ffffa06aff3175c8
[ 309.738775] RBP: 00000000ffffffea R08: ffffa06aff3175c0 R09: ffffb29880447be8
[ 309.738777] R10: 0000000000000001 R11: 0000000000000001 R12: ffffa067cf480010
[ 309.738779] R13: 0000000000000000 R14: ffffa0681021d840 R15: ffffa067f6007f80
[ 309.738780] FS: 0000000000000000(0000) GS:ffffa06aff300000(0000) knlGS:0000000000000000
[ 309.738783] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 309.738785] CR2: 000055c1d1ba34ac CR3: 0000000105c06000 CR4: 00000000003506e0
[ 309.738787] Call Trace:
[ 309.738792] drm_mode_rmfb_work_fn+0x4f/0x60
[ 309.738796] process_one_work+0x1e1/0x380
[ 309.738801] worker_thread+0x1d0/0x390
[ 309.738805] ? process_one_work+0x380/0x380
[ 309.738809] kthread+0xff/0x140
[ 309.738813] ? kthread_park+0x90/0x90
[ 309.738816] ret_from_fork+0x22/0x30
[ 309.738823] ---[ end trace 7b7e29893dc7c547 ]---
[ 756.049309] [drm:dc_remove_stream_from_ctx [amdgpu]] *ERROR* Pipe not found for stream 0000000021d660a7 !
[ 756.049744] [drm:handle_hpd_irq [amdgpu]] *ERROR* Restoring old state failed with -22
[ 756.050385] [drm:dc_remove_stream_from_ctx [amdgpu]] *ERROR* Pipe not found for stream 0000000021d660a7 !
[ 757.106735] [drm:dc_remove_stream_from_ctx [amdgpu]] *ERROR* Pipe not found for stream 0000000021d660a7 !
[ 764.662535] [drm:dc_remove_stream_from_ctx [amdgpu]] *ERROR* Pipe not found for stream 0000000021d660a7 !
[ 764.662879] [drm:handle_hpd_irq [amdgpu]] *ERROR* Restoring old state failed with -22
[ 764.663285] [drm:dc_remove_stream_from_ctx [amdgpu]] *ERROR* Pipe not found for stream 0000000021d660a7 !
[ 765.630648] [drm:dc_remove_stream_from_ctx [amdgpu]] *ERROR* Pipe not found for stream 0000000021d660a7 !
[ 956.854944] [drm:dc_remove_stream_from_ctx [amdgpu]] *ERROR* Pipe not found for stream 0000000021d660a7 !
[ 2107.491275] [drm:dc_remove_stream_from_ctx [amdgpu]] *ERROR* Pipe not found for stream 0000000021d660a7 !