From: John Harrison <john.c.harrison@intel.com>
To: Matthew Brost <matthew.brost@intel.com>,
<intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH v6 07/11] drm/xe: Assert runnable state in handle_sched_done
Date: Wed, 12 Jun 2024 14:25:40 -0700 [thread overview]
Message-ID: <70b451a2-b23d-47ce-8d20-501046744959@intel.com> (raw)
In-Reply-To: <20240611144053.2805091-8-matthew.brost@intel.com>
On 6/11/2024 07:40, Matthew Brost wrote:
> Ensure G2H and KMD GuC machine match.
>
> Signed-off-by: Matthew Brost <matthew.brost@intel.com>
> ---
> drivers/gpu/drm/xe/xe_guc_submit.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
> index afd22a8d815d..ab0dc93d7740 100644
> --- a/drivers/gpu/drm/xe/xe_guc_submit.c
> +++ b/drivers/gpu/drm/xe/xe_guc_submit.c
> @@ -1592,16 +1592,21 @@ static void deregister_exec_queue(struct xe_guc *guc, struct xe_exec_queue *q)
> xe_guc_ct_send_g2h_handler(&guc->ct, action, ARRAY_SIZE(action));
> }
>
> -static void handle_sched_done(struct xe_guc *guc, struct xe_exec_queue *q)
> +static void handle_sched_done(struct xe_guc *guc, struct xe_exec_queue *q,
> + u32 runnable_state)
> {
> trace_xe_exec_queue_scheduling_done(q);
>
> if (exec_queue_pending_enable(q)) {
> + xe_gt_assert(guc_to_gt(guc), runnable_state == 1);
> +
> q->guc->resume_time = ktime_get();
> clear_exec_queue_pending_enable(q);
> smp_wmb();
> wake_up_all(&guc->ct.wq);
> } else {
> + xe_gt_assert(guc_to_gt(guc), runnable_state == 0);
> +
Isn't this the wrong way around?
You made an earlier comment that sounded like it is legal for an enable
to be queued while a disable is still pending? If so, then you would get
in here for the disable notification but with both enable_pending and
disable_pending flags set. That would hit the assert. Whereas, if the if
checks the runnable_state parameter and the assert then checks for
pending, you will not hit the assert and the code will do the correct thing.
John.
> clear_exec_queue_pending_disable(q);
> if (q->guc->suspend_pending) {
> suspend_fence_signal(q);
> @@ -1640,7 +1645,7 @@ int xe_guc_sched_done_handler(struct xe_guc *guc, u32 *msg, u32 len)
> return -EPROTO;
> }
>
> - handle_sched_done(guc, q);
> + handle_sched_done(guc, q, runnable_state);
>
> return 0;
> }
next prev parent reply other threads:[~2024-06-12 21:25 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-11 14:40 [PATCH v6 00/11] Only timeout jobs if they run longer than timeout period Matthew Brost
2024-06-11 14:40 ` [PATCH v6 01/11] drm/xe: Add LRC ctx timestamp support functions Matthew Brost
2024-06-11 14:40 ` [PATCH v6 02/11] drm/xe: Add MI_COPY_MEM_MEM GPU instruction definitions Matthew Brost
2024-06-11 14:40 ` [PATCH v6 03/11] drm/xe: Emit ctx timestamp copy in ring ops Matthew Brost
2024-06-11 14:40 ` [PATCH v6 04/11] drm/xe: Add ctx timestamp to LRC snapshot Matthew Brost
2024-06-11 14:40 ` [PATCH v6 05/11] drm/xe: Add xe_gt_clock_interval_to_ms helper Matthew Brost
2024-06-11 14:40 ` [PATCH v6 06/11] drm/xe: Improve unexpected state error messages Matthew Brost
2024-06-11 14:40 ` [PATCH v6 07/11] drm/xe: Assert runnable state in handle_sched_done Matthew Brost
2024-06-11 15:19 ` Cavitt, Jonathan
2024-06-12 21:25 ` John Harrison [this message]
2024-06-12 22:27 ` Matthew Brost
2024-06-13 0:54 ` John Harrison
2024-06-13 1:47 ` Matthew Brost
2024-06-13 2:00 ` John Harrison
2024-06-11 14:40 ` [PATCH v6 08/11] drm/xe: Add GuC state asserts to deregister_exec_queue Matthew Brost
2024-06-11 14:40 ` [PATCH v6 09/11] drm/xe: Add pending disable assert to handle_sched_done Matthew Brost
2024-06-11 14:40 ` [PATCH v6 10/11] drm/xe: Add killed, banned, or wedged as stick bit during GuC reset Matthew Brost
2024-06-11 14:40 ` [PATCH v6 11/11] drm/xe: Sample ctx timestamp to determine if jobs have timed out Matthew Brost
2024-06-12 21:56 ` John Harrison
2024-06-12 22:30 ` Matthew Brost
2024-06-13 0:57 ` John Harrison
2024-06-13 1:51 ` Matthew Brost
2024-08-28 19:23 ` Matt Roper
2024-09-30 20:55 ` Matt Roper
2024-06-11 15:42 ` ✓ CI.Patch_applied: success for Only timeout jobs if they run longer than timeout period Patchwork
2024-06-11 15:42 ` ✗ CI.checkpatch: warning " Patchwork
2024-06-11 15:43 ` ✓ CI.KUnit: success " Patchwork
2024-06-11 15:59 ` ✓ CI.Build: " Patchwork
2024-06-11 16:01 ` ✗ CI.Hooks: failure " Patchwork
2024-06-11 16:03 ` ✓ CI.checksparse: success " Patchwork
2024-06-11 16:57 ` ✓ CI.BAT: " Patchwork
2024-06-11 19:11 ` ✓ CI.FULL: " Patchwork
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=70b451a2-b23d-47ce-8d20-501046744959@intel.com \
--to=john.c.harrison@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.brost@intel.com \
/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