drm/msm/gem: Don't queue job to sched in error cases
authorRob Clark <robdclark@chromium.org>
Tue, 21 Nov 2023 00:38:47 +0000 (16:38 -0800)
committerRob Clark <robdclark@chromium.org>
Sun, 10 Dec 2023 18:23:13 +0000 (10:23 -0800)
We shouldn't be running the job in error cases.  This also avoids having
to think too hard about where the objs get unpinned (and if necessary,
the resv takes over tracking that the obj is busy).. ie. error cases it
always happens synchronously, and normal cases it happens from scheduler
job_run() callback.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/568331/

drivers/gpu/drm/msm/msm_gem_submit.c

index 51726c9ddffdfcf669de3fbae8425521653e0421..0bcdc589ceea00bd6590475dfbc54be8966aada7 100644 (file)
@@ -946,6 +946,9 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
                }
        }
 
+       if (ret)
+               goto out;
+
        submit_attach_object_fences(submit);
 
        /* The scheduler owns a ref now: */