[PATCH 2/2] drm/amd/scheduler: remove fence callback when context is killed

Christian K├Ânig ckoenig.leichtzumerken at gmail.com
Tue Nov 7 10:31:11 UTC 2017


Am 07.11.2017 um 03:48 schrieb Chunming Zhou:
> Otherwise there could be page protection.
>
> Change-Id: I1f6c81002fb2ba21c17cdc14fdde86579b28374e
> Signed-off-by: Chunming Zhou <david1.zhou at amd.com>
> ---
>   drivers/gpu/drm/amd/scheduler/gpu_scheduler.c | 6 ++++++
>   1 file changed, 6 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
> index 310904042dfc..e38d55961a9f 100644
> --- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
> +++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
> @@ -243,6 +243,12 @@ void amd_sched_entity_fini(struct amd_gpu_scheduler *sched,
>   			amd_sched_fence_scheduled(s_fence);
>   			kcl_dma_fence_set_error(&s_fence->finished, -ESRCH);
>   			amd_sched_fence_finished(s_fence);
> +			if (s_fence->parent) {
> +				dma_fence_remove_callback(s_fence->parent,
> +							  &s_fence->cb);
> +				dma_fence_put(s_fence->parent);
> +				s_fence->parent = NULL;
> +			}

Mhm, that looks unnecessary to me. The fences should have never been 
scheduled to the hardware and so shouldn't have a parent fence set.

I would rather add a WARN_ON(s_fence->parent); here.

Regards,
Christian.

>   			dma_fence_put(&s_fence->finished);
>   			sched->ops->free_job(job);
>   		}




More information about the amd-gfx mailing list