Arvind Yadav
f15d4e92f7
drm/amdgpu: Fix display freeze lockup error
A deadlock situation has arised between the userq
signal ioctl and the eviction fence. In this scenario,
the function amdgpu_userq_signal_ioctl() has acquired a reservation
lock on the read/write buffer object (BO) through drm_exec.
Subsequently, it calls amdgpu_userqueue_ensure_ev_fence(),
which is in a waiting for the userq resume work.
Meanwhile, the userq suspend worker has initiated the userq resume
work(amdgpu_userqueue_resume_worker). This userq resume work attempts
to validate the vm->done BO, leading to amdgpu_userqueue_validate_bos
also attempting to reservation lock the same write BO that is already
locked by amdgpu_userq_signal_ioctl.
As a result, the resume work becomes stalled, causing
amdgpu_userqueue_ensure_ev_fence to remain in a waiting state.
Call Trace:
[ 242.836469] INFO: task gnome-shel:cs0:1288 blocked for more than 120 seconds.
[ 242.836486] Tainted: G OE 6.12.0-rc2rebased-oct-24+ #4
[ 242.836491] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 242.836494] task:gnome-shel:cs0 state:D stack:0 pid:1288 tgid:1282 ppid:1180 flags:0x00000002
[ 242.836503] Call Trace:
[ 242.836508] <TASK>
[ 242.836517] __schedule+0x3e0/0xb10
[ 242.836530] ? srso_return_thunk+0x5/0x5f
[ 242.836541] schedule+0x31/0x120
[ 242.836546] schedule_timeout+0x150/0x160
[ 242.836551] ? srso_return_thunk+0x5/0x5f
[ 242.836555] ? sysvec_call_function+0x69/0xd0
[ 242.836562] ? srso_return_thunk+0x5/0x5f
[ 242.836567] ? preempt_count_add+0x7f/0xd0
[ 242.836577] __wait_for_common+0x91/0x180
[ 242.836582] ? __pfx_schedule_timeout+0x10/0x10
[ 242.836590] wait_for_completion+0x28/0x30
[ 242.836595] __flush_work+0x16c/0x290
[ 242.836602] ? __pfx_wq_barrier_func+0x10/0x10
[ 242.836611] flush_delayed_work+0x3a/0x60
[ 242.836621] amdgpu_userqueue_ensure_ev_fence+0x2d/0xb0 [amdgpu]
[ 242.836966] amdgpu_userq_signal_ioctl+0x959/0xec0 [amdgpu]
[ 242.837171] ? __pfx_amdgpu_userq_signal_ioctl+0x10/0x10 [amdgpu]
[ 242.837365] drm_ioctl_kernel+0xae/0x100 [drm]
[ 242.837398] drm_ioctl+0x2a1/0x500 [drm]
[ 242.837420] ? __pfx_amdgpu_userq_signal_ioctl+0x10/0x10 [amdgpu]
[ 242.837622] ? srso_return_thunk+0x5/0x5f
[ 242.837627] ? srso_return_thunk+0x5/0x5f
[ 242.837630] ? _raw_spin_unlock_irqrestore+0x2b/0x50
[ 242.837635] amdgpu_drm_ioctl+0x4f/0x90 [amdgpu]
[ 242.837811] __x64_sys_ioctl+0x99/0xd0
[ 242.837820] x64_sys_call+0x1209/0x20d0
[ 242.837825] do_syscall_64+0x51/0x120
[ 242.837830] entry_SYSCALL_64_after_hwframe+0x76/0x7e
[ 242.837835] RIP: 0033:0x7f2f33f1a94f
[ 242.837838] RSP: 002b:00007f2f24ffea30 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
[ 242.837842] RAX: ffffffffffffffda RBX: 00007f2f24ffebd0 RCX: 00007f2f33f1a94f
[ 242.837845] RDX: 00007f2f24ffebd0 RSI: 00000000c0306457 RDI: 000000000000000d
[ 242.837847] RBP: 00007f2f24ffeab0 R08: 0000000000000000 R09: 0000000000000000
[ 242.837849] R10: 00007f2f24ffecd0 R11: 0000000000000246 R12: 00007f2f25000640
[ 242.837851] R13: 00000000c0306457 R14: 000000000000000d R15: 00007fff3b39c1e0
[ 242.837858] </TASK>
[ 242.837865] INFO: task Xwayland:cs0:1517 blocked for more than 120 seconds.
[ 242.837869] Tainted: G OE 6.12.0-rc2rebased-oct-24+ #4
[ 242.837872] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 242.837874] task:Xwayland:cs0 state:D stack:0 pid:1517 tgid:1338 ppid:1282 flags:0x00004002
[ 242.837878] Call Trace:
[ 242.837880] <TASK>
[ 242.837883] __schedule+0x3e0/0xb10
[ 242.837890] schedule+0x31/0x120
[ 242.837894] schedule_preempt_disabled+0x1c/0x30
[ 242.837897] __mutex_lock.constprop.0+0x386/0x6e0
[ 242.837902] ? srso_return_thunk+0x5/0x5f
[ 242.837905] ? __timer_delete_sync+0x81/0xe0
[ 242.837911] __mutex_lock_slowpath+0x13/0x20
[ 242.837915] mutex_lock+0x3b/0x50
[ 242.837919] amdgpu_userqueue_ensure_ev_fence+0x35/0xb0 [amdgpu]
[ 242.838138] amdgpu_userq_signal_ioctl+0x959/0xec0 [amdgpu]
[ 242.838340] ? __pfx_amdgpu_userq_signal_ioctl+0x10/0x10 [amdgpu]
[ 242.838531] drm_ioctl_kernel+0xae/0x100 [drm]
[ 242.838559] drm_ioctl+0x2a1/0x500 [drm]
[ 242.838580] ? __pfx_amdgpu_userq_signal_ioctl+0x10/0x10 [amdgpu]
[ 242.838778] ? srso_return_thunk+0x5/0x5f
[ 242.838783] ? srso_return_thunk+0x5/0x5f
[ 242.838786] ? _raw_spin_unlock_irqrestore+0x2b/0x50
[ 242.838791] amdgpu_drm_ioctl+0x4f/0x90 [amdgpu]
[ 242.838967] __x64_sys_ioctl+0x99/0xd0
[ 242.838972] x64_sys_call+0x1209/0x20d0
[ 242.838975] do_syscall_64+0x51/0x120
[ 242.838979] entry_SYSCALL_64_after_hwframe+0x76/0x7e
[ 242.838982] RIP: 0033:0x7f9118b1a94f
[ 242.838985] RSP: 002b:00007f910cdff760 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
[ 242.838989] RAX: ffffffffffffffda RBX: 00007f910cdff910 RCX: 00007f9118b1a94f
[ 242.838991] RDX: 00007f910cdff910 RSI: 00000000c0306457 RDI: 000000000000000c
[ 242.838993] RBP: 00007f910cdff7e0 R08: 0000000000000000 R09: 0000000000000001
[ 242.838995] R10: 00007f910cdff9d4 R11: 0000000000000246 R12: 00007f910ce00640
[ 242.838997] R13: 00000000c0306457 R14: 000000000000000c R15: 00007fff9dd11d10
[ 242.839004] </TASK>
v2: Addressed review comemnts from Christian.
v3/v4: Addressed review comemnts from Christian.
- Move drm_exec drm_exec loop after userq fence create.
- cleanup the newly created userq fence in case of error.
v5 - Addressed review comemnts from Christian.
- Create a new amdgpu_userq_fence_alloc() function for allocation.
- Calling dma_fence_put for cleanup procedure.
- make amdgpu_userq_fence_create() function static.
- drm_exec_init is called after mutex_unlock.
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Shashank Sharma <shashank.sharma@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Arvind Yadav <arvind.yadav@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2025-04-08 16:48:20 -04:00
..
2024-12-10 10:26:46 -05:00
2025-03-26 17:44:41 -04:00
2025-03-26 17:44:41 -04:00
2025-02-25 11:43:58 -05:00
2025-03-05 10:42:42 -05:00
2024-04-30 09:44:34 -04:00
2025-03-13 23:10:38 -04:00
2025-03-13 23:10:38 -04:00
2024-01-05 16:10:43 -05:00
2025-03-13 23:10:38 -04:00
2025-03-13 23:10:38 -04:00
2025-03-13 23:10:38 -04:00
2025-03-13 23:10:38 -04:00
2025-03-13 23:10:38 -04:00
2025-03-13 23:10:38 -04:00
2025-03-05 10:47:26 -05:00
2025-03-05 10:47:26 -05:00
2025-03-21 12:15:08 -04:00
2025-02-25 11:45:12 -05:00
2025-02-25 11:45:12 -05:00
2025-02-12 21:02:54 -05:00
2025-02-12 21:02:54 -05:00
2025-02-17 14:09:29 -05:00
2024-01-15 18:35:38 -05:00
2024-09-26 17:06:24 -04:00
2024-04-26 17:22:38 -04:00
2025-03-26 17:46:33 -04:00
2025-04-07 15:18:34 -04:00
2025-01-07 12:45:19 +02:00
2024-05-23 14:37:24 +03:00
2025-04-08 16:48:14 -04:00
2025-02-17 14:09:30 -05:00
2025-03-21 12:16:34 -04:00
2024-02-16 15:41:50 -05:00
2024-08-13 13:03:57 -04:00
2025-03-13 23:12:52 -04:00
2023-12-07 17:43:13 -05:00
2025-02-25 11:44:00 -05:00
2024-08-29 13:38:53 -04:00
2025-04-08 16:48:16 -04:00
2024-07-24 17:30:23 -04:00
2025-04-07 14:32:20 -04:00
2024-10-01 17:40:07 -04:00
2024-12-18 12:13:49 -05:00
2024-12-18 12:13:49 -05:00
2025-04-07 15:18:30 -04:00
2025-04-08 16:48:20 -04:00
2024-12-05 12:35:42 +02:00
2024-11-04 11:33:24 -05:00
2024-05-20 16:20:26 -04:00
2025-04-08 16:48:19 -04:00
2025-04-08 16:48:19 -04:00
2024-12-19 16:56:28 +01:00
2024-06-19 14:17:25 -04:00
2025-02-25 11:44:00 -05:00
2024-12-10 10:26:51 -05:00
2025-01-14 11:06:50 -05:00
2024-11-04 12:05:30 -05:00
2024-08-16 14:23:16 -04:00
2025-04-08 16:48:20 -04:00
2024-09-18 16:15:13 -04:00
2025-04-07 15:18:34 -04:00
2025-04-08 16:48:17 -04:00
2024-08-23 10:53:16 -04:00
2025-04-07 15:18:30 -04:00
2025-02-27 16:50:04 -05:00
2024-06-14 16:15:58 -04:00
2024-05-13 15:44:02 -04:00
2025-02-12 21:02:54 -05:00
2025-02-12 21:02:54 -05:00
2025-01-24 09:55:04 -05:00
2025-03-21 12:16:34 -04:00
2025-03-21 12:16:34 -04:00
2024-12-18 12:39:07 -05:00
2025-03-07 12:53:30 -05:00
2024-06-27 17:34:40 -04:00
2025-02-25 11:43:58 -05:00
2025-02-27 15:52:49 -05:00
2025-03-21 12:16:34 -04:00
2024-08-20 22:06:43 -04:00
2025-02-12 21:03:01 -05:00
2025-02-12 21:03:01 -05:00
2025-04-08 16:48:18 -04:00
2024-10-28 16:41:26 -04:00
2024-06-19 12:50:31 -04:00
2025-04-08 16:48:19 -04:00
2025-04-08 16:48:16 -04:00
2024-08-23 10:53:16 -04:00
2025-02-12 21:02:54 -05:00
2024-02-22 10:21:27 -05:00
2024-10-15 11:17:25 -04:00
2025-04-07 14:30:57 -04:00
2025-01-09 15:48:50 +10:00
2024-09-06 17:38:53 -04:00
2024-11-21 15:56:22 -05:00
2024-08-20 23:04:17 -04:00
2025-03-21 12:15:08 -04:00
2025-04-07 15:18:58 -04:00
2025-04-08 16:48:14 -04:00
2025-03-18 14:03:38 -04:00
2025-04-08 16:48:14 -04:00
2025-03-26 17:44:34 -04:00
2024-04-22 19:44:16 +02:00
2024-12-10 10:27:50 -05:00
2024-11-20 10:03:05 -05:00
2024-08-16 14:17:31 -04:00
2025-03-26 17:45:42 -04:00
2025-03-21 12:16:35 -04:00
2024-01-15 18:35:38 -05:00
2024-05-02 16:18:10 -04:00
2024-12-18 12:17:32 -05:00
2024-11-03 01:28:06 -05:00
2025-04-07 15:18:59 -04:00
2025-03-21 12:16:35 -04:00
2024-05-08 15:17:04 -04:00
2025-04-08 16:48:20 -04:00
2025-04-08 16:48:17 -04:00
2024-03-20 13:38:16 -04:00
2025-03-21 12:16:36 -04:00
2025-03-21 12:16:34 -04:00
2025-03-21 12:16:34 -04:00
2025-02-25 11:45:12 -05:00
2025-02-03 12:11:36 -05:00
2025-02-12 21:05:49 -05:00
2025-04-07 15:18:58 -04:00
2025-02-12 21:02:56 -05:00
2025-02-25 11:45:12 -05:00
2024-01-15 18:35:38 -05:00
2025-02-17 14:09:02 -05:00
2024-05-13 15:45:41 -04:00
2025-04-08 16:48:20 -04:00
2025-04-08 16:48:20 -04:00
2025-04-08 16:48:20 -04:00
2024-12-10 10:26:51 -05:00
2024-12-18 12:17:32 -05:00
2025-04-07 15:18:31 -04:00
2025-03-19 15:54:36 -04:00
2025-04-07 18:00:40 -04:00
2025-04-07 15:18:58 -04:00
2025-02-25 11:43:58 -05:00
2024-09-10 13:44:29 -04:00
2025-02-12 21:05:49 -05:00
2024-09-18 16:15:06 -04:00
2024-03-20 13:38:14 -04:00
2025-03-21 12:16:34 -04:00
2025-02-12 21:05:50 -05:00
2024-12-18 12:17:32 -05:00
2024-11-08 11:45:29 -05:00
2025-04-07 15:18:30 -04:00
2024-04-22 19:44:16 +02:00
2025-01-14 11:06:50 -05:00
2024-11-04 12:06:23 -05:00
2025-04-07 15:18:59 -04:00
2025-02-27 16:50:04 -05:00
2025-04-08 16:48:19 -04:00
2025-04-07 15:18:58 -04:00
2025-03-26 17:44:32 -04:00
2024-01-15 18:31:45 -05:00
2024-02-12 16:08:12 -05:00
2024-02-12 16:08:12 -05:00
2024-10-02 17:23:23 -04:00
2024-01-15 18:35:37 -05:00
2024-01-15 18:35:37 -05:00
2025-01-07 12:45:19 +02:00
2025-01-07 12:45:19 +02:00
2024-08-27 14:33:12 +02:00
2024-01-15 18:35:37 -05:00
2025-02-25 11:43:58 -05:00
2025-04-07 15:18:32 -04:00
2025-02-25 11:43:58 -05:00
2025-04-07 15:18:32 -04:00
2024-01-15 18:35:38 -05:00
2024-05-02 16:18:10 -04:00
2024-01-18 15:37:52 -05:00
2025-02-25 11:43:58 -05:00
2025-04-08 16:48:13 -04:00
2025-04-08 16:48:13 -04:00
2025-04-08 16:48:13 -04:00
2025-04-08 16:48:13 -04:00
2024-05-08 15:17:07 -04:00
2024-11-21 15:56:22 -05:00
2024-07-24 17:30:23 -04:00
2024-07-24 17:30:23 -04:00
2025-04-07 15:18:34 -04:00
2025-04-07 15:18:34 -04:00
2025-04-07 15:18:34 -04:00
2024-10-22 17:50:39 -04:00
2025-04-07 18:01:08 -04:00
2024-10-22 17:50:39 -04:00
2024-12-18 12:17:32 -05:00
2024-08-20 22:07:16 -04:00
2024-08-20 22:07:16 -04:00
2025-04-07 18:01:08 -04:00
2025-02-12 21:04:06 -05:00
2025-02-12 21:02:59 -05:00
2025-04-08 16:05:07 -04:00
2025-02-12 21:02:59 -05:00
2025-01-06 14:44:28 -05:00
2024-11-05 10:33:56 -05:00
2024-08-06 11:11:01 -04:00
2024-11-05 10:33:56 -05:00
2025-04-08 16:48:19 -04:00
2024-08-16 14:24:56 -04:00
2025-04-08 16:48:19 -04:00
2024-12-11 17:32:13 -05:00
2025-03-05 10:47:21 -05:00
2025-02-12 21:03:00 -05:00
2025-03-13 23:10:08 -04:00
2024-07-08 16:46:36 -04:00
2024-04-30 10:00:30 -04:00
2025-04-08 16:48:14 -04:00
2025-04-07 15:18:32 -04:00
2025-02-25 11:43:58 -05:00
2025-04-07 15:18:59 -04:00
2025-02-25 11:43:58 -05:00
2025-02-25 11:43:58 -05:00
2025-03-13 23:18:02 -04:00
2024-04-30 10:00:39 -04:00
2025-02-12 21:04:06 -05:00
2025-02-12 21:04:06 -05:00
2025-02-12 21:04:06 -05:00
2025-02-12 21:04:06 -05:00
2025-02-12 21:04:06 -05:00
2024-02-12 16:09:57 -05:00
2025-02-25 11:43:58 -05:00
2025-02-25 11:43:58 -05:00
2025-02-25 11:43:58 -05:00
2025-02-25 11:43:58 -05:00
2024-02-12 16:09:42 -05:00
2025-02-12 21:02:55 -05:00
2024-12-10 10:26:51 -05:00
2024-05-02 16:18:11 -04:00
2025-02-27 15:52:49 -05:00
2025-02-27 15:52:49 -05:00
2025-02-27 15:52:49 -05:00
2025-02-27 15:52:49 -05:00
2025-02-27 15:52:29 -05:00
2024-10-01 17:40:43 -04:00
2025-02-25 11:43:58 -05:00
2024-09-10 17:26:49 -04:00
2025-02-25 11:43:58 -05:00
2025-02-25 11:43:58 -05:00
2025-03-26 17:44:41 -04:00
2025-03-05 10:38:01 -05:00
2025-02-25 11:43:58 -05:00
2025-02-25 11:43:58 -05:00
2024-09-10 17:26:49 -04:00
2025-02-25 11:43:58 -05:00
2024-06-27 17:34:33 -04:00
2025-03-05 10:47:36 -05:00
2025-03-05 10:37:56 -05:00
2025-04-08 16:48:16 -04:00
2024-02-12 16:08:41 -05:00
2024-02-12 16:08:41 -05:00
2025-04-08 16:48:19 -04:00
2025-04-08 16:48:19 -04:00
2025-04-08 16:48:19 -04:00
2025-04-08 16:48:16 -04:00
2025-04-08 16:48:16 -04:00
2024-05-02 16:18:10 -04:00
2024-12-10 10:26:47 -05:00
2025-02-12 21:05:49 -05:00
2025-04-07 15:18:58 -04:00
2024-06-14 16:17:12 -04:00
2025-02-12 21:02:55 -05:00
2024-12-18 12:22:22 -05:00
2024-04-30 09:58:25 -04:00
2025-02-12 21:05:49 -05:00
2024-06-27 17:31:37 -04:00
2024-06-27 17:31:37 -04:00
2025-03-05 10:47:03 -05:00
2025-03-05 10:46:40 -05:00
2024-06-14 16:15:58 -04:00
2025-02-25 11:43:58 -05:00
2024-10-01 17:39:38 -04:00
2025-02-25 11:44:01 -05:00
2025-02-25 11:44:01 -05:00
2025-02-12 21:04:06 -05:00
2025-02-12 21:04:06 -05:00
2025-02-12 21:04:06 -05:00
2025-02-12 21:04:06 -05:00
2025-02-12 21:04:06 -05:00
2025-02-12 21:04:06 -05:00
2025-02-12 21:04:06 -05:00
2025-02-12 21:04:06 -05:00
2025-02-12 21:04:06 -05:00
2025-03-13 23:08:51 -04:00
2025-02-12 21:03:00 -05:00
2024-10-07 14:32:00 -04:00
2025-02-12 21:05:49 -05:00
2025-04-07 15:18:58 -04:00
2025-02-12 21:02:55 -05:00
2024-02-14 17:16:07 -05:00
2025-02-25 11:43:58 -05:00
2025-02-25 11:43:58 -05:00
2025-02-25 11:43:58 -05:00
2025-03-26 17:44:47 -04:00
2025-02-25 11:43:58 -05:00
2024-08-13 10:26:53 -04:00
2025-02-25 11:43:58 -05:00
2024-08-13 10:26:59 -04:00
2024-06-14 15:22:14 -04:00
2025-04-08 16:48:19 -04:00
2025-04-08 16:48:19 -04:00
2024-04-30 10:03:32 -04:00
2025-04-07 15:18:33 -04:00
2025-04-07 15:18:34 -04:00
2025-04-07 15:18:32 -04:00
2025-04-08 16:48:14 -04:00
2025-04-08 16:48:14 -04:00
2024-11-20 10:03:05 -05:00
2024-11-20 10:03:05 -05:00
2024-09-18 16:14:26 -04:00
2024-03-20 13:38:16 -04:00
2024-03-20 13:38:16 -04:00
2025-04-07 15:18:31 -04:00
2024-07-27 17:28:28 -04:00
2025-02-12 21:03:00 -05:00
2025-03-13 23:08:51 -04:00
2025-02-25 11:43:58 -05:00
2024-04-30 09:46:51 -04:00
2025-03-26 17:44:34 -04:00
2024-12-10 10:26:49 -05:00
2025-02-25 11:43:58 -05:00
2024-01-18 15:38:00 -05:00
2024-01-09 15:43:54 -05:00
2024-03-20 13:38:15 -04:00
2024-12-10 10:28:39 -05:00
2024-12-10 10:28:39 -05:00
2025-04-08 16:48:14 -04:00
2025-04-08 16:48:14 -04:00
2024-05-23 15:09:35 -04:00
2025-03-05 10:37:13 -05:00
2025-03-05 10:37:13 -05:00
2025-02-25 11:43:58 -05:00
2025-02-25 11:43:58 -05:00
2024-12-10 10:26:47 -05:00
2025-03-10 13:36:21 -04:00
2025-02-25 11:43:58 -05:00
2024-12-10 10:26:47 -05:00
2025-02-27 16:50:05 -05:00
2025-02-27 16:50:05 -05:00
2025-03-19 15:56:09 -04:00
2025-02-27 16:50:05 -05:00
2025-04-08 16:48:14 -04:00
2025-03-05 10:37:35 -05:00
2025-04-07 15:18:59 -04:00
2025-02-27 15:52:31 -05:00
2025-02-27 16:50:05 -05:00
2024-12-11 17:37:13 -05:00
2025-03-05 10:46:33 -05:00
2025-03-05 10:37:31 -05:00
2025-02-25 11:43:58 -05:00
2025-03-26 17:44:47 -04:00
2025-02-25 11:43:58 -05:00
2025-03-13 23:08:25 -04:00
2024-08-16 14:24:09 -04:00
2024-03-07 15:32:58 -05:00
2024-07-02 18:06:24 -04:00