All of lore.kernel.org
 help / color / mirror / Atom feed
From: stuartsummers <stuart.summers@intel.com>
Cc: intel-xe@lists.freedesktop.org, matthew.brost@intel.com,
	farah.kassabri@intel.com,
	stuartsummers <stuart.summers@intel.com>
Subject: [PATCH 2/9] drm/xe: Stop the TLB fence timer on driver teardown
Date: Wed, 13 Aug 2025 19:47:59 +0000	[thread overview]
Message-ID: <20250813194806.140500-3-stuart.summers@intel.com> (raw)
In-Reply-To: <20250813194806.140500-1-stuart.summers@intel.com>

There is a small window of time during the driver teardown where
the TLB invalidation fence->gt is set to NULL but an invalidation
worker is still alive. This won't cause an issue currently because
the tlb_invalidation structure itself is still present. However as
part of a future refactor, we are looking to split that structure
out. To be safe, go ahead and cancel any outstanding TLB invalidation
fence worker thread on _fini() since at that time we are already
tearing down the driverworker thread on _fini() since at that time we
are already tearing down the driver and don't need to continue
monitoring this.

Signed-off-by: stuartsummers <stuart.summers@intel.com>
---
 drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c b/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
index 75854b963d66..08e882433b13 100644
--- a/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
+++ b/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
@@ -44,6 +44,8 @@ static void xe_gt_tlb_invalidation_fence_fini(struct xe_gt_tlb_invalidation_fenc
 	if (WARN_ON_ONCE(!fence->gt))
 		return;
 
+	cancel_delayed_work(&fence->gt->tlb_invalidation.fence_tdr);
+
 	xe_pm_runtime_put(gt_to_xe(fence->gt));
 	fence->gt = NULL; /* fini() should be called once */
 }
-- 
2.34.1


  parent reply	other threads:[~2025-08-13 19:48 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-13 19:47 [PATCH 0/9] Add TLB invalidation abstraction stuartsummers
2025-08-13 19:47 ` [PATCH 1/9] drm/xe: Move explicit CT lock in TLB invalidation sequence stuartsummers
2025-08-13 19:47 ` stuartsummers [this message]
2025-08-13 21:19   ` [PATCH 2/9] drm/xe: Stop the TLB fence timer on driver teardown Matthew Brost
2025-08-13 21:24     ` Matthew Brost
2025-08-15 20:33       ` Summers, Stuart
2025-08-15 20:48         ` Matthew Brost
2025-08-15 20:59           ` Summers, Stuart
2025-08-13 19:48 ` [PATCH 3/9] drm/xe: s/tlb_invalidation/tlb_inval stuartsummers
2025-08-13 19:48 ` [PATCH 4/9] drm/xe: Add xe_tlb_inval structure stuartsummers
2025-08-13 19:48 ` [PATCH 5/9] drm/xe: Add xe_gt_tlb_invalidation_done_handler stuartsummers
2025-08-13 19:48 ` [PATCH 6/9] drm/xe: Decouple TLB invalidations from GT stuartsummers
2025-08-13 19:48 ` [PATCH 7/9] drm/xe: Prep TLB invalidation fence before sending stuartsummers
2025-08-13 19:48 ` [PATCH 8/9] drm/xe: Add helpers to send TLB invalidations stuartsummers
2025-08-13 19:48 ` [PATCH 9/9] drm/xe: Split TLB invalidation code in frontend and backend stuartsummers
2025-08-13 21:02 ` ✗ CI.checkpatch: warning for Add TLB invalidation abstraction (rev6) Patchwork
2025-08-13 21:03 ` ✓ CI.KUnit: success " Patchwork
2025-08-13 21:37 ` ✓ Xe.CI.BAT: " Patchwork
2025-08-13 22:48 ` ✗ Xe.CI.Full: failure " 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=20250813194806.140500-3-stuart.summers@intel.com \
    --to=stuart.summers@intel.com \
    --cc=farah.kassabri@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.