From: Matthew Brost <matthew.brost@intel.com>
To: Matthew Auld <matthew.auld@intel.com>
Cc: <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 16:38:04 +0000 [thread overview]
Message-ID: <ZpqWbJrczJNkqvPX@DUT025-TGLU.fm.intel.com> (raw)
In-Reply-To: <b242f2c3-1c7f-418b-b7f2-0cfd92ba3d67@intel.com>
On Fri, Jul 19, 2024 at 08:50:02AM +0100, Matthew Auld wrote:
> 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?
Yes, will fix when merging.
Matt
next prev parent reply other threads:[~2024-07-19 16:39 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
2024-07-19 16:38 ` Matthew Brost [this message]
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=ZpqWbJrczJNkqvPX@DUT025-TGLU.fm.intel.com \
--to=matthew.brost@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.auld@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