@@ -2054,6 +2054,7 @@ void amdgpu_gfx_enforce_isolation_ring_begin_use(struct amdgpu_ring *ring)
20542054{
20552055 struct amdgpu_device * adev = ring -> adev ;
20562056 u32 idx ;
2057+ bool sched_work = false;
20572058
20582059 if (!adev -> gfx .enable_cleaner_shader )
20592060 return ;
@@ -2072,9 +2073,12 @@ void amdgpu_gfx_enforce_isolation_ring_begin_use(struct amdgpu_ring *ring)
20722073 mutex_lock (& adev -> enforce_isolation_mutex );
20732074 if (adev -> enforce_isolation [idx ]) {
20742075 if (adev -> kfd .init_complete )
2075- amdgpu_gfx_kfd_sch_ctrl ( adev , idx , false) ;
2076+ sched_work = true ;
20762077 }
20772078 mutex_unlock (& adev -> enforce_isolation_mutex );
2079+
2080+ if (sched_work )
2081+ amdgpu_gfx_kfd_sch_ctrl (adev , idx , false);
20782082}
20792083
20802084/**
@@ -2090,6 +2094,7 @@ void amdgpu_gfx_enforce_isolation_ring_end_use(struct amdgpu_ring *ring)
20902094{
20912095 struct amdgpu_device * adev = ring -> adev ;
20922096 u32 idx ;
2097+ bool sched_work = false;
20932098
20942099 if (!adev -> gfx .enable_cleaner_shader )
20952100 return ;
@@ -2105,9 +2110,12 @@ void amdgpu_gfx_enforce_isolation_ring_end_use(struct amdgpu_ring *ring)
21052110 mutex_lock (& adev -> enforce_isolation_mutex );
21062111 if (adev -> enforce_isolation [idx ]) {
21072112 if (adev -> kfd .init_complete )
2108- amdgpu_gfx_kfd_sch_ctrl ( adev , idx , true) ;
2113+ sched_work = true;
21092114 }
21102115 mutex_unlock (& adev -> enforce_isolation_mutex );
2116+
2117+ if (sched_work )
2118+ amdgpu_gfx_kfd_sch_ctrl (adev , idx , true);
21112119}
21122120
21132121/*
0 commit comments