From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 653EB2BDC0A for ; Mon, 15 Dec 2025 12:04:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765800253; cv=none; b=DG8sau5hTWYuqWO9c3+XNRRmYDbM2rKrZZ3xZmz/k8PAQ7sW32QduKtBLX7UEnq5SbnIOqguBVBVhDpIw9/DK0LgfmPezi8IIZwIb4uNd6NFml9udrIkR3g+eLAlqGx9BA2Su9ooa4K1qexapm7hIkWEeGKtyI4Y7JVU7yROF2A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765800253; c=relaxed/simple; bh=eYOwTSgG8D6Vu2T3lV02MEYHN0uSxZWDnIDmBNfxmGQ=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=eGP9xBoE8MyuImNOo06cEfSNjqBnTzqqygTSQmTWBVy4n6RfLp+iAps3lo1DdghHInHcA+QPiYg/6zKftAQoj5s48JCnNV+Q57ZLEVWAh8aQVoyWnnqju21qD/LbcKSJa8YNQPcGhTJIRdkTeOgHTrb1W0qdizM8QO0wIl1cGk0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=Fx+/VycQ; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="Fx+/VycQ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1765800242; bh=eYOwTSgG8D6Vu2T3lV02MEYHN0uSxZWDnIDmBNfxmGQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Fx+/VycQNIjyQDOZTzAQag3fFUtFStbsDBGGugPaP5t1iTUzUCmJz7myFU9hzQAJb PcypJp1YmV48TvlPWee0Vjknlux/oypTgABm0TKJ25E1rX7UKb3WliCljByAkmGf+a o3w5ApDqUK6cmdI+3O3r3IJi4QwMGr7Xoy0ZPYFGczQnwrnc0jfu2mhq5hTfK5gklR 76kTrD10EbjDq6BWqqRTERBFEUDxi86kOgucz4U19wuHksa8ar40UCU+Yg+tz8fr0D Bh2KH3k3awLHYgs+KaurtXQq1fKFL3AoiXAIaC17oc/8uqavnhQ7KoWZakOtjhPfrv Ln51vnyl7uyMw== Received: from fedora (unknown [IPv6:2a01:e0a:2c:6930:d919:a6e:5ea1:8a9f]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bbrezillon) by bali.collaboradmins.com (Postfix) with ESMTPSA id 5B00117E11FB; Mon, 15 Dec 2025 13:04:02 +0100 (CET) Date: Mon, 15 Dec 2025 13:03:56 +0100 From: Boris Brezillon To: Lukas Zapolskas Cc: Liviu Dudau , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , nd@arm.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Paul Toadere Subject: Re: [PATCH v1 1/5] drm/panthor: Implement CS_FAULT propagation to userspace Message-ID: <20251215130356.0e1a25ee@fedora> In-Reply-To: <20251215115457.2137485-2-lukas.zapolskas@arm.com> References: <20251215115457.2137485-1-lukas.zapolskas@arm.com> <20251215115457.2137485-2-lukas.zapolskas@arm.com> Organization: Collabora X-Mailer: Claws Mail 4.3.1 (GTK 3.24.51; x86_64-redhat-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 15 Dec 2025 11:54:53 +0000 Lukas Zapolskas wrote: > From: Paul Toadere > > Though faulted queues do not prevent further submission, the > recoverable faults may have further consequences which are > worth recording and providing to the user. > > Signed-off-by: Paul Toadere > Co-developed-by: Lukas Zapolskas > Signed-off-by: Lukas Zapolskas > --- > drivers/gpu/drm/panthor/panthor_sched.c | 18 +++++++++++++++--- > include/uapi/drm/panthor_drm.h | 11 +++++++++-- > 2 files changed, 24 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/panthor/panthor_sched.c b/drivers/gpu/drm/panthor/panthor_sched.c > index a17b067a0439..eb8841beba39 100644 > --- a/drivers/gpu/drm/panthor/panthor_sched.c > +++ b/drivers/gpu/drm/panthor/panthor_sched.c > @@ -569,6 +569,14 @@ struct panthor_group { > /** @fatal_queues: Bitmask reflecting the queues that hit a fatal exception. */ > u32 fatal_queues; > > + /** > + * @fault_queues: Bitmask reflecting the queues that hit a recoverable exception. > + * > + * This field is reset when the GROUP_GET_STATE ioctl is used to collect the fault > + * information. > + */ > + u32 fault_queues; s/fault_queues/faulty_queues/ ? > + > /** @tiler_oom: Mask of queues that have a tiler OOM event to process. */ > atomic_t tiler_oom; > > @@ -1553,6 +1561,8 @@ cs_slot_process_fault_event_locked(struct panthor_device *ptdev, > if (group) { > drm_warn(&ptdev->base, "CS_FAULT: pid=%d, comm=%s\n", > group->task_info.pid, group->task_info.comm); > + > + group->fault_queues |= BIT(cs_id); > } > > drm_warn(&ptdev->base, > @@ -3807,9 +3817,6 @@ int panthor_group_get_state(struct panthor_file *pfile, > struct panthor_scheduler *sched = ptdev->scheduler; > struct panthor_group *group; > > - if (get_state->pad) > - return -EINVAL; > - > group = group_from_handle(gpool, get_state->group_handle); > if (!group) > return -EINVAL; > @@ -3825,6 +3832,11 @@ int panthor_group_get_state(struct panthor_file *pfile, > } > if (group->innocent) > get_state->state |= DRM_PANTHOR_GROUP_STATE_INNOCENT; > + if (group->fault_queues) { > + get_state->state |= DRM_PANTHOR_GROUP_STATE_QUEUE_FAULT; > + get_state->fault_queues = group->fault_queues; > + group->fault_queues = 0; > + } > mutex_unlock(&sched->lock); > > group_put(group); > diff --git a/include/uapi/drm/panthor_drm.h b/include/uapi/drm/panthor_drm.h > index e238c6264fa1..77262d2b9672 100644 > --- a/include/uapi/drm/panthor_drm.h > +++ b/include/uapi/drm/panthor_drm.h > @@ -965,6 +965,13 @@ enum drm_panthor_group_state_flags { > * DRM_PANTHOR_GROUP_STATE_FATAL_FAULT is not. > */ > DRM_PANTHOR_GROUP_STATE_INNOCENT = 1 << 2, > + > + /** > + * @DRM_PANTHOR_GROUP_STATE_QUEUE_FAULT: Group had recoverable faults. > + * > + * When a group ends up with this flag set, jobs can still be submitted to its queues. > + */ > + DRM_PANTHOR_GROUP_STATE_QUEUE_FAULT = 1 << 3, > }; > > /** > @@ -986,8 +993,8 @@ struct drm_panthor_group_get_state { > /** @fatal_queues: Bitmask of queues that faced fatal faults. */ > __u32 fatal_queues; > > - /** @pad: MBZ */ > - __u32 pad; > + /** @fatal_queues: Bitmask of queues that faced fatal faults. */ s/fatal/recoverable/ > + __u32 fault_queues; > }; > > /**