From: Matthew Auld <matthew.auld@intel.com>
To: Matthew Brost <matthew.brost@intel.com>, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v4 3/4] drm/xe: Hold a PM ref when GT TLB invalidations are inflight
Date: Fri, 19 Jul 2024 08:50:02 +0100 [thread overview]
Message-ID: <b242f2c3-1c7f-418b-b7f2-0cfd92ba3d67@intel.com> (raw)
In-Reply-To: <20240718185531.1500815-4-matthew.brost@intel.com>
On 18/07/2024 19:55, Matthew Brost wrote:
> Avoid GT TLB invalidation timeouts by holding a PM ref when
> invalidations are inflight.
>
> v2:
> - Drop PM ref before signaling fence (CI)
>
> Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Nirmoy Das <nirmoy.das@intel.com>
> Signed-off-by: Matthew Brost <matthew.brost@intel.com>
> Reviewed-by: Nirmoy Das <nirmoy.das@intel.com>
> ---
> drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c | 62 ++++++++++++-------
> drivers/gpu/drm/xe/xe_gt_tlb_invalidation.h | 1 +
> .../gpu/drm/xe/xe_gt_tlb_invalidation_types.h | 4 ++
> drivers/gpu/drm/xe/xe_vm.c | 4 +-
> 4 files changed, 47 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c b/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
> index 668c1a3f06ac..481d83d07367 100644
> --- a/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
> +++ b/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
> @@ -13,6 +13,7 @@
> #include "xe_guc.h"
> #include "xe_guc_ct.h"
> #include "xe_mmio.h"
> +#include "xe_pm.h"
> #include "xe_sriov.h"
> #include "xe_trace.h"
> #include "regs/xe_guc_regs.h"
> @@ -35,6 +36,24 @@ static long tlb_timeout_jiffies(struct xe_gt *gt)
> return hw_tlb_timeout + 2 * delay;
> }
>
> +static void
> +__invalidation_fence_signal(struct xe_device *xe, struct xe_gt_tlb_invalidation_fence *fence)
> +{
> + bool stack = test_bit(FENCE_STACK_BIT, &fence->base.flags);
> +
> + trace_xe_gt_tlb_invalidation_fence_signal(xe, fence);
> + xe_gt_tlb_invalidation_fence_fini(fence);
> + dma_fence_signal(&fence->base);
> + if (!stack)
> + dma_fence_put(&fence->base);
> +}
> +
> +static void
> +invalidation_fence_signal(struct xe_device *xe, struct xe_gt_tlb_invalidation_fence *fence)
> +{
> + list_del(&fence->link);
> + __invalidation_fence_signal(xe, fence);
> +}
>
> static void xe_gt_tlb_fence_timeout(struct work_struct *work)
> {
> @@ -56,10 +75,8 @@ static void xe_gt_tlb_fence_timeout(struct work_struct *work)
> xe_gt_err(gt, "TLB invalidation fence timeout, seqno=%d recv=%d",
> fence->seqno, gt->tlb_invalidation.seqno_recv);
>
> - list_del(&fence->link);
> fence->base.error = -ETIME;
> - dma_fence_signal(&fence->base);
> - dma_fence_put(&fence->base);
> + invalidation_fence_signal(xe, fence);
Should this be moved to the previous patch, which introduces the fence
on stack?
next prev parent reply other threads:[~2024-07-19 7:50 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-18 18:55 [PATCH v4 0/4] Keep device awake TLB invalidations and G2H in flight Matthew Brost
2024-07-18 18:55 ` [PATCH v4 1/4] drm/xe: Add xe_gt_tlb_invalidation_fence_init helper Matthew Brost
2024-07-18 18:55 ` [PATCH v4 2/4] drm/xe: Drop xe_gt_tlb_invalidation_wait Matthew Brost
2024-07-18 18:55 ` [PATCH v4 3/4] drm/xe: Hold a PM ref when GT TLB invalidations are inflight Matthew Brost
2024-07-19 7:50 ` Matthew Auld [this message]
2024-07-19 16:38 ` Matthew Brost
2024-07-18 18:55 ` [PATCH v4 4/4] drm/xe: Build PM into GuC CT layer Matthew Brost
2024-07-18 19:01 ` ✓ CI.Patch_applied: success for Keep device awake TLB invalidations and G2H in flight Patchwork
2024-07-18 19:01 ` ✓ CI.checkpatch: " Patchwork
2024-07-18 19:02 ` ✓ CI.KUnit: " Patchwork
2024-07-18 19:14 ` ✓ CI.Build: " Patchwork
2024-07-18 19:17 ` ✓ CI.Hooks: " Patchwork
2024-07-18 19:18 ` ✓ CI.checksparse: " Patchwork
2024-07-18 19:41 ` ✗ CI.BAT: failure " Patchwork
2024-07-19 1:34 ` ✗ 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=b242f2c3-1c7f-418b-b7f2-0cfd92ba3d67@intel.com \
--to=matthew.auld@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