Skip to contentSkip to conversation

drm/panthor: Fail job creation when the group is dead

PATCH Superseded Boris Brezillon 3 participants 3 messages Oct 25, 2024

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Boris Brezillon

author maintainer
#0 lore raw

PATCH 1/1 drm/panthor: Fail job creation when the group is dead

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.

Fixes de8548813824 ("drm/panthor: Add the scheduler logical block")
---
 drivers/gpu/drm/panthor/panthor_sched.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/panthor/panthor_sched.c +5 -0
index 423743ad8842..9f02554a20db 100644
@@ -3678,6 +3678,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;
Signature · 1 line
2.46.2
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Boris Brezillon

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.

Fixes de8548813824 ("drm/panthor: Add the scheduler logical block")
Quoted 20 lines
---
 drivers/gpu/drm/panthor/panthor_sched.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/panthor/panthor_sched.c +5 -0
index 423743ad8842..9f02554a20db 100644
@@ -3678,6 +3678,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;
maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Boris Brezillon
Quoted 6 lines · Boris Brezillon

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.

Fixes de8548813824 ("drm/panthor: Add the scheduler logical block")

Best regards,
Liviu

Quoted 23 lines
---
 drivers/gpu/drm/panthor/panthor_sched.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/panthor/panthor_sched.c +5 -0
index 423743ad8842..9f02554a20db 100644
@@ -3678,6 +3678,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;
Signature · 1 line
2.46.2
Signature · 8 lines
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯