Skip to content

Commit

Permalink
panfrost: Don't cleanup the job if it was successfully queued
Browse files Browse the repository at this point in the history
The labels are misleading. Even though they are all prefixed with 'fail_'
the success case also takes that path, and we should definitely not
cleanup the job if it's been queued. While at it, let's rename those
labels so we don't do the same mistake again.

Fixes: 5351628 ("drm/panfrost: use scheduler dependency tracking")
Signed-off-by: Boris Brezillon <[email protected]>
Reviewed-by: Daniel Vetter <[email protected]>
Reviewed-by: Steven Price <[email protected]>
Tested-by: Steven Price <[email protected]>
Signed-off-by: Steven Price <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
bbrezillon authored and Steven Price committed Sep 2, 2021
1 parent c97f082 commit 771d205
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions drivers/gpu/drm/panfrost/panfrost_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ static int panfrost_ioctl_submit(struct drm_device *dev, void *data,
job = kzalloc(sizeof(*job), GFP_KERNEL);
if (!job) {
ret = -ENOMEM;
goto fail_out_sync;
goto out_put_syncout;
}

kref_init(&job->refcount);
Expand All @@ -270,29 +270,30 @@ static int panfrost_ioctl_submit(struct drm_device *dev, void *data,
&job->file_priv->sched_entity[slot],
NULL);
if (ret)
goto fail_job_put;
goto out_put_job;

ret = panfrost_copy_in_sync(dev, file, args, job);
if (ret)
goto fail_job;
goto out_cleanup_job;

ret = panfrost_lookup_bos(dev, file, args, job);
if (ret)
goto fail_job;
goto out_cleanup_job;

ret = panfrost_job_push(job);
if (ret)
goto fail_job;
goto out_cleanup_job;

/* Update the return sync object for the job */
if (sync_out)
drm_syncobj_replace_fence(sync_out, job->render_done_fence);

fail_job:
drm_sched_job_cleanup(&job->base);
fail_job_put:
out_cleanup_job:
if (ret)
drm_sched_job_cleanup(&job->base);
out_put_job:
panfrost_job_put(job);
fail_out_sync:
out_put_syncout:
if (sync_out)
drm_syncobj_put(sync_out);

Expand Down

0 comments on commit 771d205

Please sign in to comment.