bug/regression/bisected: sleeping function called from invalid context at include/linux/sched/mm.h:306 every time on boot-up/wake-up/enter or exit full-screen when refresh rate is 120Hz
I decided recently switching to OLED because such panel has undeniable advantages over conventional LCD display. But on the market are not many affordable OLED monitors that meet my requirements (4K and 42"). I know only one monitor it's ASUS ROG SWIFT PG42UQ. But this monitor very overprised. I decied got TV LG OLED42C3RLA and use it as primary monitor connected via HDMI port.
What issues I noted:
When I switch TV refresh rate from 60Hz to 120Hz in gnome-control-center in kernel log appears such trace
[ 7468.361390] BUG: sleeping function called from invalid context at include/linux/sched/mm.h:306
[ 7468.361399] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 2514, name: KMS thread
[ 7468.361403] preempt_count: 1, expected: 0
[ 7468.361405] RCU nest depth: 0, expected: 0
[ 7468.361408] 3 locks held by KMS thread/2514:
[ 7468.361411] #0: ffffc900058bfb70 (crtc_ww_class_acquire){+.+.}-{0:0}, at: drm_mode_atomic_ioctl+0x31d/0x2130
[ 7468.361425] #1: ffff88818a0005a0 (crtc_ww_class_mutex){+.+.}-{3:3}, at: modeset_lock+0xe7/0x550
[ 7468.361435] #2: ffff88818a05ddb0 (&adev->dm.dc_lock){+.+.}-{3:3}, at: amdgpu_dm_atomic_commit_tail+0x3c52/0xe9e0 [amdgpu]
[ 7468.361702] Preemption disabled at:
[ 7468.361703] [<ffffffffc153f0e3>] dc_fpu_begin+0x23/0x250 [amdgpu]
[ 7468.361991] CPU: 29 PID: 2514 Comm: KMS thread Tainted: G W L ------- --- 6.5.0-0.rc6.20230816git4853c74bd7ab.45.fc40.x86_64+debug #1
[ 7468.361997] Hardware name: Micro-Star International Co., Ltd. MS-7D73/MPG B650I EDGE WIFI (MS-7D73), BIOS 1.44 08/02/2023
[ 7468.362001] Call Trace:
[ 7468.362005] <TASK>
[ 7468.362009] dump_stack_lvl+0xb1/0xd0
[ 7468.362017] __might_resched+0x3d9/0x600
[ 7468.362025] ? __pfx___might_resched+0x10/0x10
[ 7468.362036] __kmem_cache_alloc_node+0x3a7/0x3e0
[ 7468.362044] ? dc_create_stream_for_sink+0x58/0xf30 [amdgpu]
[ 7468.362440] kmalloc_trace+0x2a/0xc0
[ 7468.362449] dc_create_stream_for_sink+0x58/0xf30 [amdgpu]
[ 7468.362837] ? __pfx_resource_build_scaling_params+0x10/0x10 [amdgpu]
[ 7468.363232] dcn32_add_phantom_pipes+0x91/0xc90 [amdgpu]
[ 7468.363630] dcn32_internal_validate_bw+0x356c/0x6260 [amdgpu]
[ 7468.364038] ? drm_atomic_commit+0x1d4/0x2a0
[ 7468.364043] ? drm_mode_atomic_ioctl+0x153b/0x2130
[ 7468.364072] ? __pfx_dcn32_internal_validate_bw+0x10/0x10 [amdgpu]
[ 7468.364473] ? kernel_fpu_begin_mask+0xff/0x200
[ 7468.364488] ? rcu_is_watching+0x15/0xb0
[ 7468.364499] dcn32_validate_bandwidth+0x21f/0x8c0 [amdgpu]
[ 7468.364898] ? __pfx_dcn32_validate_bandwidth+0x10/0x10 [amdgpu]
[ 7468.365305] ? dc_resource_state_copy_construct+0x347/0x580 [amdgpu]
[ 7468.365702] dc_update_planes_and_stream+0xfb9/0x1ed0 [amdgpu]
[ 7468.366099] ? lock_acquire+0x120/0x4f0
[ 7468.366111] ? amdgpu_dm_atomic_commit_tail+0x3c52/0xe9e0 [amdgpu]
[ 7468.366468] ? __pfx_dc_update_planes_and_stream+0x10/0x10 [amdgpu]
[ 7468.366691] ? __pfx_lock_acquired+0x10/0x10
[ 7468.366695] ? local_clock_noinstr+0xd/0xc0
[ 7468.366700] ? __pfx___might_resched+0x10/0x10
[ 7468.366717] ? mark_held_locks+0x96/0xe0
[ 7468.366726] amdgpu_dm_atomic_commit_tail+0x4183/0xe9e0 [amdgpu]
[ 7468.366977] ? find_held_lock+0x34/0x120
[ 7468.366980] ? local_clock_noinstr+0xd/0xc0
[ 7468.366998] ? __pfx_amdgpu_dm_atomic_commit_tail+0x10/0x10 [amdgpu]
[ 7468.367224] ? __pfx_mark_lock+0x10/0x10
[ 7468.367254] ? mark_held_locks+0x96/0xe0
[ 7468.367273] ? drm_crtc_commit_wait+0x32/0x160
[ 7468.367276] ? drm_atomic_helper_wait_for_dependencies+0x48a/0x7c0
[ 7468.367284] commit_tail+0x1ad/0x310
[ 7468.367290] drm_atomic_helper_commit+0x229/0x2a0
[ 7468.367294] ? __pfx_drm_atomic_helper_commit+0x10/0x10
[ 7468.367297] drm_atomic_commit+0x1d4/0x2a0
[ 7468.367301] ? __pfx_drm_atomic_commit+0x10/0x10
[ 7468.367305] ? __pfx___drm_printfn_info+0x10/0x10
[ 7468.367310] ? _raw_spin_unlock_irqrestore+0x4f/0x80
[ 7468.367314] ? drm_event_reserve_init+0x1c3/0x240
[ 7468.367320] drm_mode_atomic_ioctl+0x153b/0x2130
[ 7468.367333] ? __pfx_drm_mode_atomic_ioctl+0x10/0x10
[ 7468.367337] ? lock_acquire+0x1a6/0x4f0
[ 7468.367339] ? find_held_lock+0x34/0x120
[ 7468.367352] ? do_raw_spin_unlock+0x58/0x1f0
[ 7468.367357] ? __pfx_drm_mode_atomic_ioctl+0x10/0x10
[ 7468.367361] drm_ioctl_kernel+0x1ff/0x3e0
[ 7468.367365] ? __pfx_drm_ioctl_kernel+0x10/0x10
[ 7468.367373] drm_ioctl+0x4ce/0xab0
[ 7468.367378] ? __pfx_drm_mode_atomic_ioctl+0x10/0x10
[ 7468.367383] ? __pfx_drm_ioctl+0x10/0x10
[ 7468.367393] ? _raw_spin_unlock_irqrestore+0x66/0x80
[ 7468.367396] ? lockdep_hardirqs_on+0x81/0x110
[ 7468.367400] ? _raw_spin_unlock_irqrestore+0x4f/0x80
[ 7468.367405] amdgpu_drm_ioctl+0xd8/0x1c0 [amdgpu]
[ 7468.367628] __x64_sys_ioctl+0x134/0x1b0
[ 7468.367634] do_syscall_64+0x5d/0x90
[ 7468.367637] ? do_syscall_64+0x6c/0x90
[ 7468.367640] ? do_syscall_64+0x6c/0x90
[ 7468.367643] ? lockdep_hardirqs_on+0x81/0x110
[ 7468.367646] entry_SYSCALL_64_after_hwframe+0x73/0xdd
[ 7468.367650] RIP: 0033:0x7f80a0f1139d
[ 7468.367668] Code: 04 25 28 00 00 00 48 89 45 c8 31 c0 48 8d 45 10 c7 45 b0 10 00 00 00 48 89 45 b8 48 8d 45 d0 48 89 45 c0 b8 10 00 00 00 0f 05 <89> c2 3d 00 f0 ff ff 77 1a 48 8b 45 c8 64 48 2b 04 25 28 00 00 00
[ 7468.367671] RSP: 002b:00007f80869e3970 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
[ 7468.367675] RAX: ffffffffffffffda RBX: 00007f8074024c30 RCX: 00007f80a0f1139d
[ 7468.367678] RDX: 00007f80869e3a10 RSI: 00000000c03864bc RDI: 000000000000000c
[ 7468.367680] RBP: 00007f80869e39c0 R08: 0000000000000140 R09: 0000000000000001
[ 7468.367682] R10: 000000000000000e R11: 0000000000000246 R12: 00007f80869e3a10
[ 7468.367684] R13: 00000000c03864bc R14: 000000000000000c R15: 00007f80740227b0
[ 7468.367694] </TASK>
When system boot-up when refresh rate is 120Hz
[ 67.923707] BUG: sleeping function called from invalid context at include/linux/sched/mm.h:306
[ 67.923758] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 2514, name: KMS thread
[ 67.923761] preempt_count: 1, expected: 0
[ 67.923763] RCU nest depth: 0, expected: 0
[ 67.923766] 3 locks held by KMS thread/2514:
[ 67.923769] #0: ffffc900058bfb90 (crtc_ww_class_acquire){+.+.}-{0:0}, at: drm_mode_atomic_ioctl+0x31d/0x2130
[ 67.923783] #1: ffff88818a0005a0 (crtc_ww_class_mutex){+.+.}-{3:3}, at: modeset_lock+0xe7/0x550
[ 67.923792] #2: ffff88818a05ddb0 (&adev->dm.dc_lock){+.+.}-{3:3}, at: amdgpu_dm_atomic_commit_tail+0x3c52/0xe9e0 [amdgpu]
[ 67.924073] Preemption disabled at:
[ 67.924074] [<ffffffffc153f0e3>] dc_fpu_begin+0x23/0x250 [amdgpu]
[ 67.924312] CPU: 29 PID: 2514 Comm: KMS thread Tainted: G W L ------- --- 6.5.0-0.rc6.20230816git4853c74bd7ab.45.fc40.x86_64+debug #1
[ 67.924316] Hardware name: Micro-Star International Co., Ltd. MS-7D73/MPG B650I EDGE WIFI (MS-7D73), BIOS 1.44 08/02/2023
[ 67.924319] Call Trace:
[ 67.924321] <TASK>
[ 67.924324] dump_stack_lvl+0xb1/0xd0
[ 67.924330] __might_resched+0x3d9/0x600
[ 67.924335] ? __pfx___might_resched+0x10/0x10
[ 67.924341] __kmem_cache_alloc_node+0x3a7/0x3e0
[ 67.924346] ? dc_create_stream_for_sink+0x58/0xf30 [amdgpu]
[ 67.924627] kmalloc_trace+0x2a/0xc0
[ 67.924635] dc_create_stream_for_sink+0x58/0xf30 [amdgpu]
[ 67.924858] ? __pfx_resource_build_scaling_params+0x10/0x10 [amdgpu]
[ 67.925078] dcn32_add_phantom_pipes+0x91/0xc90 [amdgpu]
[ 67.925303] dcn32_internal_validate_bw+0x356c/0x6260 [amdgpu]
[ 67.925546] ? drm_atomic_commit+0x1d4/0x2a0
[ 67.925550] ? drm_mode_atomic_ioctl+0x153b/0x2130
[ 67.925565] ? __pfx_dcn32_internal_validate_bw+0x10/0x10 [amdgpu]
[ 67.925804] ? kernel_fpu_begin_mask+0xff/0x200
[ 67.925812] ? rcu_is_watching+0x15/0xb0
[ 67.925818] dcn32_validate_bandwidth+0x21f/0x8c0 [amdgpu]
[ 67.926042] ? __pfx_dcn32_validate_bandwidth+0x10/0x10 [amdgpu]
[ 67.926268] ? dc_resource_state_copy_construct+0x347/0x580 [amdgpu]
[ 67.926511] dc_update_planes_and_stream+0xfb9/0x1ed0 [amdgpu]
[ 67.926734] ? lock_acquire+0x120/0x4f0
[ 67.926740] ? amdgpu_dm_atomic_commit_tail+0x3c52/0xe9e0 [amdgpu]
[ 67.926993] ? __pfx_dc_update_planes_and_stream+0x10/0x10 [amdgpu]
[ 67.927213] ? __pfx_lock_acquired+0x10/0x10
[ 67.927217] ? local_clock_noinstr+0xd/0xc0
[ 67.927221] ? __pfx___might_resched+0x10/0x10
[ 67.927237] ? mark_held_locks+0x96/0xe0
[ 67.927246] amdgpu_dm_atomic_commit_tail+0x4183/0xe9e0 [amdgpu]
[ 67.927487] ? find_held_lock+0x34/0x120
[ 67.927491] ? local_clock_noinstr+0xd/0xc0
[ 67.927509] ? __pfx_amdgpu_dm_atomic_commit_tail+0x10/0x10 [amdgpu]
[ 67.927742] ? __pfx_mark_lock+0x10/0x10
[ 67.927771] ? mark_held_locks+0x96/0xe0
[ 67.927789] ? drm_crtc_commit_wait+0x32/0x160
[ 67.927792] ? drm_atomic_helper_wait_for_dependencies+0x48a/0x7c0
[ 67.927800] commit_tail+0x1ad/0x310
[ 67.927805] drm_atomic_helper_commit+0x229/0x2a0
[ 67.927809] ? __pfx_drm_atomic_helper_commit+0x10/0x10
[ 67.927812] drm_atomic_commit+0x1d4/0x2a0
[ 67.927816] ? __pfx_drm_atomic_commit+0x10/0x10
[ 67.927819] ? __pfx___drm_printfn_info+0x10/0x10
[ 67.927824] ? _raw_spin_unlock_irqrestore+0x4f/0x80
[ 67.927828] ? drm_event_reserve_init+0x1c3/0x240
[ 67.927834] drm_mode_atomic_ioctl+0x153b/0x2130
[ 67.927846] ? __pfx_drm_mode_atomic_ioctl+0x10/0x10
[ 67.927850] ? lock_acquire+0x1a6/0x4f0
[ 67.927852] ? find_held_lock+0x34/0x120
[ 67.927865] ? do_raw_spin_unlock+0x58/0x1f0
[ 67.927869] ? __pfx_drm_mode_atomic_ioctl+0x10/0x10
[ 67.927873] drm_ioctl_kernel+0x1ff/0x3e0
[ 67.927877] ? __pfx_drm_ioctl_kernel+0x10/0x10
[ 67.927885] drm_ioctl+0x4ce/0xab0
[ 67.927890] ? __pfx_drm_mode_atomic_ioctl+0x10/0x10
[ 67.927895] ? __pfx_drm_ioctl+0x10/0x10
[ 67.927905] ? _raw_spin_unlock_irqrestore+0x66/0x80
[ 67.927907] ? lockdep_hardirqs_on+0x81/0x110
[ 67.927911] ? _raw_spin_unlock_irqrestore+0x4f/0x80
[ 67.927916] amdgpu_drm_ioctl+0xd8/0x1c0 [amdgpu]
[ 67.928103] __x64_sys_ioctl+0x134/0x1b0
[ 67.928108] do_syscall_64+0x5d/0x90
[ 67.928112] ? lockdep_hardirqs_on+0x81/0x110
[ 67.928115] entry_SYSCALL_64_after_hwframe+0x73/0xdd
[ 67.928119] RIP: 0033:0x7f80a0f1139d
[ 67.928138] Code: 04 25 28 00 00 00 48 89 45 c8 31 c0 48 8d 45 10 c7 45 b0 10 00 00 00 48 89 45 b8 48 8d 45 d0 48 89 45 c0 b8 10 00 00 00 0f 05 <89> c2 3d 00 f0 ff ff 77 1a 48 8b 45 c8 64 48 2b 04 25 28 00 00 00
[ 67.928141] RSP: 002b:00007f80869e3970 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
[ 67.928145] RAX: ffffffffffffffda RBX: 00007f80740235b0 RCX: 00007f80a0f1139d
[ 67.928147] RDX: 00007f80869e3a10 RSI: 00000000c03864bc RDI: 000000000000000c
[ 67.928150] RBP: 00007f80869e39c0 R08: 0000000000000180 R09: 0000000000000001
[ 67.928152] R10: 000000000000000e R11: 0000000000000246 R12: 00007f80869e3a10
[ 67.928154] R13: 00000000c03864bc R14: 000000000000000c R15: 00007f8074003ba0
[ 67.928163] </TASK>
When system wake-up after sleeping when refresh rate is 120Hz
[ 4978.130757] BUG: sleeping function called from invalid context at include/linux/sched/mm.h:306
[ 4978.130768] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 2514, name: KMS thread
[ 4978.130771] preempt_count: 1, expected: 0
[ 4978.130774] RCU nest depth: 0, expected: 0
[ 4978.130776] 3 locks held by KMS thread/2514:
[ 4978.130780] #0: ffffc900058bfb70 (crtc_ww_class_acquire){+.+.}-{0:0}, at: drm_mode_atomic_ioctl+0x31d/0x2130
[ 4978.130794] #1: ffff88818a0005a0 (crtc_ww_class_mutex){+.+.}-{3:3}, at: modeset_lock+0xe7/0x550
[ 4978.130804] #2: ffff88818a05ddb0 (&adev->dm.dc_lock){+.+.}-{3:3}, at: amdgpu_dm_atomic_commit_tail+0x3c52/0xe9e0 [amdgpu]
[ 4978.131068] Preemption disabled at:
[ 4978.131069] [<ffffffffc153f0e3>] dc_fpu_begin+0x23/0x250 [amdgpu]
[ 4978.131310] CPU: 29 PID: 2514 Comm: KMS thread Tainted: G W L ------- --- 6.5.0-0.rc6.20230816git4853c74bd7ab.45.fc40.x86_64+debug #1
[ 4978.131314] Hardware name: Micro-Star International Co., Ltd. MS-7D73/MPG B650I EDGE WIFI (MS-7D73), BIOS 1.44 08/02/2023
[ 4978.131317] Call Trace:
[ 4978.131320] <TASK>
[ 4978.131323] dump_stack_lvl+0xb1/0xd0
[ 4978.131329] __might_resched+0x3d9/0x600
[ 4978.131335] ? __pfx___might_resched+0x10/0x10
[ 4978.131341] __kmem_cache_alloc_node+0x3a7/0x3e0
[ 4978.131346] ? dc_create_stream_for_sink+0x58/0xf30 [amdgpu]
[ 4978.131579] kmalloc_trace+0x2a/0xc0
[ 4978.131585] dc_create_stream_for_sink+0x58/0xf30 [amdgpu]
[ 4978.131804] ? __pfx_resource_build_scaling_params+0x10/0x10 [amdgpu]
[ 4978.132026] dcn32_add_phantom_pipes+0x91/0xc90 [amdgpu]
[ 4978.132252] dcn32_internal_validate_bw+0x356c/0x6260 [amdgpu]
[ 4978.132491] ? drm_atomic_commit+0x1d4/0x2a0
[ 4978.132494] ? drm_mode_atomic_ioctl+0x153b/0x2130
[ 4978.132510] ? __pfx_dcn32_internal_validate_bw+0x10/0x10 [amdgpu]
[ 4978.132741] ? kernel_fpu_begin_mask+0xff/0x200
[ 4978.132749] ? rcu_is_watching+0x15/0xb0
[ 4978.132756] dcn32_validate_bandwidth+0x21f/0x8c0 [amdgpu]
[ 4978.132981] ? __pfx_dcn32_validate_bandwidth+0x10/0x10 [amdgpu]
[ 4978.133205] ? dc_resource_state_copy_construct+0x347/0x580 [amdgpu]
[ 4978.133427] dc_update_planes_and_stream+0xfb9/0x1ed0 [amdgpu]
[ 4978.133642] ? lock_acquire+0x120/0x4f0
[ 4978.133648] ? amdgpu_dm_atomic_commit_tail+0x3c52/0xe9e0 [amdgpu]
[ 4978.133885] ? __pfx_dc_update_planes_and_stream+0x10/0x10 [amdgpu]
[ 4978.134105] ? __pfx_lock_acquired+0x10/0x10
[ 4978.134108] ? local_clock_noinstr+0xd/0xc0
[ 4978.134112] ? __pfx___might_resched+0x10/0x10
[ 4978.134129] ? mark_held_locks+0x96/0xe0
[ 4978.134138] amdgpu_dm_atomic_commit_tail+0x4183/0xe9e0 [amdgpu]
[ 4978.134372] ? __pfx_stack_trace_consume_entry+0x10/0x10
[ 4978.134392] ? __pfx_amdgpu_dm_atomic_commit_tail+0x10/0x10 [amdgpu]
[ 4978.134642] ? mark_held_locks+0x96/0xe0
[ 4978.134661] ? drm_crtc_commit_wait+0x32/0x160
[ 4978.134664] ? drm_atomic_helper_wait_for_dependencies+0x48a/0x7c0
[ 4978.134672] commit_tail+0x1ad/0x310
[ 4978.134678] drm_atomic_helper_commit+0x229/0x2a0
[ 4978.134682] ? __pfx_drm_atomic_helper_commit+0x10/0x10
[ 4978.134685] drm_atomic_commit+0x1d4/0x2a0
[ 4978.134689] ? __pfx_drm_atomic_commit+0x10/0x10
[ 4978.134692] ? __pfx___drm_printfn_info+0x10/0x10
[ 4978.134697] ? _raw_spin_unlock_irqrestore+0x4f/0x80
[ 4978.134704] ? drm_event_reserve_init+0x1c3/0x240
[ 4978.134713] drm_mode_atomic_ioctl+0x153b/0x2130
[ 4978.134736] ? __pfx_drm_mode_atomic_ioctl+0x10/0x10
[ 4978.134741] ? lock_acquire+0x1a6/0x4f0
[ 4978.134744] ? find_held_lock+0x34/0x120
[ 4978.134757] ? do_raw_spin_unlock+0x58/0x1f0
[ 4978.134762] ? __pfx_drm_mode_atomic_ioctl+0x10/0x10
[ 4978.134766] drm_ioctl_kernel+0x1ff/0x3e0
[ 4978.134771] ? __pfx_drm_ioctl_kernel+0x10/0x10
[ 4978.134778] drm_ioctl+0x4ce/0xab0
[ 4978.134783] ? __pfx_drm_mode_atomic_ioctl+0x10/0x10
[ 4978.134788] ? __pfx_drm_ioctl+0x10/0x10
[ 4978.134798] ? _raw_spin_unlock_irqrestore+0x66/0x80
[ 4978.134801] ? lockdep_hardirqs_on+0x81/0x110
[ 4978.134805] ? _raw_spin_unlock_irqrestore+0x4f/0x80
[ 4978.134810] amdgpu_drm_ioctl+0xd8/0x1c0 [amdgpu]
[ 4978.135003] __x64_sys_ioctl+0x134/0x1b0
[ 4978.135008] do_syscall_64+0x5d/0x90
[ 4978.135012] ? asm_exc_page_fault+0x26/0x30
[ 4978.135016] ? lockdep_hardirqs_on+0x81/0x110
[ 4978.135019] entry_SYSCALL_64_after_hwframe+0x73/0xdd
[ 4978.135023] RIP: 0033:0x7f80a0f1139d
[ 4978.135041] Code: 04 25 28 00 00 00 48 89 45 c8 31 c0 48 8d 45 10 c7 45 b0 10 00 00 00 48 89 45 b8 48 8d 45 d0 48 89 45 c0 b8 10 00 00 00 0f 05 <89> c2 3d 00 f0 ff ff 77 1a 48 8b 45 c8 64 48 2b 04 25 28 00 00 00
[ 4978.135044] RSP: 002b:00007f80869e3970 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
[ 4978.135048] RAX: ffffffffffffffda RBX: 00007f8074026f40 RCX: 00007f80a0f1139d
[ 4978.135051] RDX: 00007f80869e3a10 RSI: 00000000c03864bc RDI: 000000000000000c
[ 4978.135053] RBP: 00007f80869e39c0 R08: 0000000000000180 R09: 0000000000000001
[ 4978.135055] R10: 000000000000000e R11: 0000000000000246 R12: 00007f80869e3a10
[ 4978.135057] R13: 00000000c03864bc R14: 000000000000000c R15: 00007f8074027f40
[ 4978.135067] </TASK>
When some application enter in full-screen mode when refresh rate is 120Hz
[ 5519.653363] BUG: sleeping function called from invalid context at include/linux/sched/mm.h:306
[ 5519.653372] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 6751, name: kworker/u64:1
[ 5519.653375] preempt_count: 1, expected: 0
[ 5519.653377] RCU nest depth: 0, expected: 0
[ 5519.653380] 3 locks held by kworker/u64:1/6751:
[ 5519.653382] #0: ffff8881080a2148 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work+0x81f/0x1540
[ 5519.653395] #1: ffffc900178cfd98 ((work_completion)(&state->commit_work)){+.+.}-{0:0}, at: process_one_work+0x84d/0x1540
[ 5519.653403] #2: ffff88818a05ddb0 (&adev->dm.dc_lock){+.+.}-{3:3}, at: amdgpu_dm_atomic_commit_tail+0xaa3/0xe9e0 [amdgpu]
[ 5519.653656] Preemption disabled at:
[ 5519.653658] [<ffffffffc153f0e3>] dc_fpu_begin+0x23/0x250 [amdgpu]
[ 5519.653884] CPU: 2 PID: 6751 Comm: kworker/u64:1 Tainted: G W L ------- --- 6.5.0-0.rc6.20230816git4853c74bd7ab.45.fc40.x86_64+debug #1
[ 5519.653888] Hardware name: Micro-Star International Co., Ltd. MS-7D73/MPG B650I EDGE WIFI (MS-7D73), BIOS 1.44 08/02/2023
[ 5519.653892] Workqueue: events_unbound commit_work
[ 5519.653900] Call Trace:
[ 5519.653903] <TASK>
[ 5519.653906] dump_stack_lvl+0xb1/0xd0
[ 5519.653914] __might_resched+0x3d9/0x600
[ 5519.653919] ? __pfx___might_resched+0x10/0x10
[ 5519.653924] __kmem_cache_alloc_node+0x3a7/0x3e0
[ 5519.653930] ? dc_create_stream_for_sink+0x58/0xf30 [amdgpu]
[ 5519.654146] kmalloc_trace+0x2a/0xc0
[ 5519.654151] dc_create_stream_for_sink+0x58/0xf30 [amdgpu]
[ 5519.654347] ? __pfx_resource_build_scaling_params+0x10/0x10 [amdgpu]
[ 5519.654545] dcn32_add_phantom_pipes+0x91/0xc90 [amdgpu]
[ 5519.654748] dcn32_internal_validate_bw+0x356c/0x6260 [amdgpu]
[ 5519.654962] ? commit_tail+0x1ad/0x310
[ 5519.654964] ? process_one_work+0x924/0x1540
[ 5519.654978] ? __pfx_dcn32_internal_validate_bw+0x10/0x10 [amdgpu]
[ 5519.655185] ? kernel_fpu_begin_mask+0xff/0x200
[ 5519.655193] ? rcu_is_watching+0x15/0xb0
[ 5519.655199] dcn32_validate_bandwidth+0x21f/0x8c0 [amdgpu]
[ 5519.655402] ? __pfx_dcn32_validate_bandwidth+0x10/0x10 [amdgpu]
[ 5519.655604] ? dc_rem_all_planes_for_stream+0x1c4/0x2d0 [amdgpu]
[ 5519.655802] dc_validate_global_state+0x804/0xf40 [amdgpu]
[ 5519.656002] dc_validate_with_context+0x923/0xf40 [amdgpu]
[ 5519.656195] ? __pfx___alloc_pages+0x10/0x10
[ 5519.656200] ? __pfx_dc_validate_with_context+0x10/0x10 [amdgpu]
[ 5519.656395] ? __kmalloc_large_node+0xe0/0x170
[ 5519.656400] ? dc_resource_state_copy_construct+0x3b4/0x580 [amdgpu]
[ 5519.656590] dc_commit_streams+0x4bf/0xc50 [amdgpu]
[ 5519.656785] ? __pfx_dc_commit_streams+0x10/0x10 [amdgpu]
[ 5519.656975] ? rcu_is_watching+0x15/0xb0
[ 5519.656990] ? drm_atomic_helper_calc_timestamping_constants+0x163/0x200
[ 5519.656996] amdgpu_dm_atomic_commit_tail+0xb10/0xe9e0 [amdgpu]
[ 5519.657209] ? mark_lock+0x101/0x1700
[ 5519.657214] ? mark_lock+0x101/0x1700
[ 5519.657220] ? unwind_next_frame+0xc4f/0x1fc0
[ 5519.657223] ? arch_stack_walk+0x79/0x100
[ 5519.657228] ? mark_lock+0x101/0x1700
[ 5519.657231] ? ret_from_fork_asm+0x1b/0x30
[ 5519.657237] ? print_usage_bug.part.0+0x5f0/0x600
[ 5519.657244] ? __pfx_amdgpu_dm_atomic_commit_tail+0x10/0x10 [amdgpu]
[ 5519.657448] ? ret_from_fork_asm+0x1b/0x30
[ 5519.657453] ? stack_trace_save+0x95/0xd0
[ 5519.657458] ? __lock_acquire+0x16ca/0x5b50
[ 5519.657467] ? mark_lock+0x101/0x1700
[ 5519.657470] ? __pfx___lock_acquire+0x10/0x10
[ 5519.657475] ? __pfx_mark_lock+0x10/0x10
[ 5519.657480] ? lock_acquire+0x1a6/0x4f0
[ 5519.657483] ? find_held_lock+0x34/0x120
[ 5519.657486] ? local_clock_noinstr+0xd/0xc0
[ 5519.657494] ? mark_held_locks+0x96/0xe0
[ 5519.657499] ? _raw_spin_unlock_irq+0x28/0x60
[ 5519.657503] ? lockdep_hardirqs_on+0x81/0x110
[ 5519.657506] ? _raw_spin_unlock_irq+0x38/0x60
[ 5519.657508] ? __wait_for_common+0x2d3/0x5f0
[ 5519.657512] ? __pfx_schedule_timeout+0x10/0x10
[ 5519.657514] ? mark_held_locks+0x96/0xe0
[ 5519.657519] ? __pfx___wait_for_common+0x10/0x10
[ 5519.657522] ? _raw_spin_unlock_irqrestore+0x66/0x80
[ 5519.657524] ? lockdep_hardirqs_on+0x81/0x110
[ 5519.657527] ? _raw_spin_unlock_irqrestore+0x4f/0x80
[ 5519.657530] ? drm_atomic_helper_wait_for_fences+0x4e8/0x710
[ 5519.657536] ? drm_crtc_commit_wait+0x32/0x160
[ 5519.657540] ? drm_atomic_helper_wait_for_dependencies+0x48a/0x7c0
[ 5519.657546] commit_tail+0x1ad/0x310
[ 5519.657551] process_one_work+0x924/0x1540
[ 5519.657557] ? worker_thread+0x2c8/0x12c0
[ 5519.657560] ? __pfx_process_one_work+0x10/0x10
[ 5519.657569] worker_thread+0x104/0x12c0
[ 5519.657578] ? __pfx_worker_thread+0x10/0x10
[ 5519.657581] kthread+0x2eb/0x3c0
[ 5519.657584] ? __pfx_kthread+0x10/0x10
[ 5519.657588] ret_from_fork+0x31/0x70
[ 5519.657592] ? __pfx_kthread+0x10/0x10
[ 5519.657595] ret_from_fork_asm+0x1b/0x30
[ 5519.657604] </TASK>
When some application exit from full-screen mode when refresh rate is 120Hz
[ 5579.628728] BUG: sleeping function called from invalid context at include/linux/sched/mm.h:306
[ 5579.628738] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 4034, name: kworker/u64:5
[ 5579.628741] preempt_count: 1, expected: 0
[ 5579.628744] RCU nest depth: 0, expected: 0
[ 5579.628747] 3 locks held by kworker/u64:5/4034:
[ 5579.628750] #0: ffff8881080a2148 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work+0x81f/0x1540
[ 5579.628765] #1: ffffc900046afd98 ((work_completion)(&state->commit_work)){+.+.}-{0:0}, at: process_one_work+0x84d/0x1540
[ 5579.628774] #2: ffff88818a05ddb0 (&adev->dm.dc_lock){+.+.}-{3:3}, at: amdgpu_dm_atomic_commit_tail+0xaa3/0xe9e0 [amdgpu]
[ 5579.629043] Preemption disabled at:
[ 5579.629044] [<ffffffffc153f0e3>] dc_fpu_begin+0x23/0x250 [amdgpu]
[ 5579.629285] CPU: 4 PID: 4034 Comm: kworker/u64:5 Tainted: G W L ------- --- 6.5.0-0.rc6.20230816git4853c74bd7ab.45.fc40.x86_64+debug #1
[ 5579.629289] Hardware name: Micro-Star International Co., Ltd. MS-7D73/MPG B650I EDGE WIFI (MS-7D73), BIOS 1.44 08/02/2023
[ 5579.629291] Workqueue: events_unbound commit_work
[ 5579.629297] Call Trace:
[ 5579.629300] <TASK>
[ 5579.629303] dump_stack_lvl+0xb1/0xd0
[ 5579.629309] __might_resched+0x3d9/0x600
[ 5579.629314] ? __pfx___might_resched+0x10/0x10
[ 5579.629320] __kmem_cache_alloc_node+0x3a7/0x3e0
[ 5579.629326] ? dc_create_stream_for_sink+0x58/0xf30 [amdgpu]
[ 5579.629558] kmalloc_trace+0x2a/0xc0
[ 5579.629564] dc_create_stream_for_sink+0x58/0xf30 [amdgpu]
[ 5579.629783] ? __pfx_resource_build_scaling_params+0x10/0x10 [amdgpu]
[ 5579.630003] dcn32_add_phantom_pipes+0x91/0xc90 [amdgpu]
[ 5579.630229] dcn32_internal_validate_bw+0x356c/0x6260 [amdgpu]
[ 5579.630468] ? commit_tail+0x1ad/0x310
[ 5579.630471] ? process_one_work+0x924/0x1540
[ 5579.630486] ? __pfx_dcn32_internal_validate_bw+0x10/0x10 [amdgpu]
[ 5579.630718] ? kernel_fpu_begin_mask+0xff/0x200
[ 5579.630726] ? rcu_is_watching+0x15/0xb0
[ 5579.630732] dcn32_validate_bandwidth+0x21f/0x8c0 [amdgpu]
[ 5579.630958] ? __pfx_dcn32_validate_bandwidth+0x10/0x10 [amdgpu]
[ 5579.631185] ? dc_rem_all_planes_for_stream+0x1c4/0x2d0 [amdgpu]
[ 5579.631405] dc_validate_global_state+0x804/0xf40 [amdgpu]
[ 5579.631625] dc_validate_with_context+0x923/0xf40 [amdgpu]
[ 5579.631838] ? __pfx___alloc_pages+0x10/0x10
[ 5579.631844] ? __pfx_dc_validate_with_context+0x10/0x10 [amdgpu]
[ 5579.632060] ? __kmalloc_large_node+0xe0/0x170
[ 5579.632066] ? dc_resource_state_copy_construct+0x3b4/0x580 [amdgpu]
[ 5579.632278] dc_commit_streams+0x4bf/0xc50 [amdgpu]
[ 5579.632557] ? __pfx_dc_commit_streams+0x10/0x10 [amdgpu]
[ 5579.632838] ? rcu_is_watching+0x15/0xb0
[ 5579.632854] ? drm_atomic_helper_calc_timestamping_constants+0x163/0x200
[ 5579.632862] amdgpu_dm_atomic_commit_tail+0xb10/0xe9e0 [amdgpu]
[ 5579.633100] ? optc1_get_crtc_scanoutpos+0x229/0x470 [amdgpu]
[ 5579.633332] ? __pfx_mark_lock+0x10/0x10
[ 5579.633336] ? __pfx_optc1_get_crtc_scanoutpos+0x10/0x10 [amdgpu]
[ 5579.633564] ? find_held_lock+0x34/0x120
[ 5579.633568] ? local_clock_noinstr+0xd/0xc0
[ 5579.633573] ? mark_lock+0x101/0x1700
[ 5579.633580] ? print_usage_bug.part.0+0x5f0/0x600
[ 5579.633588] ? __pfx_amdgpu_dm_atomic_commit_tail+0x10/0x10 [amdgpu]
[ 5579.633831] ? seqcount_lockdep_reader_access.constprop.0+0xa5/0xb0
[ 5579.633839] ? ktime_get+0x67/0xe0
[ 5579.633844] ? amdgpu_display_get_crtc_scanoutpos+0x163/0x4a0 [amdgpu]
[ 5579.634128] ? __lock_acquire+0x16ca/0x5b50
[ 5579.634144] ? mark_lock+0x101/0x1700
[ 5579.634150] ? amdgpu_crtc_get_scanout_position+0x74/0xd0 [amdgpu]
[ 5579.634493] ? __pfx___lock_acquire+0x10/0x10
[ 5579.634502] ? __pfx_mark_lock+0x10/0x10
[ 5579.634512] ? lock_acquire+0x1a6/0x4f0
[ 5579.634517] ? find_held_lock+0x34/0x120
[ 5579.634523] ? local_clock_noinstr+0xd/0xc0
[ 5579.634539] ? mark_held_locks+0x96/0xe0
[ 5579.634549] ? _raw_spin_unlock_irq+0x28/0x60
[ 5579.634555] ? lockdep_hardirqs_on+0x81/0x110
[ 5579.634561] ? _raw_spin_unlock_irq+0x38/0x60
[ 5579.634566] ? __wait_for_common+0x2d3/0x5f0
[ 5579.634572] ? __pfx_schedule_timeout+0x10/0x10
[ 5579.634577] ? find_held_lock+0x34/0x120
[ 5579.634583] ? local_clock_noinstr+0xd/0xc0
[ 5579.634589] ? __pfx___wait_for_common+0x10/0x10
[ 5579.634595] ? drm_crtc_next_vblank_start+0x155/0x2c0
[ 5579.634604] ? drm_atomic_helper_wait_for_fences+0x1bb/0x710
[ 5579.634616] ? drm_crtc_commit_wait+0x32/0x160
[ 5579.634622] ? drm_atomic_helper_wait_for_dependencies+0x48a/0x7c0
[ 5579.634635] commit_tail+0x1ad/0x310
[ 5579.634645] process_one_work+0x924/0x1540
[ 5579.634657] ? worker_thread+0x2c8/0x12c0
[ 5579.634663] ? __pfx_process_one_work+0x10/0x10
[ 5579.634683] worker_thread+0x104/0x12c0
[ 5579.634701] ? __pfx_worker_thread+0x10/0x10
[ 5579.634707] kthread+0x2eb/0x3c0
[ 5579.634713] ? __pfx_kthread+0x10/0x10
[ 5579.634721] ret_from_fork+0x31/0x70
[ 5579.634727] ? __pfx_kthread+0x10/0x10
[ 5579.634730] ret_from_fork_asm+0x1b/0x30
[ 5579.634741] </TASK>
This trace also appears every boot.
And this trace also appears when some application enter or leave fullscreen mode (this trace reproduced when Google Chrome exit from fullscreen mode by F11 key)
GPU: Radeon 7900XTX
CPU: Ryzen 7950X
DE: GNOME
My kernel build config: config-6.5.0-0.rc6.20230818git0e8860d2125f.47.fc40.x86_64+debug