From patchwork Fri Oct 25 13:21:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris Brezillon X-Patchwork-Id: 13850696 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1A636D0C608 for ; Fri, 25 Oct 2024 13:21:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9747C10E1B9; Fri, 25 Oct 2024 13:21:11 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=collabora.com header.i=@collabora.com header.b="FpdoE6Mh"; dkim-atps=neutral Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) by gabe.freedesktop.org (Postfix) with ESMTPS id 10D7A10E1B9 for ; Fri, 25 Oct 2024 13:21:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1729862468; bh=Eq9lG7wbg8q88eGrtEUNjZokVgnzjo7om3fT7yKeto8=; h=From:To:Cc:Subject:Date:From; b=FpdoE6MhVHYTtMPgvITxGCUGeOFrtdL4yhp0CajMN3i01g20tG2JHoRLIF1U3Fz+R Lg8b3dTANrF8v9wqf1so4aNI49zxuGDhW8eri3QA6fxQ4196B4vnkLDQZRrpm2GJBQ Jr2azwL4j94b9x54vVwu7TBxhwdLFdZtYNpNTZFNfN0byUMZcRthigjWSufDCPtJnL zZaecYIp8YnEwHObwQFAJHmQK4F7KsvGTCeVHoT2Cz/kU+/fK6wBh73TjmjM2BPIN2 fFTYcqdLkbJfI27hFuhgATZppwSGbbvFpRx9jnlsJXEW05dyTNEphQrS2QRd8Zn+jm lVRswxEnPmbKQ== Received: from localhost.localdomain (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bbrezillon) by bali.collaboradmins.com (Postfix) with ESMTPSA id 738AC17E35F2; Fri, 25 Oct 2024 15:21:08 +0200 (CEST) From: Boris Brezillon To: Boris Brezillon , Steven Price , Liviu Dudau , =?utf-8?q?Adri=C3=A1n_Larumbe?= Cc: dri-devel@lists.freedesktop.org, Christopher Healy , kernel@collabora.com Subject: [PATCH] drm/panthor: Fail job creation when the group is dead Date: Fri, 25 Oct 2024 15:21:05 +0200 Message-ID: <20241025132105.2348441-1-boris.brezillon@collabora.com> X-Mailer: git-send-email 2.46.2 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 Reviewed-by: Steven Price Reviewed-by: Liviu Dudau --- 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;