@@ -1989,6 +1989,7 @@ void amdgpu_gfx_enforce_isolation_ring_begin_use(struct amdgpu_ring *ring)
19891989{
19901990 struct amdgpu_device * adev = ring -> adev ;
19911991 u32 idx ;
1992+ bool sched_work = false;
19921993
19931994 if (!adev -> gfx .enable_cleaner_shader )
19941995 return ;
@@ -2007,15 +2008,19 @@ void amdgpu_gfx_enforce_isolation_ring_begin_use(struct amdgpu_ring *ring)
20072008 mutex_lock (& adev -> enforce_isolation_mutex );
20082009 if (adev -> enforce_isolation [idx ]) {
20092010 if (adev -> kfd .init_complete )
2010- amdgpu_gfx_kfd_sch_ctrl ( adev , idx , false) ;
2011+ sched_work = true ;
20112012 }
20122013 mutex_unlock (& adev -> enforce_isolation_mutex );
2014+
2015+ if (sched_work )
2016+ amdgpu_gfx_kfd_sch_ctrl (adev , idx , false);
20132017}
20142018
20152019void amdgpu_gfx_enforce_isolation_ring_end_use (struct amdgpu_ring * ring )
20162020{
20172021 struct amdgpu_device * adev = ring -> adev ;
20182022 u32 idx ;
2023+ bool sched_work = false;
20192024
20202025 if (!adev -> gfx .enable_cleaner_shader )
20212026 return ;
@@ -2031,9 +2036,12 @@ void amdgpu_gfx_enforce_isolation_ring_end_use(struct amdgpu_ring *ring)
20312036 mutex_lock (& adev -> enforce_isolation_mutex );
20322037 if (adev -> enforce_isolation [idx ]) {
20332038 if (adev -> kfd .init_complete )
2034- amdgpu_gfx_kfd_sch_ctrl ( adev , idx , true) ;
2039+ sched_work = true;
20352040 }
20362041 mutex_unlock (& adev -> enforce_isolation_mutex );
2042+
2043+ if (sched_work )
2044+ amdgpu_gfx_kfd_sch_ctrl (adev , idx , true);
20372045}
20382046
20392047/*
0 commit comments