Lang Yu
6e8bcdd63a
drm/amd/amdgpu: fix a potential deadlock in gpu reset
When amdgpu_ib_ring_tests failed, the reset logic called
amdgpu_device_ip_suspend twice, then deadlock occurred.
Deadlock log:
[ 805.655192] amdgpu 0000:04:00.0: amdgpu: ib ring test failed (-110).
[ 806.290952] [drm] free PSP TMR buffer
[ 806.319406] ============================================
[ 806.320315] WARNING: possible recursive locking detected
[ 806.321225] 5.11.0-custom #1 Tainted: G W OEL
[ 806.322135] --------------------------------------------
[ 806.323043] cat/2593 is trying to acquire lock:
[ 806.323825] ffff888136b1cdc8 (&adev->dm.dc_lock){+.+.}-{3:3}, at: dm_suspend+0xb8/0x1d0 [amdgpu]
[ 806.325668]
but task is already holding lock:
[ 806.326664] ffff888136b1cdc8 (&adev->dm.dc_lock){+.+.}-{3:3}, at: dm_suspend+0xb8/0x1d0 [amdgpu]
[ 806.328430]
other info that might help us debug this:
[ 806.329539] Possible unsafe locking scenario:
[ 806.330549] CPU0
[ 806.330983] ----
[ 806.331416] lock(&adev->dm.dc_lock);
[ 806.332086] lock(&adev->dm.dc_lock);
[ 806.332738]
*** DEADLOCK ***
[ 806.333747] May be due to missing lock nesting notation
[ 806.334899] 3 locks held by cat/2593:
[ 806.335537] #0: ffff888100d3f1b8 (&attr->mutex){+.+.}-{3:3}, at: simple_attr_read+0x4e/0x110
[ 806.337009] #1: ffff888136b1fd78 (&adev->reset_sem){++++}-{3:3}, at: amdgpu_device_lock_adev+0x42/0x94 [amdgpu]
[ 806.339018] #2: ffff888136b1cdc8 (&adev->dm.dc_lock){+.+.}-{3:3}, at: dm_suspend+0xb8/0x1d0 [amdgpu]
[ 806.340869]
stack backtrace:
[ 806.341621] CPU: 6 PID: 2593 Comm: cat Tainted: G W OEL 5.11.0-custom #1
[ 806.342921] Hardware name: AMD Celadon-CZN/Celadon-CZN, BIOS WLD0C23N_Weekly_20_12_2 12/23/2020
[ 806.344413] Call Trace:
[ 806.344849] dump_stack+0x93/0xbd
[ 806.345435] __lock_acquire.cold+0x18a/0x2cf
[ 806.346179] lock_acquire+0xca/0x390
[ 806.346807] ? dm_suspend+0xb8/0x1d0 [amdgpu]
[ 806.347813] __mutex_lock+0x9b/0x930
[ 806.348454] ? dm_suspend+0xb8/0x1d0 [amdgpu]
[ 806.349434] ? amdgpu_device_indirect_rreg+0x58/0x70 [amdgpu]
[ 806.350581] ? _raw_spin_unlock_irqrestore+0x47/0x50
[ 806.351437] ? dm_suspend+0xb8/0x1d0 [amdgpu]
[ 806.352437] ? rcu_read_lock_sched_held+0x4f/0x80
[ 806.353252] ? rcu_read_lock_sched_held+0x4f/0x80
[ 806.354064] mutex_lock_nested+0x1b/0x20
[ 806.354747] ? mutex_lock_nested+0x1b/0x20
[ 806.355457] dm_suspend+0xb8/0x1d0 [amdgpu]
[ 806.356427] ? soc15_common_set_clockgating_state+0x17d/0x19 [amdgpu]
[ 806.357736] amdgpu_device_ip_suspend_phase1+0x78/0xd0 [amdgpu]
[ 806.360394] amdgpu_device_ip_suspend+0x21/0x70 [amdgpu]
[ 806.362926] amdgpu_device_pre_asic_reset+0xb3/0x270 [amdgpu]
[ 806.365560] amdgpu_device_gpu_recover.cold+0x679/0x8eb [amdgpu]
Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Acked-by: Christian KÃnig <christian.koenig@amd.com>
Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2021-05-19 22:44:50 -04:00
..
2021-03-10 00:01:34 -05:00
2021-04-09 16:46:32 -04:00
2021-04-09 16:46:26 -04:00
2020-12-01 16:04:43 -05:00
2021-05-10 18:06:42 -04:00
2021-03-23 22:59:28 -04:00
2021-04-28 23:35:49 -04:00
2021-03-23 22:59:28 -04:00
2021-05-10 18:06:42 -04:00
2021-05-10 18:06:42 -04:00
2020-11-10 17:48:47 +10:00
2021-01-05 11:33:20 -05:00
2021-01-05 11:33:20 -05:00
2021-05-19 22:44:10 -04:00
2021-05-19 22:37:50 -04:00
2021-05-19 22:44:06 -04:00
2021-05-19 22:30:03 -04:00
2021-04-09 16:50:34 -04:00
2021-05-19 22:44:48 -04:00
2021-05-19 22:30:14 -04:00
2021-04-09 16:45:12 -04:00
2021-03-26 15:53:21 +01:00
2020-12-23 15:03:08 -05:00
2021-04-20 21:51:13 -04:00
2020-11-13 17:29:46 -05:00
2020-11-02 15:35:50 -05:00
2021-03-03 23:05:16 -05:00
2021-02-18 16:43:09 -05:00
2021-05-19 22:44:50 -04:00
2021-05-19 22:29:22 -04:00
2021-05-19 22:29:22 -04:00
2021-05-10 18:06:45 -04:00
2021-04-09 16:36:40 -04:00
2021-04-15 16:32:44 -04:00
2020-11-09 09:19:24 +01:00
2021-05-10 18:06:45 -04:00
2021-05-19 22:43:43 -04:00
2021-04-20 21:50:59 -04:00
2021-01-15 15:21:41 -05:00
2021-04-20 21:51:02 -04:00
2021-02-18 16:43:09 -05:00
2021-04-09 16:45:28 -04:00
2021-05-19 22:38:11 -04:00
2021-04-09 16:51:22 -04:00
2021-05-10 18:06:43 -04:00
2021-04-28 23:36:05 -04:00
2021-04-23 17:17:56 -04:00
2021-05-10 18:06:43 -04:00
2021-05-10 18:06:43 -04:00
2021-01-13 09:02:58 +01:00
2021-04-28 23:36:05 -04:00
2021-04-23 17:19:05 -04:00
2021-04-28 23:36:05 -04:00
2021-03-23 23:30:23 -04:00
2021-04-09 16:51:04 -04:00
2021-04-09 16:43:28 -04:00
2021-01-29 11:30:22 +01:00
2021-05-10 18:08:12 -04:00
2021-05-10 18:11:44 -04:00
2021-04-20 21:46:50 -04:00
2021-04-20 21:46:43 -04:00
2021-05-19 22:30:03 -04:00
2021-04-09 16:51:04 -04:00
2021-04-23 17:18:56 -04:00
2021-05-19 22:32:09 -04:00
2020-11-13 17:29:46 -05:00
2021-04-15 16:32:45 -04:00
2021-05-19 22:40:47 -04:00
2021-04-09 16:46:18 -04:00
2021-03-23 23:00:22 -04:00
2021-04-09 16:54:53 -04:00
2021-02-26 17:23:49 -05:00
2021-05-19 22:38:11 -04:00
2021-05-19 22:38:11 -04:00
2021-04-09 16:38:47 -04:00
2021-04-09 16:46:26 -04:00
2021-04-09 16:46:32 -04:00
2021-04-20 21:51:09 -04:00
2021-04-09 16:44:56 -04:00
2021-04-09 16:50:17 -04:00
2020-11-02 15:34:29 -05:00
2020-11-13 17:29:46 -05:00
2020-11-02 15:34:29 -05:00
2021-03-05 15:12:23 -05:00
2021-05-19 22:29:49 -04:00
2021-01-13 23:58:14 -05:00
2021-04-28 23:35:49 -04:00
2020-11-13 17:29:46 -05:00
2021-04-09 16:45:12 -04:00
2021-01-15 09:05:32 +10:00
2021-05-19 22:44:39 -04:00
2021-05-19 22:32:21 -04:00
2021-05-19 22:40:47 -04:00
2021-03-23 22:54:38 -04:00
2021-04-09 16:51:11 -04:00
2021-04-09 16:51:11 -04:00
2021-04-09 16:42:20 -04:00
2020-11-24 12:02:38 -05:00
2021-01-07 10:46:32 +01:00
2021-05-19 22:40:58 -04:00
2021-04-09 16:45:03 -04:00
2020-11-02 15:34:29 -05:00
2021-05-19 22:33:58 -04:00
2021-05-19 22:29:58 -04:00
2020-11-13 17:29:47 -05:00
2020-11-13 17:29:47 -05:00
2021-05-19 22:33:54 -04:00
2021-05-19 22:33:54 -04:00
2021-05-19 22:32:21 -04:00
2021-04-09 16:51:07 -04:00
2021-04-09 16:51:07 -04:00
2021-05-19 22:29:22 -04:00
2021-05-19 22:29:58 -04:00
2021-01-05 11:33:20 -05:00
2021-05-19 22:41:19 -04:00
2021-03-23 23:31:17 -04:00
2021-03-23 23:31:17 -04:00
2020-11-16 15:56:35 -05:00
2020-11-02 15:35:53 -05:00
2021-05-19 22:40:09 -04:00
2020-11-24 12:09:52 -05:00
2021-04-09 16:44:56 -04:00
2021-02-26 17:23:49 -05:00
2021-01-05 15:05:16 -05:00
2021-04-09 16:36:40 -04:00
2021-04-09 16:36:40 -04:00
2021-04-09 16:36:40 -04:00
2021-04-09 16:36:40 -04:00
2021-05-19 22:29:32 -04:00
2020-11-02 15:34:31 -05:00
2021-05-19 22:44:19 -04:00
2021-02-24 09:28:55 -05:00
2021-04-09 16:44:56 -04:00
2021-04-09 16:44:56 -04:00
2020-11-13 17:29:47 -05:00
2021-04-09 16:44:56 -04:00
2021-05-19 22:38:08 -04:00
2021-05-19 22:29:17 -04:00
2021-04-23 17:15:21 -04:00
2021-04-20 21:35:45 -04:00
2021-04-09 16:51:22 -04:00
2021-05-19 22:44:43 -04:00
2021-04-20 21:47:34 -04:00
2020-11-17 14:07:18 -05:00
2021-03-23 23:29:26 -04:00
2021-04-15 16:03:01 -04:00
2021-04-15 16:03:01 -04:00
2021-03-23 22:58:30 -04:00
2021-03-23 22:58:30 -04:00
2021-05-10 18:06:43 -04:00
2021-05-19 22:38:11 -04:00
2021-05-19 22:40:17 -04:00
2021-05-10 18:06:43 -04:00
2021-05-10 18:06:43 -04:00
2021-01-05 11:32:55 -05:00
2021-01-05 11:32:55 -05:00
2021-01-05 15:05:16 -05:00
2021-04-09 16:44:56 -04:00
2021-04-09 16:44:56 -04:00
2021-04-09 16:44:56 -04:00
2021-03-23 22:53:34 -04:00
2021-04-09 16:44:56 -04:00
2021-02-18 16:43:09 -05:00
2021-05-19 22:40:09 -04:00
2021-04-09 16:44:56 -04:00
2021-04-15 16:03:01 -04:00
2021-04-09 16:51:19 -04:00
2021-05-10 18:11:44 -04:00
2021-04-09 16:51:19 -04:00
2021-05-19 22:40:50 -04:00
2021-05-11 09:44:35 -04:00
2021-04-20 21:35:45 -04:00
2021-04-09 16:51:19 -04:00
2021-01-13 23:47:39 -05:00
2020-12-15 11:35:35 -05:00
2021-01-13 23:47:39 -05:00
2020-12-15 11:35:35 -05:00
2021-05-19 22:43:40 -04:00
2021-02-09 15:28:04 -05:00
2021-04-15 16:32:44 -04:00
2021-01-05 11:33:14 -05:00
2021-01-05 11:33:14 -05:00
2021-04-15 16:32:44 -04:00
2021-04-09 16:51:04 -04:00
2021-05-19 22:43:40 -04:00
2021-05-19 22:40:09 -04:00
2021-04-28 23:35:51 -04:00
2021-01-13 23:58:14 -05:00
2021-05-19 22:43:32 -04:00
2020-11-10 14:14:51 -05:00
2021-03-23 22:54:15 -04:00
2021-03-23 22:51:54 -04:00
2021-04-09 16:44:56 -04:00
2021-04-09 16:44:56 -04:00
2021-04-28 23:36:04 -04:00
2021-04-20 21:45:17 -04:00
2021-03-23 22:55:31 -04:00
2021-05-19 22:44:45 -04:00
2021-05-19 22:40:26 -04:00
2021-04-09 16:44:56 -04:00
2020-11-02 15:34:31 -05:00
2021-02-26 17:23:49 -05:00
2020-11-13 17:29:47 -05:00
2020-11-13 17:29:45 -05:00
2020-11-13 00:13:16 -05:00
2021-02-09 15:28:36 -05:00
2021-02-09 15:28:21 -05:00
2020-11-13 17:29:45 -05:00
2020-11-13 00:13:22 -05:00
2021-04-28 23:35:49 -04:00
2021-03-23 22:52:38 -04:00
2021-04-09 16:50:17 -04:00
2021-05-19 22:44:16 -04:00
2021-03-23 22:59:50 -04:00
2021-04-23 17:15:33 -04:00
2021-03-23 23:27:41 -04:00
2021-01-05 15:05:16 -05:00
2021-04-09 16:51:11 -04:00
2021-04-09 16:51:11 -04:00
2021-04-09 16:51:11 -04:00
2021-04-09 16:51:11 -04:00
2021-04-09 16:51:11 -04:00
2021-04-09 16:51:11 -04:00
2021-04-09 16:44:56 -04:00
2021-04-09 16:44:56 -04:00
2021-04-09 16:44:56 -04:00
2021-04-09 16:44:56 -04:00
2021-04-09 16:44:56 -04:00
2021-04-09 16:44:56 -04:00
2021-04-09 16:44:56 -04:00
2021-04-09 16:44:56 -04:00
2021-05-10 18:07:48 -04:00
2021-04-09 16:44:56 -04:00
2021-04-09 16:44:56 -04:00
2021-03-23 22:53:17 -04:00
2021-05-19 22:40:58 -04:00
2021-04-20 21:48:58 -04:00
2021-04-09 16:47:11 -04:00
2020-12-23 15:05:35 -05:00
2021-05-19 22:29:30 -04:00