diff mbox series

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

Message ID 20241025132105.2348441-1-boris.brezillon@collabora.com (mailing list archive)
State New
Headers show
Series drm/panthor: Fail job creation when the group is dead | expand

Commit Message

Boris Brezillon Oct. 25, 2024, 1:21 p.m. UTC
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")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 drivers/gpu/drm/panthor/panthor_sched.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Steven Price Oct. 25, 2024, 1:48 p.m. UTC | #1
On 25/10/2024 14:21, Boris Brezillon wrote:
> 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")
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>

Reviewed-by: Steven Price <steven.price@arm.com>

> ---
>  drivers/gpu/drm/panthor/panthor_sched.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/gpu/drm/panthor/panthor_sched.c b/drivers/gpu/drm/panthor/panthor_sched.c
> index 423743ad8842..9f02554a20db 100644
> --- a/drivers/gpu/drm/panthor/panthor_sched.c
> +++ b/drivers/gpu/drm/panthor/panthor_sched.c
> @@ -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;
Liviu Dudau Oct. 25, 2024, 3:10 p.m. UTC | #2
On Fri, Oct 25, 2024 at 03:21:05PM +0200, Boris Brezillon wrote:
> 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")
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>

Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>

Best regards,
Liviu

> ---
>  drivers/gpu/drm/panthor/panthor_sched.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/gpu/drm/panthor/panthor_sched.c b/drivers/gpu/drm/panthor/panthor_sched.c
> index 423743ad8842..9f02554a20db 100644
> --- a/drivers/gpu/drm/panthor/panthor_sched.c
> +++ b/drivers/gpu/drm/panthor/panthor_sched.c
> @@ -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;
> -- 
> 2.46.2
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/panthor/panthor_sched.c b/drivers/gpu/drm/panthor/panthor_sched.c
index 423743ad8842..9f02554a20db 100644
--- a/drivers/gpu/drm/panthor/panthor_sched.c
+++ b/drivers/gpu/drm/panthor/panthor_sched.c
@@ -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;