Anson Jacob
6f038b1a94
drm/amd/display: dcn20_resource_construct reduce scope of FPU enabled
[ Upstream commit bc39a69a2ac484e6575a958567c162ef56c9f278 ]
Limit when FPU is enabled to only functions that does FPU operations for
dcn20_resource_construct, which gets called during driver
initialization.
Enabling FPU operation disables preemption. Sleeping functions(mutex
(un)lock, memory allocation using GFP_KERNEL, etc.) should not be called
when preemption is disabled.
Fixes the following case caught by enabling
CONFIG_DEBUG_ATOMIC_SLEEP in kernel config
[ 1.338434] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:281
[ 1.347395] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 197, name: systemd-udevd
[ 1.356356] CPU: 7 PID: 197 Comm: systemd-udevd Not tainted 5.13.0+ #3
[ 1.356358] Hardware name: System manufacturer System Product Name/PRIME X570-PRO, BIOS 3405 02/01/2021
[ 1.356360] Call Trace:
[ 1.356361] dump_stack+0x6b/0x86
[ 1.356366] ___might_sleep.cold+0x87/0x98
[ 1.356370] __might_sleep+0x4b/0x80
[ 1.356372] mutex_lock+0x21/0x50
[ 1.356376] smu_get_uclk_dpm_states+0x3f/0x80 [amdgpu]
[ 1.356538] pp_nv_get_uclk_dpm_states+0x35/0x50 [amdgpu]
[ 1.356711] init_soc_bounding_box+0xf9/0x210 [amdgpu]
[ 1.356892] ? create_object+0x20d/0x340
[ 1.356897] ? dcn20_resource_construct+0x46f/0xd30 [amdgpu]
[ 1.357077] dcn20_resource_construct+0x4b1/0xd30 [amdgpu]
...
Tested on: 5700XT (NAVI10 0x1002:0x731F 0x1DA2:0xE410 0xC1)
Cc: Christian König <christian.koenig@amd.com>
Cc: Hersen Wu <hersenxs.wu@amd.com>
Cc: Anson Jacob <Anson.Jacob@amd.com>
Cc: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Acked-by: Agustin Gutierrez <agustin.gutierrez@amd.com>
Signed-off-by: Anson Jacob <Anson.Jacob@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-11-18 14:04:01 +01:00
..
2020-04-01 14:44:59 -04:00
2021-03-04 11:37:42 +01:00
2021-01-23 16:03:58 +01:00
2021-08-26 08:35:39 -04:00
2021-07-19 09:44:48 +02:00
2021-05-14 09:50:26 +02:00
2020-07-27 16:46:45 -04:00
2020-04-22 18:11:48 -04:00
2020-04-22 18:11:48 -04:00
2020-09-29 16:11:40 -04:00
2020-07-27 16:21:11 -04:00
2020-05-21 12:46:51 -04:00
2021-09-18 13:40:28 +02:00
2021-11-18 14:04:01 +01:00
2021-03-30 14:31:51 +02:00
2021-09-18 13:40:38 +02:00
2021-08-08 09:05:23 +02:00
2021-01-23 16:03:58 +01:00
2020-10-26 17:19:02 -04:00
2021-05-14 09:50:22 +02:00
2020-09-29 16:09:05 -04:00
2021-03-04 11:38:27 +01:00
2020-09-29 16:08:31 -04:00
2020-09-15 17:52:42 -04:00
2019-10-25 16:50:09 -04:00
2020-09-15 17:52:41 -04:00
2020-09-15 17:52:41 -04:00
2020-09-15 17:52:40 -04:00
2020-08-17 14:08:34 -04:00
2020-04-28 16:19:05 -04:00
2020-07-21 15:37:39 -04:00
2020-09-22 12:29:05 -04:00
2021-03-25 09:04:12 +01:00
2020-09-15 17:52:41 -04:00
2020-09-29 16:08:59 -04:00
2020-07-01 01:59:25 -04:00
2018-11-30 12:02:49 -05:00
2020-07-01 01:59:15 -04:00
2020-09-15 17:52:40 -04:00
2019-12-18 16:09:08 -05:00
2020-05-28 14:00:47 -04:00
2021-07-19 09:44:57 +02:00
2020-07-27 16:45:51 -04:00
2021-01-23 16:03:58 +01:00