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

Christian König christian.koenig at amd.com
Tue May 30 17:58:42 UTC 2023


Am 17.05.23 um 23:01 schrieb Alex Deucher:
> On Wed, May 17, 2023 at 11:02 AM Alex Deucher <alexdeucher at gmail.com> wrote:
>> + dri-devel for scheduler
>>
>> On Tue, May 9, 2023 at 6:23 AM ZhenGuo Yin <zhenguo.yin at amd.com> 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 at amd.com>
> 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 at amd.com>

With Alex comments fixes Reviewed-by: Christian König 
<christian.koenig at amd.com>.

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
>>>



More information about the amd-gfx mailing list