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 B59DCD33997 for ; Mon, 28 Oct 2024 15:31:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2D74810E4F2; Mon, 28 Oct 2024 15:31:23 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by gabe.freedesktop.org (Postfix) with ESMTP id 2B80D10E4F2 for ; Mon, 28 Oct 2024 15:31:22 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5B606497; Mon, 28 Oct 2024 08:31:51 -0700 (PDT) Received: from [10.57.87.236] (unknown [10.57.87.236]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 184C03F73B; Mon, 28 Oct 2024 08:31:19 -0700 (PDT) Message-ID: <77b33c83-261c-48d5-ab55-ec5e1bf61daf@arm.com> Date: Mon, 28 Oct 2024 15:31:18 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/3] drm/panthor: Report group as timedout when we fail to properly suspend To: Boris Brezillon , Liviu Dudau , =?UTF-8?Q?Adri=C3=A1n_Larumbe?= Cc: Christopher Healy , dri-devel@lists.freedesktop.org, kernel@collabora.com References: <20241028114815.3793855-1-boris.brezillon@collabora.com> <20241028114815.3793855-3-boris.brezillon@collabora.com> From: Steven Price Content-Language: en-GB In-Reply-To: <20241028114815.3793855-3-boris.brezillon@collabora.com> Content-Type: text/plain; charset=UTF-8 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 28/10/2024 11:48, Boris Brezillon wrote: > If we don't do that, the group is considered usable by userspace, but > all further GROUP_SUBMIT will fail with -EINVAL. > > Changes in v2: > - New patch > > Fixes: de8548813824 ("drm/panthor: Add the scheduler logical block") > Signed-off-by: Boris Brezillon I guess a failure to suspend is close enough to a time out. I think the only case that might actually matter is dealt with by your next patch. Reviewed-by: Steven Price > --- > drivers/gpu/drm/panthor/panthor_sched.c | 15 +++++++++++---- > 1 file changed, 11 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/panthor/panthor_sched.c b/drivers/gpu/drm/panthor/panthor_sched.c > index eda8fbb276b3..ef4bec7ff9c7 100644 > --- a/drivers/gpu/drm/panthor/panthor_sched.c > +++ b/drivers/gpu/drm/panthor/panthor_sched.c > @@ -602,10 +602,11 @@ struct panthor_group { > * @timedout: True when a timeout occurred on any of the queues owned by > * this group. > * > - * Timeouts can be reported by drm_sched or by the FW. In any case, any > - * timeout situation is unrecoverable, and the group becomes useless. > - * We simply wait for all references to be dropped so we can release the > - * group object. > + * Timeouts can be reported by drm_sched or by the FW. If a reset is required, > + * and the group can't be suspended, this also leads to a timeout. In any case, > + * any timeout situation is unrecoverable, and the group becomes useless. We > + * simply wait for all references to be dropped so we can release the group > + * object. > */ > bool timedout; > > @@ -2687,6 +2688,12 @@ void panthor_sched_suspend(struct panthor_device *ptdev) > csgs_upd_ctx_init(&upd_ctx); > while (slot_mask) { > u32 csg_id = ffs(slot_mask) - 1; > + struct panthor_csg_slot *csg_slot = &sched->csg_slots[csg_id]; > + > + /* We consider group suspension failures as fatal and flag the > + * group as unusable by setting timedout=true. > + */ > + csg_slot->group->timedout = true; > > csgs_upd_ctx_queue_reqs(ptdev, &upd_ctx, csg_id, > CSG_STATE_TERMINATE,