Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <dev@lankhorst.se>
To: intel-xe@lists.freedesktop.org
Cc: Maarten Lankhorst <dev@lankhorst.se>
Subject: [PATCH v2 1/2] drm/xe: Export xe_irq_synchronize and use it in display
Date: Wed, 16 Jul 2025 23:23:17 +0200	[thread overview]
Message-ID: <20250716212318.239017-2-dev@lankhorst.se> (raw)
In-Reply-To: <20250716212318.239017-1-dev@lankhorst.se>

Use the same helper instead of calling synchronize_irq() directly,
this makes the next patch possible.

Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
---
 drivers/gpu/drm/xe/display/ext/i915_irq.c |  3 ++-
 drivers/gpu/drm/xe/xe_irq.c               | 13 +++++++++----
 drivers/gpu/drm/xe/xe_irq.h               |  1 +
 3 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/xe/display/ext/i915_irq.c b/drivers/gpu/drm/xe/display/ext/i915_irq.c
index 3c6bca66ddab6..259b8ee7a0ccf 100644
--- a/drivers/gpu/drm/xe/display/ext/i915_irq.c
+++ b/drivers/gpu/drm/xe/display/ext/i915_irq.c
@@ -6,6 +6,7 @@
 #include "i915_irq.h"
 #include "i915_reg.h"
 #include "intel_uncore.h"
+#include "xe_irq.h"
 
 void gen2_irq_reset(struct intel_uncore *uncore, struct i915_irq_regs regs)
 {
@@ -81,5 +82,5 @@ bool intel_irqs_enabled(struct xe_device *xe)
 
 void intel_synchronize_irq(struct xe_device *xe)
 {
-	synchronize_irq(to_pci_dev(xe->drm.dev)->irq);
+	xe_irq_synchronize(xe);
 }
diff --git a/drivers/gpu/drm/xe/xe_irq.c b/drivers/gpu/drm/xe/xe_irq.c
index 5df5b8c2a3e4d..98d4062df2462 100644
--- a/drivers/gpu/drm/xe/xe_irq.c
+++ b/drivers/gpu/drm/xe/xe_irq.c
@@ -786,15 +786,20 @@ static void xe_irq_msi_synchronize_irq(struct xe_device *xe)
 	synchronize_irq(to_pci_dev(xe->drm.dev)->irq);
 }
 
-void xe_irq_suspend(struct xe_device *xe)
+void xe_irq_synchronize(struct xe_device *xe)
 {
-	atomic_set(&xe->irq.enabled, 0); /* no new irqs */
-
-	/* flush irqs */
 	if (xe_device_has_msix(xe))
 		xe_irq_msix_synchronize_irq(xe);
 	else
 		xe_irq_msi_synchronize_irq(xe);
+}
+
+void xe_irq_suspend(struct xe_device *xe)
+{
+	atomic_set(&xe->irq.enabled, 0); /* no new irqs */
+
+	/* flush irqs */
+	xe_irq_synchronize(xe);
 	xe_irq_reset(xe); /* turn irqs off */
 }
 
diff --git a/drivers/gpu/drm/xe/xe_irq.h b/drivers/gpu/drm/xe/xe_irq.h
index a28bd577ba52a..9af66d4f18723 100644
--- a/drivers/gpu/drm/xe/xe_irq.h
+++ b/drivers/gpu/drm/xe/xe_irq.h
@@ -18,6 +18,7 @@ int xe_irq_init(struct xe_device *xe);
 int xe_irq_install(struct xe_device *xe);
 void xe_irq_suspend(struct xe_device *xe);
 void xe_irq_resume(struct xe_device *xe);
+void xe_irq_synchronize(struct xe_device *xe);
 void xe_irq_enable_hwe(struct xe_gt *gt);
 int xe_irq_msix_request_irq(struct xe_device *xe, irq_handler_t handler, void *irq_buf,
 			    const char *name, bool dynamic_msix, u16 *msix);
-- 
2.45.2


  reply	other threads:[~2025-07-16 21:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-16 21:23 [PATCH v2 0/2] drm/xe: Fix hotplug after device suspend Maarten Lankhorst
2025-07-16 21:23 ` Maarten Lankhorst [this message]
2025-07-16 21:23 ` [PATCH v2 2/2] drm/xe: Disable display irqs during suspend sequence Maarten Lankhorst
2025-07-16 22:35 ` ✗ CI.checkpatch: warning for drm/xe: Fix hotplug after device suspend (rev2) Patchwork
2025-07-16 22:37 ` ✓ CI.KUnit: success " Patchwork
2025-07-16 23:34 ` ✓ Xe.CI.BAT: " Patchwork
2025-07-17 22:24 ` ✗ 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=20250716212318.239017-2-dev@lankhorst.se \
    --to=dev@lankhorst.se \
    --cc=intel-xe@lists.freedesktop.org \
    /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