From: Philipp Stanner <pstanner@redhat.com>
To: Luben Tuikov <ltuikov89@gmail.com>,
Matthew Brost <matthew.brost@intel.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Philipp Stanner <pstanner@redhat.com>
Subject: [PATCH] drm/sched: Document drm_sched_job_arm()'s effect on fences
Date: Mon, 26 Aug 2024 11:39:17 +0200 [thread overview]
Message-ID: <20240826093916.29065-2-pstanner@redhat.com> (raw)
The GPU Scheduler's job initialization is split into two steps,
drm_sched_job_init() and drm_sched_job_arm(). One reason for this is
that actually arming a job results in the job's fences getting
initialized (armed).
Currently, the documentation does not explicitly state what
drm_sched_job_arm() does in this regard and which rules the API-User has
to follow once the function has been called.
Add a section to drm_sched_job_arm()'s docstring which details the
function's consequences regarding the job's fences.
Signed-off-by: Philipp Stanner <pstanner@redhat.com>
---
drivers/gpu/drm/scheduler/sched_main.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c
index 7e90c9f95611..e563eff4887c 100644
--- a/drivers/gpu/drm/scheduler/sched_main.c
+++ b/drivers/gpu/drm/scheduler/sched_main.c
@@ -831,6 +831,12 @@ EXPORT_SYMBOL(drm_sched_job_init);
* Refer to drm_sched_entity_push_job() documentation for locking
* considerations.
*
+ * drm_sched_job_cleanup() can be used to disarm the job again - but only
+ * _before_ the job's fences have been published. Once a drm_sched_fence was
+ * published, the associated job needs to be submitted to and processed by the
+ * scheduler to avoid potential deadlocks on the DMA fences encapsulated by
+ * drm_sched_fence.
+ *
* This can only be called if drm_sched_job_init() succeeded.
*/
void drm_sched_job_arm(struct drm_sched_job *job)
--
2.46.0
next reply other threads:[~2024-08-26 9:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-26 9:39 Philipp Stanner [this message]
2024-08-27 17:35 ` [PATCH] drm/sched: Document drm_sched_job_arm()'s effect on fences Daniel Vetter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240826093916.29065-2-pstanner@redhat.com \
--to=pstanner@redhat.com \
--cc=airlied@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ltuikov89@gmail.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=matthew.brost@intel.com \
--cc=mripard@kernel.org \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox