From mboxrd@z Thu Jan 1 00:00:00 1970 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 47F3EC54FB3 for ; Mon, 26 May 2025 07:18:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9B85510E10B; Mon, 26 May 2025 07:18:43 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=collabora.com header.i=@collabora.com header.b="flSGD7em"; dkim-atps=neutral Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) by gabe.freedesktop.org (Postfix) with ESMTPS id 35AE410E10B for ; Mon, 26 May 2025 07:18:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1748243920; bh=An7YfCK9P5Y4IqEAGSFIZ+7Dm9ye7HbtEMNfRfd0Il4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=flSGD7emFIbdlp0qLXRG111oWl4A1cXDZllM5+HlHPV8FSxMcXygIY8kqbdRVR4TE xWsIZ/bDeyHsAj7dM7MlqPNP/2Q37wROemXksM6LnBG56lQ4Lx5q6/D6pxwiDBTktN zMsqq8u4tWtRzkFxWcwO4VSXc4+1fHek9fqrEGUM9X/jMagfzeHBIOlJdnaYPO1bMa NGBdIR36V494xeHB9VtCOaf9dT3bgtvgIY57MMDr99Zui+FNTpbjvpbSd1mxCMFKTh GHkLE0gagkaOcz2ZqidnB2Ur2Fc44uOG+NJVtDPel9XPUGvIEAGeDFsrQ0xXRj99fv Ui5dqla013DpA== Received: from localhost (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 7765917E0E89; Mon, 26 May 2025 09:18:40 +0200 (CEST) Date: Mon, 26 May 2025 09:18:34 +0200 From: Boris Brezillon To: Ashley Smith Cc: Steven Price , Liviu Dudau , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , kernel@collabora.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] drm/panthor: Reset queue slots if termination fails Message-ID: <20250526091834.16548264@collabora.com> In-Reply-To: <20250519145150.2265020-1-ashley.smith@collabora.com> References: <20250519145150.2265020-1-ashley.smith@collabora.com> Organization: Collabora X-Mailer: Claws Mail 4.3.1 (GTK 3.24.49; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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" On Mon, 19 May 2025 15:50:19 +0100 Ashley Smith wrote: > This fixes a bug where if we timeout after a suspend and the termination > fails, due to waiting on a fence that will never be signalled for > example, we do not resume the group correctly. The fix forces a reset > for groups that are not terminated correctly. > > Signed-off-by: Ashley Smith We clearly need a Fixes tag, otherwise "drm/panthor: Make the timeout per-queue instead of per-job" will be backported, but not this one, which will lead to UAF. Can you send a v5 with both patches in the same series, each with a proper Fixes tag? > --- > Changes in v2: > - Fixed syntax error > --- > drivers/gpu/drm/panthor/panthor_sched.c | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/panthor/panthor_sched.c b/drivers/gpu/drm/panthor/panthor_sched.c > index 43ee57728de5..65d8ae3dcac1 100644 > --- a/drivers/gpu/drm/panthor/panthor_sched.c > +++ b/drivers/gpu/drm/panthor/panthor_sched.c > @@ -2727,8 +2727,17 @@ void panthor_sched_suspend(struct panthor_device *ptdev) > * automatically terminate all active groups, so let's > * force the state to halted here. > */ > - if (csg_slot->group->state != PANTHOR_CS_GROUP_TERMINATED) > + if (csg_slot->group->state != PANTHOR_CS_GROUP_TERMINATED) { > csg_slot->group->state = PANTHOR_CS_GROUP_TERMINATED; > + > + /* Reset the queue slots manually if the termination > + * request failed. > + */ > + for (i = 0; i < group->queue_count; i++) { > + if (group->queues[i]) > + cs_slot_reset_locked(ptdev, csg_id, i); > + } > + } > slot_mask &= ~BIT(csg_id); > } > } > > base-commit: 9934ab18051118385c7ea44d8e14175edbe6dc9c