Re: [PATCH 2/2] drm/scheduler: avoid infinite loop if entity's dependency is a scheduled error fence

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 17.05.23 um 23:01 schrieb Alex Deucher:
On Wed, May 17, 2023 at 11:02 AM Alex Deucher <alexdeucher@xxxxxxxxx> wrote:
+ dri-devel for scheduler

On Tue, May 9, 2023 at 6:23 AM ZhenGuo Yin <zhenguo.yin@xxxxxxx> wrote:
[Why]
drm_sched_entity_add_dependency_cb ignores the scheduled fence and return false.
If entity's dependency is a schedulerd error fence and drm_sched_stop is called
typo: schedulerd -> scheduler

due to TDR, drm_sched_entity_pop_job will wait for the dependency infinitely.

[How]
Do not wait or ignore the scheduled error fence, add drm_sched_entity_wakeup
callback for the dependency with scheduled error fence.

Signed-off-by: ZhenGuo Yin <zhenguo.yin@xxxxxxx>
The series looks good to me, but it would be good to have Christian
take a look as well.  Series is:
Acked-by: Alex Deucher <alexander.deucher@xxxxxxx>

With Alex comments fixes Reviewed-by: Christian König <christian.koenig@xxxxxxx>.

But Luben should probably push the patches upstream through drm-misc-next.

Christian.


---
  drivers/gpu/drm/scheduler/sched_entity.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/scheduler/sched_entity.c b/drivers/gpu/drm/scheduler/sched_entity.c
index d3f4ada6a68e..96e173b0a6c6 100644
--- a/drivers/gpu/drm/scheduler/sched_entity.c
+++ b/drivers/gpu/drm/scheduler/sched_entity.c
@@ -384,7 +384,7 @@ static bool drm_sched_entity_add_dependency_cb(struct drm_sched_entity *entity)
         }

         s_fence = to_drm_sched_fence(fence);
-       if (s_fence && s_fence->sched == sched &&
+       if (!fence->error && s_fence && s_fence->sched == sched &&
             !test_bit(DRM_SCHED_FENCE_DONT_PIPELINE, &fence->flags)) {

                 /*
--
2.35.1





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux