]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/panthor: Fail job creation when the group is dead
authorBoris Brezillon <boris.brezillon@collabora.com>
Tue, 29 Oct 2024 15:29:10 +0000 (16:29 +0100)
committerBoris Brezillon <boris.brezillon@collabora.com>
Wed, 30 Oct 2024 15:37:09 +0000 (16:37 +0100)
Userspace can use GROUP_SUBMIT errors as a trigger to check the group
state and recreate the group if it became unusable. Make sure we
report an error when the group became unusable.

Changes in v3:
- None

Changes in v2:
- Add R-bs

Fixes: de8548813824 ("drm/panthor: Add the scheduler logical block")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241029152912.270346-2-boris.brezillon@collabora.com
drivers/gpu/drm/panthor/panthor_sched.c

index aee362abb7101daa2c9c4d5adb2c9874b7cef6a3..05119d9bb279364cebae4c1446b6e285e6404b21 100644 (file)
@@ -3409,6 +3409,11 @@ panthor_job_create(struct panthor_file *pfile,
                goto err_put_job;
        }
 
+       if (!group_can_run(job->group)) {
+               ret = -EINVAL;
+               goto err_put_job;
+       }
+
        if (job->queue_idx >= job->group->queue_count ||
            !job->group->queues[job->queue_idx]) {
                ret = -EINVAL;