Skip to content

Commit b1bcdd4

Browse files
Tianci Yinalexdeucher
authored andcommitted
drm/amd/display: Disable migration to ensure consistency of per-CPU variable
[why] Since the variable fpu_recursion_depth is per-CPU type, it has one copy on each CPU, thread migration causes data consistency issue, then the call trace shows up. And preemption disabling can't prevent migration. [how] Disable migration to ensure consistency of fpu_recursion_depth. Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com> Signed-off-by: Tianci Yin <tianci.yin@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent fc3888f commit b1bcdd4

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

  • drivers/gpu/drm/amd/display/amdgpu_dm

drivers/gpu/drm/amd/display/amdgpu_dm/dc_fpu.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ void dc_fpu_begin(const char *function_name, const int line)
8989

9090
if (*pcpu == 1) {
9191
#if defined(CONFIG_X86)
92+
migrate_disable();
9293
kernel_fpu_begin();
9394
#elif defined(CONFIG_PPC64)
9495
if (cpu_has_feature(CPU_FTR_VSX_COMP)) {
@@ -129,6 +130,7 @@ void dc_fpu_end(const char *function_name, const int line)
129130
if (*pcpu <= 0) {
130131
#if defined(CONFIG_X86)
131132
kernel_fpu_end();
133+
migrate_enable();
132134
#elif defined(CONFIG_PPC64)
133135
if (cpu_has_feature(CPU_FTR_VSX_COMP)) {
134136
disable_kernel_vsx();

0 commit comments

Comments
 (0)