[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241119134122.21950-3-pstanner@redhat.com>
Date: Tue, 19 Nov 2024 14:41:23 +0100
From: Philipp Stanner <pstanner@...hat.com>
To: Luben Tuikov <ltuikov89@...il.com>,
Matthew Brost <matthew.brost@...el.com>,
Danilo Krummrich <dakr@...nel.org>,
Philipp Stanner <pstanner@...hat.com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>,
Simona Vetter <simona@...ll.ch>
Cc: dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org,
Christian König <christian.koenig@....com>
Subject: [PATCH 2/2] drm/sched: Fix docu of drm_sched_entity_flush()
drm_sched_entity_flush()'s documentation states that an error is being
returned when "the process was killed". That is not what the function
actually does.
Furthermore, it contains an inprecise statement about how the function
is part of a convenience wrapper.
Move that statement to drm_sched_entity_destroy().
Correct drm_sched_entity_flush()'s documentation.
Cc: Christian König <christian.koenig@....com>
Signed-off-by: Philipp Stanner <pstanner@...hat.com>
---
drivers/gpu/drm/scheduler/sched_entity.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/scheduler/sched_entity.c b/drivers/gpu/drm/scheduler/sched_entity.c
index 16b172aee453..7af7b448ad06 100644
--- a/drivers/gpu/drm/scheduler/sched_entity.c
+++ b/drivers/gpu/drm/scheduler/sched_entity.c
@@ -270,15 +270,12 @@ static void drm_sched_entity_kill(struct drm_sched_entity *entity)
/**
* drm_sched_entity_flush - Flush a context entity
- *
* @entity: scheduler entity
- * @timeout: time to wait in for Q to become empty in jiffies.
- *
- * Splitting drm_sched_entity_fini() into two functions, The first one does the
- * waiting, removes the entity from the runqueue and returns an error when the
- * process was killed.
+ * @timeout: time to wait in jiffies
*
* Returns: 0 if the timeout ellapsed, the remaining time otherwise.
+
+ * Waits at most @timeout jiffies for the entity's job queue to become empty.
*/
long drm_sched_entity_flush(struct drm_sched_entity *entity, long timeout)
{
@@ -290,7 +287,7 @@ long drm_sched_entity_flush(struct drm_sched_entity *entity, long timeout)
return 0;
sched = entity->rq->sched;
- /**
+ /*
* The client will not queue more IBs during this fini, consume existing
* queued IBs or discard them on SIGKILL
*/
@@ -359,8 +356,11 @@ EXPORT_SYMBOL(drm_sched_entity_fini);
* drm_sched_entity_destroy - Destroy a context entity
* @entity: scheduler entity
*
- * Calls drm_sched_entity_flush() and drm_sched_entity_fini() as a
- * convenience wrapper.
+ * Convenience wrapper for entity teardown.
+ *
+ * Teardown of entities is split into two functions. The first one,
+ * drm_sched_entity_flush(), waits for the entity to become empty. The second
+ * one, drm_sched_entity_fini(), does the actual cleanup of the entity object.
*/
void drm_sched_entity_destroy(struct drm_sched_entity *entity)
{
--
2.47.0
Powered by blists - more mailing lists