]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/amd/display: Move dml2_destroy to non-FPU compilation unit
authorRafal Ostrowski <rafal.ostrowski@amd.com>
Fri, 10 Apr 2026 07:09:57 +0000 (09:09 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 17 Apr 2026 19:25:27 +0000 (15:25 -0400)
commit8bf0cb97edb697dba2515e6452c17c5245111448
treeac81ac166dc44d60faf5ff3d8f8d6c33210c3b3c
parent07598c76964a2c73702fa652bcd07ec21088c5ef
drm/amd/display: Move dml2_destroy to non-FPU compilation unit

On PREEMPT_RT kernels, vfree() can sleep because spin_lock is
converted to rt_mutex. dml2_destroy() calls vfree() while inside
an FPU-guarded region (preempt_count=2), which is illegal.

dml2_wrapper_fpu.c is compiled with CC_FLAGS_FPU which defines
_LINUX_FPU_COMPILATION_UNIT, making DC_RUN_WITH_PREEMPTION_ENABLED()
resolve to a no-op. This prevents the macro from cycling FPU
context off/on around vfree().

Move dml2_destroy() to dml2_wrapper.c (non-FPU compilation unit)
where DC_RUN_WITH_PREEMPTION_ENABLED() properly cycles DC_FP_END/
DC_FP_START around vfree(). This pairs it with dml2_allocate_memory()
which already lives there.

Reviewed-by: Dillon Varone <dillon.varone@amd.com>
Signed-off-by: Rafal Ostrowski <rafal.ostrowski@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dml2_0/dml21/dml21_wrapper.c
drivers/gpu/drm/amd/display/dc/dml2_0/dml2_wrapper.c
drivers/gpu/drm/amd/display/dc/dml2_0/dml2_wrapper_fpu.c